Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

CrewAI and Galileo Cookbook

This tutorial is a completed version of the CrewAI quickstart and adds the Galileo CrewAIEventListener, an event handler implemented on top of OpenTelemetry (OTel). For more information, see Galileo’s Add Galileo to a CrewAI Application how-to guide.

Below you'll find concise setup steps, configuration notes, and a short primer on Galileo so you know why we add it and what it provides.

Resources

The relevant guides:

What is Galileo?

Galileo is an observability and evaluation platform for generative AI agents. Integrating Galileo into a CrewAI project gives you:

  • Structured logging of prompts, agent decisions, and model responses.
  • Metrics, logs, and traces to evaluate agent performance and behavior over time.
  • A centralized dashboard for debugging, auditing, and running evaluations on AI agents.

Why add Galileo here?

  • Faster troubleshooting: quickly find which agent produced what output and why
  • Better evaluation: collect examples, compare model versions, and compute metrics
  • Reproducibility: attach metadata (env, model, prompt) to recorded runs for later analysis

Prerequisites

Quick setup

Run these steps from the repository root.

  1. Clone and open the repo
git clone https://github.com/rungalileo/sdk-examples.git
cd sdk-examples/python/agent/crewAI/research_crew
  1. Copy the .env.example and configure credentials
cp .env.example .env

In addition to API keys, you’ll need to specify a Galileo project and log stream (e.g. GALILEO_PROJECT and GALILEO_LOG_STREAM). All CrewAI run data will be logged to this destination in Galileo. See Understanding the Galileo Integration for more detail.

  1. Install project dependencies into the active environment:
crewai install
  1. Run the Crew
crewai run

Understanding the Galileo Integration

Galileo integrates with CrewAI by registering an event listener that captures Crew execution events (e.g., agent actions, tool calls, model responses) and forwards them to Galileo for observability and evaluation. Under the hood, this integration is built on OpenTelemetry (OTel) for standardized tracing and telemetry collection.

Register the event listener

At the beginning of your run() function (or before starting the Crew), instantiate the Galileo event listener:

def run():
    # Create the event listener (registers itself with CrewAI)
    CrewAIEventListener()

    # The rest of your existing code goes here

This is instrumented in main.py.

What this does

Creating a CrewAIEventListener() instance is all that’s required to enable Galileo for a CrewAI run. When instantiated, the listener:

  • Automatically registers itself with CrewAI
  • Uses OpenTelemetry (OTel) to instrument Crew execution events
  • Reads Galileo configuration from environment variables
  • Logs all run data to the Galileo project and log stream specified by GALILEO_PROJECT and GALILEO_LOG_STREAM

No additional configuration or code changes are required. All data from this run is logged to the Galileo project and log stream specified by your environment configuration (for example, GALILEO_PROJECT and GALILEO_LOG_STREAM).

CrewAI Support

For support, questions, or feedback regarding the ResearchCrew Crew or crewAI.