Skip to main content
Agency Swarm supports multiple observability approaches to help you track and analyze your agent’s behavior and performance.

Supported Observability Platforms

Agency Swarm supports three main observability approaches:

Getting Started

Let’s walk through setting up each tracing solution. You can use them individually or combine them for monitoring.
  • OpenAI Tracing
  • Langfuse
  • AgentOps
1

Basic Setup

OpenAI tracing is built into Agency Swarm and requires no additional packages.
2

Implementation

from agency_swarm import trace

async def openai_tracing(input_message: str) -> str:
    agency_instance = create_agency()
    with trace("OpenAI tracing"):
        response = await agency_instance.get_response(message=input_message)
    return response.final_output
3

View Traces

After running your code, view your traces at platform.openai.com/traces

Implementation Example

For a complete working example that demonstrates all three tracing methods with a multi-agent agency, see observability.py in the examples directory. The example shows:
  • How to set up a basic agency with CEO, Developer, and Data Analyst roles
  • Implementation of all three tracing methods (OpenAI, Langfuse, AgentOps)
  • A sample tool for data analysis
  • Error handling and proper tracing setup
You can run the example with:
python examples/observability_demo.py
For more information about each platform’s capabilities and configuration options, refer to their respective documentation:
I