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; running an example with --sandbox=none needs the Temporal CLI specifically (temporal server start-dev), not just a compose.yml-provided instance
  • AgentVisor CLI — agentvisor serve . starts the runtime
  • jq — used by the examples below to pretty-print API responses
  • uvx on your PATH — used by the MCP fetch tool (pip install uv)
  • Python virtual environment + SDK wheel — only needed for --sandbox=none; see Local Development Setup

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

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​