Instrumenting Your Agent Framework
Maxim offers one-line instrumentation for agent frameworks including LlamaIndex, Google ADK, LangChain, LangGraph, OpenAI Agents SDK, CrewAI, Pydantic AI, and Smolagents. Once instrumented, all agent execution steps and interactions are automatically captured.LlamaIndex Integration
This single line automatically instruments
AgentWorkflow.run() for multi-agent workflow execution, FunctionAgent.run() for function-based agent interactions, and ReActAgent.run() for ReAct reasoning agent calls.Google ADK Integration
LangChain Integration
What Gets Traced Automatically
With Maxim instrumentation enabled, you automatically capture:- Agent execution traces: All tool executions with inputs and outputs, step-by-step decision making process, and performance metrics
- Multi-agent coordination: Agent handoffs, communication patterns, and workflow orchestration
- LLM interactions: Complete prompts and responses, model parameters, token usage, and error handling including failed requests and retry attempts
- Tool chain execution: Sequential and parallel tool usage across complex workflows
- Multi-modal processing: Text, image, and mixed content handling
Key Metrics Collected
The integration automatically collects:- Agent execution time and latency
- Token usage and costs for each agent or workflow
- Error rates and exception details
- Agent interaction patterns and handoff sequences
Viewing Traces in the Dashboard
All agent interactions, tool calls, and workflow executions are automatically traced and available in the Maxim dashboard. You can:- Monitor agent performance and success rates
- Debug failed tool calls and agent reasoning
- Analyze multi-agent coordination patterns
- Track token usage and costs across workflows
- Set up alerts for agent failures or performance issues
Advanced: Custom Callbacks for Additional Control
For more granular control, you can use callback functions to hook into different stages of agent execution. For example, with Google ADK:Available callbacks include
before_generation_callback, after_generation_callback, before_trace_callback, after_trace_callback, before_span_callback, and after_span_callback.