AgentOps and Autogen teamed up to make monitoring Autogen agents dead simple.

Autogen has comprehensive documentation available as well as a great quickstart.

Adding AgentOps to Autogen agents

1

Install the AgentOps SDK

pip install agentops

Give us a star on GitHub while you’re at it (you may be our 2,000th 😊)

2

Install Autogen

pip install pyautogen
3

Add 3 lines of code

  1. Before setting up anything in Autogen, call agentops.init()
  2. At the end of your agent run, call agentops.end_session("Success")
import agentops

# Beginning of program (i.e. main.py, __init__.py)
# IMPORTANT: Must be before using any autogen setup
agentops.init(<INSERT YOUR API KEY HERE>)
...
# End of program (e.g. main.py)
agentops.end_session("Success") # Success|Fail|Indeterminate

Instantiating the AgentOps client will automatically instrument Autogen, meaning you will be able to see all of your sessions on the AgentOps Dashboard along with the full LLM chat histories, cost, token counts, etc.

For more features see our Usage section.

4

Set your API key

Retrieve an API Key from your Settings > Projects & API Keys page.

Settings > Projects & API Keys

API keys are tied to individual projects.
A Default Project has been created for you, so just click Copy API Key

Set this API Key in your environment variables

.env
AGENTOPS_API_KEY=<YOUR API KEY>
5

Run your agent

Execute your program and visit app.agentops.ai/drilldown to observe your Autogen Agent! 🕵️

After your run, AgentOps prints a clickable url to console linking directly to your session in the Dashboard

Clickable link to session