CrewAI Integration
Native wrap_crew() integration for CrewAI. Wrap your Crew instance once and every agent run, task output, and guardrail check is traced — async kickoff supported.
CrewAI is a Python framework for orchestrating multi-agent systems where crews of specialized AI agents collaborate on tasks.
Getting Started
Install the SDK
Install zespan alongside crewai.
pip install zespan crewaiWrap your Crew
Import wrap_crew and pass your Crew instance to it before calling kickoff. All agent runs, task outputs, and latency are traced automatically.
from zespan.integrations.crewai_handler import wrap_crew
from crewai import Crew, Agent, Task
researcher = Agent(role='Researcher', goal='...', backstory='...')
writer = Agent(role='Writer', goal='...', backstory='...')
crew = Crew(agents=[researcher, writer], tasks=[...])
crew = wrap_crew(crew) # one line
result = crew.kickoff(inputs={"topic": "LLMs in software development"})View traces in Zespan
Open the Agent Registry and Delegation Graph. Every crew agent is auto-discovered. The delegation graph shows which agent ran which task.
What's captured automatically
- One-line wrap: wrap_crew() before kickoff, existing Crew/Agent/Task code unchanged
- Agent run traces: every agent execution with inputs, outputs, and latency
- Task output capture: final task results attributed per agent role
- Async support: works with both crew.kickoff() and crew.kickoff_async()
- Guardrails: enable with wrap_crew(crew, guardrails=True) for content validation
- Cost attribution: LLM spend attributed per agent and task
FAQ
Do I need to modify my Agent or Task definitions?
No. wrap_crew() wraps the Crew instance itself. Your Agent, Task, and tool definitions stay exactly as they are.
Does async kickoff work?
Yes. Both crew.kickoff() and crew.kickoff_async() are supported after wrapping.
How do I enable guardrails?
Pass guardrails=True to wrap_crew(): crew = wrap_crew(crew, guardrails=True). Zespan will run pre and post content checks on inputs and outputs.
Start free — 10K traces a month, no card needed
CrewAI integration works on all plans including the free tier.
