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 crewaiBasic 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
| Field | Description |
|---|---|
agent.name | Agent role |
agent.goal | Agent goal |
agent.backstory | Agent backstory |
Task Execution
| Field | Description |
|---|---|
task.description | Task description |
task.expected_output | Expected output format |
task.agent | Assigned agent |
task.context | Context from other tasks |
task.output | Task result |
Crew Dynamics
| Field | Description |
|---|---|
crew.name | Crew name |
crew.process | Sequential 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
# - DurationTask 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