Before We Start
To follow along, you’ll need an OpenAI API key & a Serper Dev Key. We’ll be using OpenAI as our LLM provider & Serper as our Web Search Tool for our chatbot.Step 1: Set Up Phoenix Cloud
Before we can send traces anywhere, we need Phoenix running. In this step, we’ll create a Phoenix Cloud account and configure it for our application. If you’d rather run Phoenix locally, you can follow the local setup guide instead.Create a Phoenix Cloud Account
- Make a free Phoenix Cloud account.
- From the dashboard, click Create a Space in the upper-right corner.
- Enter a name for your new space.
- Once the space is created, launch your Phoenix instance directly from the dashboard.
- Create and save an API key. We’ll use this in the next step.
- Note your Hostname — this is the endpoint we’ll configure in code shortly.
How to Create a Phoenix Cloud account & a space
How to Make an API Key
Step 2: Configure your Environment
Now that Phoenix is running, we need to connect our application to it so we can start sending traces. In this step, we’ll install the required dependencies and configure a few environment variables. This setup is what allows Phoenix to receive trace data from our application. Once it’s in place, running the application will automatically create a project in the Phoenix UI and record each traced run there. We’ll now install both the CrewAI package and the OpenInference CrewAI auto-instrumentation package, which handles tracing for us without requiring manual instrumentation.Install Your Packages
Set Your API Keys
Register Your Project in Phoenix
Next, we’ll register a tracer provider linked to a project in Phoenix. This project is where your traces will show up in the UI.Step 3: Create your Agent
Now that Phoenix is running and our environment is configured, we can start building the application so we can generate real execution and send traces to Phoenix. In this step, we’ll create a simple Financial Analysis and Research chatbot. This tutorial we will use CrewAI, but you can build agents in any of these different frameworks for auto-integration with Phoenix. This agent is made up of:- Two sub-agents: a Research agent and a Writer agent
- Two tasks: one for financial research and one for generating a summary report
- One tool: SerperDevTool for real-time web search
Define the Agents
We’ll start by defining the two agents that make up our crew & the tool the agents may use.Define the Tasks & Tool
Next, we’ll define the tasks each agent is responsible for.Create and Run the Crew
Finally, we’ll wire the agents and tasks together and run them sequentially.Step 4: Look at the Trace in Phoenix
Now that we’ve defined our chatbot, all that’s left to do is run it and see what Phoenix captures. To run the agent, execute the following:- Which agents were invoked and in what order
- How tasks flowed from one step to the next
- Where time was spent across the workflow

