agentops.init() and all agent interactions are tracked.
Installation
Setting Up API Keys
Before using AG2 with AgentOps, you need to set up your API keys. You can obtain:- OPENAI_API_KEY: From the OpenAI Platform
- AGENTOPS_API_KEY: From your AgentOps Dashboard
.env file.
Usage
Initialize AgentOps at the beginning of your application to automatically track all AG2 agent interactions:Examples
AG2 Async Agent Chat
AG2 Async Agent Chat with Automated Responses
Async Human Input
Demonstrates asynchronous human input with AG2 agents.
Wikipedia Search Tool
Example of AG2 agents using a Wikipedia search tool.
Multi-Agent Group Chat
Orchestrate a team of specialized agents (researcher, coder, critic) with full AgentOps tracing.
Resources
AG2 - AgentOps Ecosystem Docs
Official AG2 documentation on integrating with AgentOps.
AG2 OpenTelemetry Tracing
Full observability for multi-agent systems with AG2’s built-in tracing.

