Skip to main content
Automatically capture agent roles, tasks, crew executions, and tool invocations within the CrewAI framework.

Setup

import traceroot
from traceroot import Integration

traceroot.initialize(integrations=[Integration.CREWAI, Integration.OPENAI])

Usage

Once initialized, crew and agent executions are captured automatically:
from crewai import Agent, Task, Crew

researcher = Agent(
    role="Research Analyst",
    goal="Uncover the latest developments in AI agent frameworks",
    backstory="You are an expert at identifying emerging trends in AI.",
)

writer = Agent(
    role="Tech Writer",
    goal="Craft a compelling summary of AI agent framework trends",
    backstory="You turn complex technical insights into engaging narratives.",
)

research_task = Task(
    description="Analyze the latest AI agent frameworks and summarize key trends.",
    expected_output="A concise research summary",
    agent=researcher,
)

write_task = Task(
    description="Write a short article based on the research summary.",
    expected_output="A short article on AI agent framework trends",
    agent=writer,
    context=[research_task],
)

crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])

# The entire crew execution is automatically traced
result = crew.kickoff()

What Gets Captured

AttributeDescription
Crew executionThe overarching kickoff() session
Agent rolesEach agent’s role, goal, and backstory as span metadata
Task stepsIndividual task executions with inputs and outputs
Tool callsTool invocations with input arguments and results
LLM callsRaw completion requests to the provider
Delegation hierarchyManager-agent relationships and task assignments
Token usageAggregated across all LLM calls
CostTotal cost for the full crew execution