🛡️ AgentFlare Docs

SDK Overview

The agentflare Python SDK — what's in the box.

Installation

pip install agentflare

The SDK is a single lightweight Python package with no mandatory dependencies besides httpx and pydantic. LangChain support is optional — it activates automatically if langchain-core is installed.


Package contents

ModuleWhat it does
agentflare.AgentFlareMain class — configure once, use everywhere
agentguard.AgentEventPydantic model for event payloads
agentflare.AgentFlareCallbackLangChain BaseCallbackHandler integration

Imports

from agentflare import AgentFlare, AgentEvent
 
# LangChain integration (requires langchain-core)
from agentflare import AgentFlareCallback

Architecture

The SDK is intentionally thin. It doesn't buffer events, doesn't do local cost calculation, and doesn't maintain persistent connections. Every send_event call is a single synchronous HTTP POST to the backend. This means:

  • Zero impact on startup time — no threads, no background workers
  • Network errors are swallowed silently — a flaky connection won't crash your agent
  • The backend is the source of truth — all cost logic and pause decisions live there

On this page