CrewAI Integration

SDK

Traccia automatically instruments CrewAI crews, tasks, agents, and LLM calls.

Traccia automatically detects and instruments crewai when it is installed in your environment. Once init() is called, crew executions, tasks, agents, and underlying LLM calls are traced with no extra wiring.

Zero-config CrewAI tracing

There are no callback handlers or decorators required for basic usage. Just install Traccia and CrewAI, call init(), and run your crew as usual.

1Install Traccia and CrewAI

Install both packages into your application environment:

bash
pip install traccia crewai

2Initialize Traccia

Initialize Traccia at the start of your application. CrewAI tracing is auto-enabled when crewai is installed:

main.py
python
from traccia import init
# Initialize Traccia (auto-loads from traccia.toml if present)
init()

3Run a CrewAI workflow

Define your agents and tasks as usual. Traccia will create spans for the crew kickoff, each task, each agent execution, and the underlying LLM calls:

crew.py
python
from traccia import init
from crewai import Agent, Task, Crew, Process
init()
researcher = Agent(
role="Research Analyst",
goal="Find comprehensive and accurate information on a topic",
llm="gpt-4o-mini",
)
task = Task(
description="Research Shawn Michaels and summarize his career.",
expected_output="A concise research summary",
agent=researcher,
)
crew = Crew(
agents=[researcher],
tasks=[task],
process=Process.sequential,
verbose=True,
)
result = crew.kickoff()
print(result)

Configuration

CrewAI integration is enabled by default when crewai is installed. To disable it:

Option 1: Explicit parameter

python
init(crewai=False)

Option 2: Environment variable

bash
export TRACCIA_CREWAI=false
python main.py

Option 3: Config file (traccia.toml)

traccia.toml
toml
[instrumentation]
crewai = false

Trace hierarchy

A typical CrewAI workflow traced by Traccia looks like this:

your_app_span
  └─ crewai.crew.kickoff
      ├─ crewai.task.Research the following topic...
      │   └─ crewai.agent.Research Analyst
      │       └─ llm.openai.chat.completions
      └─ crewai.task.Based on the research provided...
          └─ crewai.agent.Content Writer
              └─ llm.openai.chat.completions

Next Steps

© 2026 Traccia.