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.
这个资产会安全暂存
这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。
npx -y tokrepo@latest install 3d040410-7f06-4ab6-aece-d6a0ef7325dd --target codex先暂存文件;激活前需要读取暂存 README 和安装计划。
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
常见问题
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.
引用来源 (3)
- AgentOps GitHub— AgentOps Python SDK for agent observability
- AgentOps Docs— AgentOps documentation and dashboard
- Anthropic Docs— LLM observability best practices
来源与感谢
Created by AgentOps-AI. Licensed under MIT.
agentops — ⭐ 4,500+
讨论
相关资产
AgentOps — Observability for AI Agents
Python SDK for AI agent monitoring. LLM cost tracking, session replay, benchmarking, and error analysis. Integrates with CrewAI, LangChain, AutoGen, and more. 5.4K+ stars.
Codeburn — AI Coding Cost Observability Dashboard
Codeburn is an interactive terminal dashboard that tracks token usage and costs across Claude Code, Codex, and Cursor, helping you understand where your AI coding budget goes.
Laminar — Open-Source Observability for AI Agents
Open-source observability for AI agents: self-host with Docker Compose, then use the SDK to trace runs, metrics, and outputs end-to-end.
Langtrace — Open Source AI Observability Platform
Open-source observability for LLM apps. Trace OpenAI, Anthropic, and LangChain calls with OpenTelemetry-native instrumentation and a real-time dashboard.