CrewAI Examples
CrewAI is a framework for building multi-agent AI systems where specialized agents collaborate to complete complex tasks. AgentVisor™ integrates natively with CrewAI — your crews run inside a hardened sandbox with policy enforcement, credential brokering, and durable execution via Temporal.
Prerequisites
- Anthropic API key (or another LLM endpoint) — the examples use Claude via the AgentVisor proxy
- Temporal — required for durable execution; running an example with
--sandbox=noneneeds the Temporal CLI specifically (temporal server start-dev), not just acompose.yml-provided instance - AgentVisor CLI —
agentvisor serve .starts the runtime jq— used by the examples below to pretty-print API responsesuvxon yourPATH— used by the MCP fetch tool (pip install uv)- Python virtual environment + SDK wheel — only needed for
--sandbox=none; see Local Development Setup
Examples
| Example | Difficulty | Key Feature |
|---|---|---|
| Research Agent | Intermediate | Multi-agent crew with MCP web fetch tools |
How It Works
CrewAI agents in AgentVisor work through the CrewAI framework provider:
- Discovery: AgentVisor detects
crewai.yamland selects the CrewAI provider automatically - Schema extraction: Agent input/output schemas are extracted from task
{placeholder}tokens - Execution:
python -m agentvisor.crewai.runnerloads and runs your crew inside the sandbox - I/O: Input JSON is written to the runner's stdin; output JSON is read from stdout
Key Concepts
| Concept | What It Is | Where You'll See It |
|---|---|---|
crewai.yaml | Discovery file pointing AgentVisor to your crew classes | All examples |
@CrewBase | Decorator for declarative crew definition | All examples |
@agent, @task, @crew | CrewAI declarative decorators | All examples |
get_mcp_tools() | AgentVisor SDK function to load MCP tools for agents | Research Agent |
{placeholder} | Input variable syntax in task descriptions | All examples |
Quick Start
# Create a project from the research agent template
agentvisor template create crewai/research-agent
cd research-agent
# Run with Temporal started separately
temporal server start-dev &
agentvisor serve . --sandbox=none
See Also
- CrewAI Agents Guide —
crewai.yamlformat, schema discovery, and provider options in depth