Deep Agents
Auto-trace LangChain Deep Agents with enriched visibility into planning, subagent delegation, filesystem operations, and sandbox execution.
Installation
Section titled “Installation”pip install "axonpush[deepagents]"[!NOTE] Requires Python 3.11+ (the
deepagentspackage does not support 3.10).
import osfrom deepagents import create_deep_agentfrom axonpush import AxonPushfrom axonpush.integrations.deepagents import AxonPushDeepAgentHandler
client = AxonPush( api_key=os.environ["AXONPUSH_API_KEY"], tenant_id=os.environ["AXONPUSH_TENANT_ID"], base_url=os.environ.get("AXONPUSH_BASE_URL", "https://api.axonpush.xyz"),)
handler = AxonPushDeepAgentHandler( client=client, channel_id=1, agent_id="deep-agent",)Pass the handler via config to any Deep Agent invocation:
agent = create_deep_agent( tools=[my_tool], system_prompt="You are a helpful assistant.",)
result = agent.invoke( {"messages": [{"role": "user", "content": "Research AI frameworks"}]}, config={"callbacks": [handler]},)Events Traced
Section titled “Events Traced”The handler automatically classifies Deep Agent built-in tools into enriched event identifiers:
| Event | When |
|---|---|
chain.start | Agent chain begins execution |
chain.end | Agent chain completes |
chain.error | Agent chain errors |
llm.start | LLM call begins |
llm.end | LLM call completes |
llm.token | Streaming token received |
planning.update | write_todos tool called (planning step) |
planning.complete | write_todos tool completes |
subagent.spawn | task tool spawns a subagent |
subagent.complete | Subagent finishes |
filesystem.read | read_file, ls, glob, or grep called |
filesystem.write | write_file or edit_file called |
sandbox.execute | execute tool runs a shell command |
tool.<name>.start | Any other tool begins |
tool.end | Any other tool completes |
tool.error | Tool execution errors |
All events include framework: "deepagents" in metadata.