Skip to content

Deep Agents

Auto-trace LangChain Deep Agents with enriched visibility into planning, subagent delegation, filesystem operations, and sandbox execution.

Terminal window
pip install "axonpush[deepagents]"

[!NOTE] Requires Python 3.11+ (the deepagents package does not support 3.10).

import os
from deepagents import create_deep_agent
from axonpush import AxonPush
from 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]},
)

The handler automatically classifies Deep Agent built-in tools into enriched event identifiers:

EventWhen
chain.startAgent chain begins execution
chain.endAgent chain completes
chain.errorAgent chain errors
llm.startLLM call begins
llm.endLLM call completes
llm.tokenStreaming token received
planning.updatewrite_todos tool called (planning step)
planning.completewrite_todos tool completes
subagent.spawntask tool spawns a subagent
subagent.completeSubagent finishes
filesystem.readread_file, ls, glob, or grep called
filesystem.writewrite_file or edit_file called
sandbox.executeexecute tool runs a shell command
tool.<name>.startAny other tool begins
tool.endAny other tool completes
tool.errorTool execution errors

All events include framework: "deepagents" in metadata.