AgentOps Documentation - AI Agent Observability

website·Indexed Apr 11, 2026

https://docs.agentops.ai/

AgentOps provides observability for AI agents and LLM applications with a two-line Python initialization. It automatically tracks sessions, LLM calls, errors, and spans across frameworks like LangChain, AutoGen, CrewAI, and LlamaIndex. The platform supports major providers including OpenAI, Anthropic, Google Gemini, and Groq. Features include session drilldowns, waterfall visualizations, host environment monitoring, and a dedicated TypeScript SDK for Node.js. Documentation covers core concepts, decorators, integrations, and REST API usage for non-Python environments.

Tokens
17K
Snippets
108
Records
183
Agent score
50%

What's inside AgentOps

  1. Spans overview in AgentOps v0.4

    v1
    Spans replace Events in AgentOps v0.4 for tracking operations hierarchically. A span represents a unit of work or operation in your agent workflow. Spans are created using decorators (@session, @agent, @operation, @workflow) and automatically nest to form a hierarchical trace of execution. They capture inputs, outputs, exceptions, and common attributes like span_id and trace_id for visualization.
  2. Integrate AgentOps with CAMEL-AI agents

    v1
    CAMEL-AI is an open-source multi-agent framework for LLM scaling. To track CAMEL agents with AgentOps, initialize AgentOps first, then import toolkits, and configure the ChatAgent with tools and a model.
  3. Ollama integration with AgentOps

    v1
    Track Ollama model calls using AgentOps. Ollama is a lightweight, open-source tool for running and managing LLM models. The integration allows you to monitor and record interactions with Ollama models through the Python client.
  4. Session Concept and Attributes

    v1
    A Session encapsulates a single execution instance of your workflow, grouping all agents, LLMs, and actions together. Required attributes: ID (unique), Project ID (from API key), Starting Timestamp, Ending Timestamp, End State (success/failure). Optional: End State Reason, Tags, Host Environment, Video recording.
  5. Groq integration overview

    v1
    AgentOps integrates with Groq Cloud to monitor LLM inference accelerated by Groq's Language Processing Unit (LPU). The integration tracks chat completions and provides session monitoring for models like llama3-8b-8192.
  6. Track endpoint decorator for Flask HTTP tracing

    v2
    The @track_endpoint decorator enables HTTP endpoint tracing for Flask applications. It automatically monitors request and response data, captures OpenAI API calls, errors, and allows custom parameters like name and tags. This decorator extends the basic @trace functionality with HTTP-specific monitoring capabilities.
  7. Set up Gemini integration with AgentOps

    v1
    To use Gemini with AgentOps, install the google-generativeai package version 0.1.0 or higher. Initialize AgentOps with your API key before using any Gemini models. The integration tracks your Gemini API calls automatically.
  8. Integrate AgentOps with LangChain using LangchainCallbackHandler

    v1
    AgentOps provides seamless integration with LangChain applications through the LangchainCallbackHandler. This handler records agent interactions when passed to both the LLM and the agent initialization.
  9. Host Environment Data Collection

    v1
    The AgentOps SDK uses the psutil library to collect host environment data for diagnostic purposes. The collected data includes CPU information, memory usage, storage details, and operating system information.
  10. Automatic LLM Call Tracking

    v2
    AgentOps automatically tracks LLM calls once the SDK is initialized. When AgentOps detects a supported LLM provider module installed, it automatically starts tracking usage without additional configuration. The key requirement is proper import order: import the LLM provider module first, then initialize AgentOps with your API key.
  11. Initialize AgentOps with two-line setup

    v2
    AgentOps provides observability for AI agents and LLM apps. Initialize with two lines of Python code: import agentops, then call agentops.init(<YOUR_API_KEY>). This automatically instruments your code and starts tracking traces. The TypeScript SDK is available for Node.js projects.

    import agentops agentops.init(<INSERT YOUR API KEY HERE>)

  12. Span hierarchy

    v1
    Spans are organized hierarchically: Session (root) → Agent → Operation/Task → Nested Operations. This structure enables visualization of agent execution flow and understanding how operations relate to each other.