Skip to main content
GitHub

CrewAI

Auto-instrumentation for CrewAI multi-agent crews.

Risicare provides deep integration with CrewAI for multi-agent crew observability.

Version Compatibility

Requires crewai >= 0.50.0.

Installation

pip install risicare[crewai]
# or
pip install risicare crewai

Basic Usage

import risicare
from crewai import Agent, Task, Crew
 
risicare.init()
 
# Define agents as usual - they're automatically traced
researcher = Agent(
    role="Researcher",
    goal="Find accurate information",
    backstory="Expert at research"
)
 
writer = Agent(
    role="Writer",
    goal="Write compelling content",
    backstory="Skilled technical writer"
)
 
# Create tasks
research_task = Task(
    description="Research the topic",
    agent=researcher
)
 
write_task = Task(
    description="Write the article",
    agent=writer
)
 
# Run crew - fully traced
crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])
result = crew.kickoff()

What's Captured

Agent Details

FieldDescription
agent.nameAgent role
agent.goalAgent goal
agent.backstoryAgent backstory

Task Execution

FieldDescription
task.descriptionTask description
task.expected_outputExpected output format
task.agentAssigned agent
task.contextContext from other tasks
task.outputTask result

Crew Dynamics

FieldDescription
crew.nameCrew name
crew.processSequential or hierarchical

Agent Hierarchy

Hierarchical crews are reflected in the span tree:

crew = Crew(
    agents=[manager, worker1, worker2],
    tasks=[task],
    process=Process.hierarchical,
    manager_llm=ChatOpenAI(model="gpt-4o")
)

The span hierarchy shows which agents executed and in what order. Manager and worker relationships are visible through the parent-child span structure.

Tool Usage

Tool executions are traced within agent context:

from crewai_tools import SerperDevTool
 
search_tool = SerperDevTool()
 
researcher = Agent(
    role="Researcher",
    tools=[search_tool]
)
 
# Tool calls traced with:
# - Tool name
# - Input parameters
# - Output results
# - Duration

Task Dependencies

Task context and dependencies are captured:

research_task = Task(
    description="Research the topic",
    agent=researcher
)
 
write_task = Task(
    description="Write based on research",
    agent=writer,
    context=[research_task]  # Dependency traced
)

Provider Spans

CrewAI instrumentation creates agent/framework-level spans. Underlying LLM calls (e.g., OpenAI, Anthropic) are traced separately by provider instrumentation, giving you both framework-level and LLM-level visibility.

Visualization

View crew execution in the dashboard:

  • Agent View: Individual agent performance
  • Task Flow: Task execution sequence
  • Timeline: Parallel vs sequential execution

Next Steps