Crewai Multi Agent
Build autonomous AI agent teams that collaborate on complex workflows
✨ The solution you've been looking for
Multi-agent orchestration framework for autonomous AI collaboration. Use when building teams of specialized agents working together on complex tasks, when you need role-based agent collaboration with memory, or for production workflows requiring sequential/hierarchical execution. Built without LangChain dependencies for lean, fast execution.
See It In Action
Interactive preview & real-world examples
AI Conversation Simulator
See how users interact with this skill
User Prompt
Create a crew with a researcher to find AI trends and a writer to produce a blog post about the findings
Skill Processing
Analyzing request...
Agent Response
A complete research report and polished blog post with cited sources and structured content
Quick Start (3 Steps)
Get up and running in minutes
Install
claude-code skill install crewai-multi-agent
claude-code skill install crewai-multi-agentConfig
First Trigger
@crewai-multi-agent helpCommands
| Command | Description | Required Args |
|---|---|---|
| @crewai-multi-agent research-&-content-creation-pipeline | Deploy a team of specialized agents (researcher, writer, editor) to autonomously research topics and create comprehensive content | None |
| @crewai-multi-agent data-analysis-workflow | Set up analysts, data scientists, and reporting specialists to process datasets and generate insights | None |
| @crewai-multi-agent production-document-processing | Deploy memory-enabled agents for ongoing document analysis and knowledge extraction with enterprise features | None |
Typical Use Cases
Research & Content Creation Pipeline
Deploy a team of specialized agents (researcher, writer, editor) to autonomously research topics and create comprehensive content
Data Analysis Workflow
Set up analysts, data scientists, and reporting specialists to process datasets and generate insights
Production Document Processing
Deploy memory-enabled agents for ongoing document analysis and knowledge extraction with enterprise features
Overview
CrewAI - Multi-Agent Orchestration Framework
Build teams of autonomous AI agents that collaborate to solve complex tasks.
When to use CrewAI
Use CrewAI when:
- Building multi-agent systems with specialized roles
- Need autonomous collaboration between agents
- Want role-based task delegation (researcher, writer, analyst)
- Require sequential or hierarchical process execution
- Building production workflows with memory and observability
- Need simpler setup than LangChain/LangGraph
Key features:
- Standalone: No LangChain dependencies, lean footprint
- Role-based: Agents have roles, goals, and backstories
- Dual paradigm: Crews (autonomous) + Flows (event-driven)
- 50+ tools: Web scraping, search, databases, AI services
- Memory: Short-term, long-term, and entity memory
- Production-ready: Tracing, enterprise features
Use alternatives instead:
- LangChain: General-purpose LLM apps, RAG pipelines
- LangGraph: Complex stateful workflows with cycles
- AutoGen: Microsoft ecosystem, multi-agent conversations
- LlamaIndex: Document Q&A, knowledge retrieval
Quick start
Installation
1# Core framework
2pip install crewai
3
4# With 50+ built-in tools
5pip install 'crewai[tools]'
Create project with CLI
1# Create new crew project
2crewai create crew my_project
3cd my_project
4
5# Install dependencies
6crewai install
7
8# Run the crew
9crewai run
Simple crew (code-only)
1from crewai import Agent, Task, Crew, Process
2
3# 1. Define agents
4researcher = Agent(
5 role="Senior Research Analyst",
6 goal="Discover cutting-edge developments in AI",
7 backstory="You are an expert analyst with a keen eye for emerging trends.",
8 verbose=True
9)
10
11writer = Agent(
12 role="Technical Writer",
13 goal="Create clear, engaging content about technical topics",
14 backstory="You excel at explaining complex concepts to general audiences.",
15 verbose=True
16)
17
18# 2. Define tasks
19research_task = Task(
20 description="Research the latest developments in {topic}. Find 5 key trends.",
21 expected_output="A detailed report with 5 bullet points on key trends.",
22 agent=researcher
23)
24
25write_task = Task(
26 description="Write a blog post based on the research findings.",
27 expected_output="A 500-word blog post in markdown format.",
28 agent=writer,
29 context=[research_task] # Uses research output
30)
31
32# 3. Create and run crew
33crew = Crew(
34 agents=[researcher, writer],
35 tasks=[research_task, write_task],
36 process=Process.sequential, # Tasks run in order
37 verbose=True
38)
39
40# 4. Execute
41result = crew.kickoff(inputs={"topic": "AI Agents"})
42print(result.raw)
Core concepts
Agents - Autonomous workers
1from crewai import Agent
2
3agent = Agent(
4 role="Data Scientist", # Job title/role
5 goal="Analyze data to find insights", # What they aim to achieve
6 backstory="PhD in statistics...", # Background context
7 llm="gpt-4o", # LLM to use
8 tools=[], # Tools available
9 memory=True, # Enable memory
10 verbose=True, # Show reasoning
11 allow_delegation=True, # Can delegate to others
12 max_iter=15, # Max reasoning iterations
13 max_rpm=10 # Rate limit
14)
Tasks - Units of work
1from crewai import Task
2
3task = Task(
4 description="Analyze the sales data for Q4 2024. {context}",
5 expected_output="A summary report with key metrics and trends.",
6 agent=analyst, # Assigned agent
7 context=[previous_task], # Input from other tasks
8 output_file="report.md", # Save to file
9 async_execution=False, # Run synchronously
10 human_input=False # No human approval needed
11)
Crews - Teams of agents
1from crewai import Crew, Process
2
3crew = Crew(
4 agents=[researcher, writer, editor], # Team members
5 tasks=[research, write, edit], # Tasks to complete
6 process=Process.sequential, # Or Process.hierarchical
7 verbose=True,
8 memory=True, # Enable crew memory
9 cache=True, # Cache tool results
10 max_rpm=10, # Rate limit
11 share_crew=False # Opt-in telemetry
12)
13
14# Execute with inputs
15result = crew.kickoff(inputs={"topic": "AI trends"})
16
17# Access results
18print(result.raw) # Final output
19print(result.tasks_output) # All task outputs
20print(result.token_usage) # Token consumption
Process types
Sequential (default)
Tasks execute in order, each agent completing their task before the next:
1crew = Crew(
2 agents=[researcher, writer],
3 tasks=[research_task, write_task],
4 process=Process.sequential # Task 1 → Task 2 → Task 3
5)
Hierarchical
Auto-creates a manager agent that delegates and coordinates:
1crew = Crew(
2 agents=[researcher, writer, analyst],
3 tasks=[research_task, write_task, analyze_task],
4 process=Process.hierarchical, # Manager delegates tasks
5 manager_llm="gpt-4o" # LLM for manager
6)
Using tools
Built-in tools (50+)
1pip install 'crewai[tools]'
1from crewai_tools import (
2 SerperDevTool, # Web search
3 ScrapeWebsiteTool, # Web scraping
4 FileReadTool, # Read files
5 PDFSearchTool, # Search PDFs
6 WebsiteSearchTool, # Search websites
7 CodeDocsSearchTool, # Search code docs
8 YoutubeVideoSearchTool, # Search YouTube
9)
10
11# Assign tools to agent
12researcher = Agent(
13 role="Researcher",
14 goal="Find accurate information",
15 backstory="Expert at finding data online.",
16 tools=[SerperDevTool(), ScrapeWebsiteTool()]
17)
Custom tools
1from crewai.tools import BaseTool
2from pydantic import Field
3
4class CalculatorTool(BaseTool):
5 name: str = "Calculator"
6 description: str = "Performs mathematical calculations. Input: expression"
7
8 def _run(self, expression: str) -> str:
9 try:
10 result = eval(expression)
11 return f"Result: {result}"
12 except Exception as e:
13 return f"Error: {str(e)}"
14
15# Use custom tool
16agent = Agent(
17 role="Analyst",
18 goal="Perform calculations",
19 tools=[CalculatorTool()]
20)
YAML configuration (recommended)
Project structure
my_project/
├── src/my_project/
│ ├── config/
│ │ ├── agents.yaml # Agent definitions
│ │ └── tasks.yaml # Task definitions
│ ├── crew.py # Crew assembly
│ └── main.py # Entry point
└── pyproject.toml
agents.yaml
1researcher:
2 role: "{topic} Senior Data Researcher"
3 goal: "Uncover cutting-edge developments in {topic}"
4 backstory: >
5 You're a seasoned researcher with a knack for uncovering
6 the latest developments in {topic}. Known for your ability
7 to find relevant information and present it clearly.
8
9reporting_analyst:
10 role: "Reporting Analyst"
11 goal: "Create detailed reports based on research data"
12 backstory: >
13 You're a meticulous analyst who transforms raw data into
14 actionable insights through well-structured reports.
tasks.yaml
1research_task:
2 description: >
3 Conduct thorough research about {topic}.
4 Find the most relevant information for {year}.
5 expected_output: >
6 A list with 10 bullet points of the most relevant
7 information about {topic}.
8 agent: researcher
9
10reporting_task:
11 description: >
12 Review the research and create a comprehensive report.
13 Focus on key findings and recommendations.
14 expected_output: >
15 A detailed report in markdown format with executive
16 summary, findings, and recommendations.
17 agent: reporting_analyst
18 output_file: report.md
crew.py
1from crewai import Agent, Crew, Process, Task
2from crewai.project import CrewBase, agent, crew, task
3from crewai_tools import SerperDevTool
4
5@CrewBase
6class MyProjectCrew:
7 """My Project crew"""
8
9 @agent
10 def researcher(self) -> Agent:
11 return Agent(
12 config=self.agents_config['researcher'],
13 tools=[SerperDevTool()],
14 verbose=True
15 )
16
17 @agent
18 def reporting_analyst(self) -> Agent:
19 return Agent(
20 config=self.agents_config['reporting_analyst'],
21 verbose=True
22 )
23
24 @task
25 def research_task(self) -> Task:
26 return Task(config=self.tasks_config['research_task'])
27
28 @task
29 def reporting_task(self) -> Task:
30 return Task(
31 config=self.tasks_config['reporting_task'],
32 output_file='report.md'
33 )
34
35 @crew
36 def crew(self) -> Crew:
37 return Crew(
38 agents=self.agents,
39 tasks=self.tasks,
40 process=Process.sequential,
41 verbose=True
42 )
main.py
1from my_project.crew import MyProjectCrew
2
3def run():
4 inputs = {
5 'topic': 'AI Agents',
6 'year': 2025
7 }
8 MyProjectCrew().crew().kickoff(inputs=inputs)
9
10if __name__ == "__main__":
11 run()
Flows - Event-driven orchestration
For complex workflows with conditional logic, use Flows:
1from crewai.flow.flow import Flow, listen, start, router
2from pydantic import BaseModel
3
4class MyState(BaseModel):
5 confidence: float = 0.0
6
7class MyFlow(Flow[MyState]):
8 @start()
9 def gather_data(self):
10 return {"data": "collected"}
11
12 @listen(gather_data)
13 def analyze(self, data):
14 self.state.confidence = 0.85
15 return analysis_crew.kickoff(inputs=data)
16
17 @router(analyze)
18 def decide(self):
19 return "high" if self.state.confidence > 0.8 else "low"
20
21 @listen("high")
22 def generate_report(self):
23 return report_crew.kickoff()
24
25# Run flow
26flow = MyFlow()
27result = flow.kickoff()
See Flows Guide for complete documentation.
Memory system
1# Enable all memory types
2crew = Crew(
3 agents=[researcher],
4 tasks=[research_task],
5 memory=True, # Enable memory
6 embedder={ # Custom embeddings
7 "provider": "openai",
8 "config": {"model": "text-embedding-3-small"}
9 }
10)
Memory types: Short-term (ChromaDB), Long-term (SQLite), Entity (ChromaDB)
LLM providers
1from crewai import LLM
2
3llm = LLM(model="gpt-4o") # OpenAI (default)
4llm = LLM(model="claude-sonnet-4-5-20250929") # Anthropic
5llm = LLM(model="ollama/llama3.1", base_url="http://localhost:11434") # Local
6llm = LLM(model="azure/gpt-4o", base_url="https://...") # Azure
7
8agent = Agent(role="Analyst", goal="Analyze data", llm=llm)
CrewAI vs alternatives
| Feature | CrewAI | LangChain | LangGraph |
|---|---|---|---|
| Best for | Multi-agent teams | General LLM apps | Stateful workflows |
| Learning curve | Low | Medium | Higher |
| Agent paradigm | Role-based | Tool-based | Graph-based |
| Memory | Built-in | Plugin-based | Custom |
Best practices
- Clear roles - Each agent should have a distinct specialty
- YAML config - Better organization for larger projects
- Enable memory - Improves context across tasks
- Set max_iter - Prevent infinite loops (default 15)
- Limit tools - 3-5 tools per agent max
- Rate limiting - Set max_rpm to avoid API limits
Common issues
Agent stuck in loop:
1agent = Agent(
2 role="...",
3 max_iter=10, # Limit iterations
4 max_rpm=5 # Rate limit
5)
Task not using context:
1task2 = Task(
2 description="...",
3 context=[task1], # Explicitly pass context
4 agent=writer
5)
Memory errors:
1# Use environment variable for storage
2import os
3os.environ["CREWAI_STORAGE_DIR"] = "./my_storage"
References
- Flows Guide - Event-driven workflows, state management
- Tools Guide - Built-in tools, custom tools, MCP
- Troubleshooting - Common issues, debugging
Resources
- GitHub: https://github.com/crewAIInc/crewAI (25k+ stars)
- Docs: https://docs.crewai.com
- Tools: https://github.com/crewAIInc/crewAI-tools
- Examples: https://github.com/crewAIInc/crewAI-examples
- Version: 1.2.0+
- License: MIT
What Users Are Saying
Real feedback from the community
Environment Matrix
Dependencies
Framework Support
Context Window
Security & Privacy
Information
- Author
- davila7
- Updated
- 2026-01-30
- Category
- productivity-tools
Related Skills
Crewai Multi Agent
Multi-agent orchestration framework for autonomous AI collaboration. Use when building teams of …
View Details →Swarm Orchestration
Orchestrate multi-agent swarms with agentic-flow for parallel task execution, dynamic topology, and …
View Details →Swarm Orchestration
Orchestrate multi-agent swarms with agentic-flow for parallel task execution, dynamic topology, and …
View Details →