SDK Overview
The agentflare Python SDK — what's in the box.
Installation
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
| Module | What it does |
|---|---|
agentflare.AgentFlare | Main class — configure once, use everywhere |
agentguard.AgentEvent | Pydantic model for event payloads |
agentflare.AgentFlareCallback | LangChain BaseCallbackHandler integration |
Imports
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