Skip to main content
GitHub

CrewAI

Auto-instrumentation for CrewAI multi-agent crews.

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

Python only

This framework integration is available in the Python SDK only. No JavaScript package exists for CrewAI.

Version Compatibility

Requires crewai >= 0.28.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.role"orchestrator" (crew kickoff) or "worker" (agent execution)
agent.type"crewai"
agent.nameAgent name (on worker spans)

Crew & Task Execution

FieldDescription
framework.crewai.agent_countNumber of agents in the crew
framework.crewai.agent_rolesList of agent roles (up to 10)
framework.crewai.agent_goalThe agent's goal
framework.crewai.agent_outputWorker agent output (when content tracing is enabled)
framework.crewai.resultFinal crew result (when content tracing is enabled)
framework.crewai.task_countNumber of tasks
framework.crewai.task_descriptionTask description

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

A tool that a CrewAI agent calls runs inside that agent's crewai.agent/{name} span, so its work is attributed to the right worker:

from crewai_tools import SerperDevTool
 
search_tool = SerperDevTool()
 
researcher = Agent(
    role="Researcher",
    tools=[search_tool]
)

Per-tool spans are not emitted

The CrewAI integration instruments crew kickoff and agent execution — it does not emit a separate span per tool call. If a tool makes an LLM call, that call is captured by provider instrumentation as a child of the agent span; a non-LLM tool (e.g. a web-search API) shows up as elapsed time inside the agent span rather than as its own crewai.tool/* span. Dedicated tool/task/delegation spans are on the roadmap.

Tasks

Task information is surfaced as attributes on the spans above, not as separate task spans: framework.crewai.task_count on the crew span and framework.crewai.task_description on the worker (crewai.agent) span. Dependencies you declare with context=[...] shape how CrewAI orders execution, but they are not emitted as separate dependency spans.

research_task = Task(
    description="Research the topic",
    agent=researcher
)
 
write_task = Task(
    description="Write based on research",
    agent=writer,
    context=[research_task]  # influences execution order; not a separate span
)

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