AgentOps Explained: Observability for AI Agents That Take Action

AgentOps Explained: Observability for AI Agents That Take Action

AgentOps is an observability platform built for AI agents, and it answers a simple question: what did your agent do, and what did it cost? An agent that answers a question may have made a dozen model calls, used three tools, hit an error halfway through and recovered. AgentOps records that whole session so you can replay it, find the failure and see the token spend, all from one dashboard.

The platform is aimed squarely at developers building agents rather than at teams monitoring conventional software. It captures sessions, agents, workflows, operations, model calls, tool calls, errors, timings, prompts, completions, token counts and estimated costs. The Python SDK can auto-instrument supported libraries after a single initialisation call, while decorators and manual controls let teams define their own trace, agent, operation and tool boundaries.

Key takeaways

  • AgentOps is an observability and debugging platform designed for AI agents and LLM applications.
  • Each program run is recorded as a session that can be replayed step by step in a dashboard.
  • It tracks token usage and estimated spend across agents, models and tools, with cost monitoring built in.
  • The Python SDK auto-instruments popular frameworks including CrewAI, LangChain, LangGraph, AutoGen and OpenAI Agents.
  • It includes failure detection, recursive-loop detection and prompt-injection visibility, plus a self-hosted option.

What AgentOps Does

At its core, AgentOps turns agent runs into structured, replayable records. When your agent program runs, the SDK records a session. Inside the session, the run is organised into a hierarchy: session, agent, workflow, operation, model and tool spans, so the dependencies between steps stay visible. The dashboard then shows the session as a list, an aggregate view, a chat-style history of LLM calls, and a timeline waterfall for drilling into an individual span.

That waterfall is the working view for most debugging. It is a time-ordered display of model calls, actions, tools, errors and latency, with the exact prompt and completion available for any selected event. When an agent gives a wrong answer, you can walk the waterfall backwards to the step where the reasoning went wrong, rather than re-running the agent and hoping the failure repeats.

AgentOps also offers point-in-time replay, audit trails, prompt-injection visibility, cost monitoring across agents and fine-tuning from saved completions. The replay feature lets you review a past execution exactly as it happened, which matters for agents because the same prompt rarely produces the same run twice.

A laptop on a wooden desk showing bar charts and a stepped trend graph, with a cup of coffee beside it
AgentOps makes agent behaviour measurable: charts and trends replace guesswork about what your agents did.

Sessions, Agents and the Dashboard

The session is the unit of work in AgentOps. One run of your program is one session, and everything the agent did inside that run belongs to it. Sessions can be filtered by environment, version, customer segment or experiment using custom tags, so a team can compare production runs against a test deployment or track one customer’s sessions separately.

Inside a session, the hierarchy does the organising. Agents contain workflows, workflows contain operations, and operations contain model and tool calls. Decorators such as @session, @agent, @operation, @workflow and @trace let you define those boundaries in your own code, and they record inputs, outputs and exceptions, including for asynchronous and generator functions.

The dashboard supports real-time monitoring alongside the historical view. You can watch sessions as they happen, check aggregate metrics across runs, and drill into a single session when something looks wrong. Our guide to agent observability and tracing covers the general principles behind this kind of setup.

Cost and Token Tracking

Agents are expensive in a way that is easy to underestimate. A single user request can trigger many model calls, and a looping agent can burn through tokens for hours before anyone notices. AgentOps tracks every token an agent sees and visualises spend across multiple agents, with price monitoring for hundreds of large language models. Cost tracking is set up natively and provides a rolling total, so developers can see run costs as they accumulate and predict future costs more accurately.

The cost view breaks spend down by agent, provider and version, which is the level of detail a team needs to act on. If one agent is responsible for most of the spend, the fix may be a cheaper model for that agent, a shorter context, or a limit on retries. Custom costs can also be assigned to tools, so a team can account for paid API calls alongside model tokens.

Failure Detection and Loops

One of the most frustrating agent failures is the loop: an agent that repeats the same task over and over, sometimes for hours, without making progress. AgentOps identifies when agents fall into these recursive patterns, flagging the repetition so the run can be stopped and the cause investigated. Loop detection is one of the features that separates agent observability from ordinary application monitoring, because ordinary software does not usually fail by reasoning in circles.

Error tracking covers the more conventional failures too: exceptions, failed tool calls, timeouts and unexpected agent handoffs. Session-wide metrics give a holistic view of a session, including tool usage statistics that show how often each tool is called and whether particular tools are associated with failures. Cross-session metrics extend that view, showing patterns across many runs rather than a single session.

Security features sit alongside the debugging ones. AgentOps provides prompt-injection detection, including honeypot and prompt-injection detection through PromptArmor, and it keeps a full data trail of logs, errors and prompt-injection attempts from prototype to production. Compliance-oriented features include audit logs and detection of potential threats such as profanity and leaks of personally identifiable information. If you are building recovery into your agents, our article on building agents that recover from failure pairs well with the detection features described here.

Frameworks, Providers and Self-Hosting

AgentOps is designed to work across a mixed stack. Native integrations cover agent frameworks including CrewAI, AG2, Agno, Google ADK, Haystack, LangChain, LangGraph, LlamaIndex, OpenAI Agents and Smolagents, and providers including OpenAI, Anthropic, Google GenAI and IBM WatsonX AI. One tracing layer across frameworks means a team running several agent systems does not need a different observability tool for each one.

