Framework Integrations
Agent Forensics provides one-line integrations for popular agent frameworks. Each integration auto-captures decisions, tool calls, LLM interactions, and errors — no manual recording needed.
Supported Frameworks
| Framework | Integration | Auto-captures |
|---|---|---|
| LangChain / LangGraph | Callback Handler | LLM calls, tools, agent actions, prompt drift |
| OpenAI Agents SDK | AgentHooks | Agent lifecycle, tools, LLM calls with model config |
| CrewAI | Step/Task callbacks | Agent steps, task completion, errors |
| Any framework | Manual API | Whatever you record |
How It Works
All integrations follow the same pattern:
- Create a
Forensicsinstance - Get a framework-specific handler (one line)
- Attach it to your agent
- Run your agent normally — forensics are captured automatically
from agent_forensics import Forensics
f = Forensics(session="my-session", agent="my-agent")
# Choose your framework:
handler = f.langchain() # LangChain
hooks = f.openai_agents() # OpenAI Agents SDK
callbacks = f.crewai() # CrewAI
# After the agent runs:
print(f.report())
failures = f.classify()
Manual + Auto Hybrid
You can combine auto-capture with manual recording. This is useful for adding context that the framework doesn't capture:
f = Forensics(session="hybrid")
# Auto-capture via LangChain
agent.invoke({"input": "..."}, config={"callbacks": [f.langchain()]})
# Manually add context the framework missed
f.context_injection("internal_db", content={"policy": "max $500"})
f.guardrail(intent="buy item", action="purchase", allowed=True, reason="Within policy")