Skip to main content

Arize Phoenix Integration

This guide demonstrates how to integrate Arize Phoenix with CrewAI using OpenTelemetry via the OpenInference SDK. By the end of this guide, you will be able to trace your CrewAI agents and debug agent behavior.
What is Arize Phoenix? Arize Phoenix is the open-source observability and evaluation option from Arize AI. Use Phoenix when you want to run locally or self-host. Use Arize AX for a managed cloud or enterprise self-hosted platform for production AI systems.
Watch a Video Demo of Our Integration with Phoenix

Get Started

We’ll walk through a simple example of using CrewAI and integrating it with Arize Phoenix via OpenTelemetry using OpenInference. You can also access this guide on Google Colab.

Step 1: Install Dependencies

Step 2: Set Up Environment Variables

Configure your Phoenix API key and OpenTelemetry endpoint to send traces to Phoenix. The same setup works with a local or self-hosted Phoenix endpoint by changing the collector URL. You can get your free Serper API key here.

Step 3: Initialize OpenTelemetry with Phoenix

Initialize the OpenInference OpenTelemetry instrumentation SDK to start capturing traces and send them to Phoenix.

Step 4: Create a CrewAI Application

We’ll create a CrewAI application where two agents collaborate to research and write a blog post about AI advancements.

Step 5: View Traces in Phoenix

After running the agent, you can view the traces generated by your CrewAI application in Phoenix. You should see detailed steps of the agent interactions and LLM calls, which can help you debug and optimize your AI agents. Open your Phoenix project and navigate to the project you specified in the project_name parameter. You’ll see a timeline view of your trace with all the agent interactions, tool usages, and LLM calls. Example trace in Phoenix showing agent interactions

Version Compatibility Information

  • Python 3.8+
  • CrewAI >= 0.86.0
  • Arize Phoenix >= 7.0.1
  • OpenTelemetry SDK >= 1.31.0

References