liveBook · Manning

AgentOps

As explained in AI Agents in Action

AgentOps is a platform for monitoring, tracing, and analyzing AI-agent executions, including their costs and behavior.

AgentOps is an observability platform for monitoring and tracing AI-agent runs. It helps reveal agent interactions, execution time, token use, and estimated cost—especially useful when several agents work together. section 4.4.2 section 4.7

To observe a CrewAI run with AgentOps:

  • Install the package with `pip install agentops`, or install it alongside CrewAI with `pip install crewai[agentops]`. section 4.4.2
  • Sign up at app.agentops.ai, create or select a project, and copy an API key from Settings > Projects and API Keys. Add it to the project’s `.env` file as `AGENTOPS_API_KEY`. section 4.4.2
  • In the CrewAI script, import `agentops`, load the environment variables, and call `agentops.init()`. Run the crew, then open the AgentOps dashboard to inspect its interactions. section 4.4.2
Listing 4.16 crewai_agentops.py (AgentOps additions)
import agentops      #1
from crewai import Agent, Crew, Process, Task
from dotenv import load_dotenv

load_dotenv()
agentops.init()     #2

See how environment loading and AgentOps initialization fit into a CrewAI script. section 4.4.2

The dashboard can show total duration, run environment, prompt and completion tokens, LLM call timings, and estimated cost. AgentOps can also connect to agent platforms beyond CrewAI. section 4.4.2

Spotting repetition in a coding crew

A crew that writes and reviews a game may repeatedly revisit the same work. Use the Repeat Thoughts plot to look for repetitive patterns, and review the run’s cost. If repetition is excessive, consider changing the processing pattern, tasks, goals, or number and type of agents. A hierarchical manager can add cost without necessarily improving the output. section 4.5

Practice with customer reviews

Integrate AgentOps into a CrewAI system that analyzes customer reviews for sentiment trends. Monitor performance and cost, evaluate output accuracy, and look for inefficient or erroneous agent interactions. section 4.6

How AI Agents in Action covers it

How deep it goes
Walks through installation, API-key setup, initialization, dashboard inspection, and interpretation of repetitive behavior.
Examples
Uses a joke-writing crew, a game-building coding crew, and a customer-review sentiment exercise.
What you can do after
Diagnose/debug with AgentOps by inspecting run costs and repetitive agent behavior and considering changes to the crew.
How it connects
Connects agent observability with application tracing, multi-agent systems, and hierarchical task processing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action. The section links point to the parts of the book it draws on.