AgentOps — Observability Dashboard for AI Agents
Python SDK for monitoring AI agent sessions with real-time dashboards, token tracking, cost analysis, and error replay. Two lines of code to instrument any framework. 4,500+ GitHub stars.
What it is
AgentOps is a Python SDK for monitoring AI agent sessions with real-time dashboards. It tracks token usage, costs, latency, tool calls, and errors across agent runs. Integration requires adding just two lines of code to your existing agent. The dashboard provides session replay, allowing you to step through an agent's decisions and tool invocations to debug failures.
AgentOps targets developers building AI agents who need visibility into what their agents are doing, how much they cost, and where they fail. It works with any Python agent framework including LangChain, CrewAI, AutoGen, and custom implementations.
How it saves time or tokens
Without observability, debugging a failing agent means adding print statements and re-running sessions. AgentOps records every LLM call, tool invocation, and state transition automatically. The session replay lets you pinpoint exactly where an agent went wrong without re-executing. Token and cost tracking across sessions helps identify which agent patterns are expensive and which are efficient.
How to use
- Install the SDK:
pip install agentops
- Add two lines to your agent code:
import agentops
agentops.init('YOUR_API_KEY') # Get free key at agentops.ai
# Your existing agent code runs unchanged
# AgentOps auto-instruments LLM calls and tool invocations
- View sessions in the AgentOps dashboard at app.agentops.ai.
Example
Instrumenting a LangChain agent:
import agentops
from langchain.agents import create_openai_tools_agent
agentops.init('YOUR_API_KEY')
# Build your agent as usual
agent = create_openai_tools_agent(llm, tools, prompt)
result = agent.invoke({'input': 'Analyze the latest sales data'})
# AgentOps automatically captures:
# - Each LLM call with tokens and latency
# - Tool calls with inputs/outputs
# - Total session cost
# - Any errors or retries
agentops.end_session('Success')
Related on TokRepo
- AI Gateway Providers — LLM observability and tracing platforms
- AI Tools for Agents — frameworks and tools for building AI agents
Common pitfalls
- AgentOps sends telemetry data to its cloud dashboard; for sensitive workloads, check the data retention policy and consider self-hosted alternatives
- Auto-instrumentation may not capture custom tool calls; use the @agentops.record decorator to manually instrument non-standard tools
- Free tier has session limits; high-volume agent deployments should plan for the paid tier or batch sessions
Frequently Asked Questions
AgentOps provides auto-instrumentation for LangChain, CrewAI, AutoGen, and direct OpenAI/Anthropic SDK calls. For other frameworks, you can use the manual recording API with decorators and context managers.
Yes. AgentOps offers a free tier with limited sessions per month. You can get a free API key at agentops.ai. Paid plans increase the session limit and add features like team collaboration and extended data retention.
AgentOps captures LLM calls (model, tokens, latency, cost), tool invocations (name, inputs, outputs), agent state transitions, errors, and session metadata. It does not modify your agent's behavior or outputs.
AgentOps is primarily a SaaS product with a cloud dashboard. The SDK is open source, but the dashboard and storage backend are hosted by AgentOps. Check their documentation for any self-hosting options.
Session replay shows a timeline of every action your agent took during a session: LLM calls, tool invocations, decision points, and errors. You can step through the timeline to see exactly what the agent did and why it made specific choices.
Citations (3)
- AgentOps GitHub— AgentOps Python SDK for agent observability
- AgentOps Docs— AgentOps documentation and dashboard
- Anthropic Docs— LLM observability best practices
Related on TokRepo
Source & Thanks
Created by AgentOps-AI. Licensed under MIT.
agentops — ⭐ 4,500+
Thanks to the AgentOps team for bringing production observability to AI agents.
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.