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
