Skip to main content

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
  • AgentVisor CLI — agentvisor serve . starts the runtime

Examples

ExampleDifficultyKey Feature
Research AgentIntermediateMulti-agent crew with MCP web fetch tools

How It Works

CrewAI agents in AgentVisor work through the CrewAI framework provider:

  1. Discovery: AgentVisor detects crewai.yaml and selects the CrewAI provider automatically
  2. Schema extraction: Agent input/output schemas are extracted from task {placeholder} tokens
  3. Execution: python -m agentvisor.crewai.runner loads and runs your crew inside the sandbox
  4. I/O: Input JSON is written to the runner's stdin; output JSON is read from stdout

Key Concepts

ConceptWhat It IsWhere You'll See It
crewai.yamlDiscovery file pointing AgentVisor to your crew classesAll examples
@CrewBaseDecorator for declarative crew definitionAll examples
@agent, @task, @crewCrewAI declarative decoratorsAll examples
get_mcp_tools()AgentVisor SDK function to load MCP tools for agentsResearch Agent
{placeholder}Input variable syntax in task descriptionsAll examples

For a deep dive into CrewAI integration — including crewai.yaml format, schema discovery, and provider options — see the CrewAI Agents Guide.

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