The SDK is OpenTelemetry-based, which keeps the instrumentation portable. Initialisation is deliberately light: set an API key in the environment and call the initialisation function, and supported libraries are instrumented automatically. That low setup cost is part of the appeal for small teams, who can start tracing in minutes and add custom decorators only where the automatic boundaries are not enough.

Self-hosting is available for teams that need greater control over data sovereignty, retention, infrastructure and compliance. The full application, including the dashboard and API backend, can be run on infrastructure the team controls, and the app is open source under the MIT licence. A read-only API is also available for exporting trace data programmatically, so metrics can feed reporting or downstream analysis without going through the dashboard.

Evaluations and the Road Ahead

AgentOps provides an evolving suite of evaluation tools. The Python SDK currently supports custom evaluation metrics, multi-session and cross-session metrics, and custom event tag tracking. That is a thinner evaluation story than some competitors offer, and features such as an evaluation builder API, agent scorecards, regression testing and CI/CD checks are still on the roadmap.

The JavaScript and TypeScript SDK is also marked as alpha, so teams building agents in Node.js should expect a less polished experience than the Python SDK offers. That is a normal state of affairs for a young platform, but it matters if your stack is not Python. Check the current state of the TypeScript SDK before committing a Node.js project to it.

Fine-tuning from saved completions is another feature worth noting. Recorded completions can be used to fine-tune specialised models, which turns the observability record into a training resource. That closes a loop that many teams leave open: the runs you observe become the data you improve with.

Capability What AgentOps provides Best for
Session recording Every run saved as a replayable session with a hierarchical span tree Debugging a specific failed run after the fact
Session waterfall Time-ordered view of model calls, tools, errors and latency Finding the exact step where a run went wrong
Cost tracking Token counts and estimated spend across agents, models and tools Controlling LLM bills and spotting expensive agents
Loop detection Recursive thought detection that flags agents stuck repeating work Stopping runaway agents before they burn budget
Security Prompt-injection detection, audit trails and PII leak detection Agents handling user data or acting on user instructions
Self-hosting Full app runnable on your own infrastructure, MIT licence Teams with data sovereignty or compliance requirements

When AgentOps Is the Right Choice

AgentOps fits best when your main problem is understanding and controlling agent runs: what happened, why it happened, and what it cost. Small and mid-sized teams building agents in Python will find the setup fast and the dashboard genuinely useful for day-to-day debugging. Multi-agent systems benefit most, because the session hierarchy and per-agent cost breakdown answer questions that are hard to answer any other way.

It fits less well if your priority is mature evaluation and regression testing, where the platform is still catching up, or if your stack is primarily TypeScript, where the SDK is still in alpha. It is also worth comparing against alternatives before committing: other observability tools cover similar ground with different strengths, and the right choice depends on whether you value self-hosting, evaluation depth, or cost analytics most.

Best for: Python teams running multi-agent systems who need replayable sessions, loop detection and per-agent cost tracking in one dashboard.

Checklist: Getting Started with AgentOps

  • Set the API key in your environment and initialise the SDK so supported libraries are instrumented automatically.
  • Run your agent once and open the session waterfall to confirm the full span hierarchy appears.
  • Add custom decorators for the agents, workflows and operations that matter most to your debugging.
  • Tag sessions by environment and version so production runs can be separated from tests.
  • Check the cost view after a day of runs and identify the most expensive agent or model.
  • Set a budget alert so a looping agent is caught by the alert, not by the invoice.
  • Review cross-session metrics weekly to spot tools or prompts that fail intermittently.
  • Decide whether cloud hosting or self-hosting fits your data and compliance requirements.

Frequently Asked Questions

Is AgentOps free?

AgentOps offers a Basic plan at no cost for up to 5,000 events. The Pro plan starts at $40 per month with pay-as-you-go pricing, unlimited events, log retention, export, support and role-based permissions. Check the current pricing on the AgentOps site before budgeting, as plans change.

Which frameworks does AgentOps support?

Native integrations include CrewAI, AG2, Agno, Google ADK, Haystack, LangChain, LangGraph, LlamaIndex, OpenAI Agents and Smolagents, with providers including OpenAI, Anthropic, Google GenAI and IBM WatsonX AI.

What is session replay in AgentOps?

Session replay lets you review a past agent run step by step, with point-in-time precision. You can inspect the prompts, completions, tool calls, errors and timings of a run long after it finished, which is essential because agents rarely reproduce a failure exactly.

Can AgentOps detect when an agent is stuck in a loop?

Yes. Recursive thought detection identifies when agents fall into repeated patterns, so a runaway agent can be stopped and investigated instead of running for hours and consuming tokens.

Can I self-host AgentOps?

Yes. The full application, including the dashboard and API backend, can be run on your own infrastructure. The app is open source under the MIT licence.

Does AgentOps work for multi-agent systems?

Yes, multi-agent debugging is a core use case. The session hierarchy separates agents, workflows and operations, so you can see which agent caused a wrong answer, an exception, a loop or an unexpected handoff.

Latest articles

Scroll to Top