Quick start guide to get CrewAI running in under 5 minutes.
Using uv (recommended):
uv add crewai
Using pip:
pip install crewai
With additional tools:
uv add 'crewai[tools]'
# or
pip install 'crewai[tools]'
Using the CLI (recommended):
crewai create crew my-first-crew
cd my-first-crew
This creates a project structure with:
agents.yaml - Define your agentstasks.yaml - Define your taskscrew.py - Wire everything togethermain.py - Entry pointexport OPENAI_API_KEY="sk-your-openai-api-key"
For additional tools (like web search):
export SERPER_API_KEY="your-serper-key"
Edit config/agents.yaml:
researcher:
role: >
{topic} Senior Data Researcher
goal: >
Uncover cutting-edge developments in {topic}
backstory: >
You're a seasoned researcher with a knack for uncovering the latest
developments in {topic}. Known for finding insights others miss.
reporting_analyst:
role: >
{topic} Reporting Analyst
goal: >
Create detailed reports based on {topic} data analysis
backstory: >
You're a meticulous analyst with a keen eye for detail.
You excel at turning complex data into clear insights.
Edit config/tasks.yaml:
research_task:
description: >
Conduct a thorough research about {topic}
expected_output: >
A list with 10 bullet points of the most relevant information
agent: researcher
reporting_task:
description: >
Review the research findings and create a comprehensive report
expected_output: >
A detailed report with sections for each main topic
agent: reporting_analyst
output_file: report.md
crewai run
Or run directly:
python src/my_first_crew/main.py
Create simple_crew.py:
from crewai import Agent, Task, Crew, Process
import os
# Set API key
os.environ["OPENAI_API_KEY"] = "sk-your-key"
# Create agents
researcher = Agent(
role="Senior Data Researcher",
goal="Uncover cutting-edge developments in AI",
backstory="You're a seasoned researcher with a knack for finding insights.",
verbose=True,
allow_delegation=False
)
writer = Agent(
role="Tech Content Writer",
goal="Create engaging content about AI developments",
backstory="You're a skilled writer who makes complex topics accessible.",
verbose=True,
allow_delegation=False
)
# Create tasks
research_task = Task(
description="Research the latest AI developments in 2026",
expected_output="5 bullet points of key AI developments",
agent=researcher
)
write_task = Task(
description="Write a blog post about the AI developments",
expected_output="A 300-word blog post",
agent=writer
)
# Create and run the crew
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, write_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
print(result)
Run it:
python simple_crew.py
# Install uv first
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create project
uv init my-crew
cd my-crew
# Add CrewAI
uv add crewai
# Add with tools
uv add 'crewai[tools]'
# Basic installation
pip install crewai
# With tools
pip install 'crewai[tools]'
# Development installation
pip install -e ".[dev]"
poetry add crewai
poetry add --group dev 'crewai[tools]'
Tasks execute one after another:
crew = Crew(
agents=[agent1, agent2],
tasks=[task1, task2],
process=Process.sequential
)
Tasks are delegated by a manager:
crew = Crew(
agents=[agent1, agent2],
tasks=[task1, task2],
process=Process.hierarchical,
manager_llm="gpt-4o"
)