A comprehensive, hands-on tutorial and learning resource for CrewAI - the powerful framework for building multi-agent AI systems. This repository contains practical examples, step-by-step guides, and real-world implementations covering all aspects of CrewAI development.
CrewAI Crash Course is your complete guide to mastering CrewAI, featuring:
- β 7 comprehensive modules covering everything from basics to advanced topics
- β Hands-on examples with real code you can run immediately
- β Best practices and production-ready patterns
- β Observability integration with LangTrace
- β Knowledge management techniques
- β LLM integration (OpenAI, Anthropic Claude, local LLMs with Ollama)
CrewAI is a cutting-edge framework for orchestrating role-playing, autonomous AI agents. It enables you to build sophisticated multi-agent systems where agents collaborate to solve complex tasks.
- Create crews programmatically
- Configure crews using YAML
- Agent and task management
- Access task outputs (Pydantic & JSON)
- Task dependencies and chaining
- Task callbacks
- Guardrail validations
- Access crew outputs
- Crew orchestration patterns
- Using tools with tasks
- Custom tool development
- Reading files as knowledge
- Knowledge base integration
- Local LLM setup with Ollama
- Anthropic Claude integration
- Any LLM provider support
- Tracing with LangTrace
- Performance monitoring
- Debugging and logging
CrewAI-Crash-Course/
βββ knowledge/ # Sample knowledge files
β βββ customer.json
β βββ products.txt
β βββ transactions.xlsx
βββ src/
β βββ 1_basics/ # Basic crew creation
β βββ 2_tasks/ # Task management
β βββ 3_crew/ # Crew operations
β βββ 4_tools/ # Tool integration
β βββ 5_knowledge/ # Knowledge management
β βββ 6_llm/ # LLM integrations
β βββ 7_observability/ # Monitoring & tracing
βββ pyproject.toml
- Python 3.8+
- pip or uv package manager
- (Optional) OpenAI API key or Anthropic API key for cloud LLMs
- (Optional) Ollama for local LLM support
- Clone the repository:
git clone https://github.com/bhanuchaddha/CrewAI-Crash-Course.git
cd CrewAI-Crash-Course- Create virtual environment:
uv venv
# or
python -m venv venv- Activate virtual environment:
source venv/bin/activate # On macOS/Linux
# or
venv\Scripts\activate # On Windows- Install dependencies:
uv pip install -e .
# or
pip install -e .from crewai import Agent, Crew, Task
# Create an agent
agent = Agent(
name="Researcher",
role="Research Analyst",
goal="Provide accurate research",
backstory="Expert researcher with attention to detail"
)
# Create a task
task = Task(
description="Research the latest AI trends",
expected_output="A comprehensive report on AI trends",
agent=agent
)
# Create and run crew
crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
print(result)Learn how to create crews both programmatically and using YAML configuration files.
Master task management including dependencies, callbacks, and output handling.
Understand crew orchestration and output management.
Integrate custom tools and external APIs with your agents.
Feed your agents with structured knowledge from files and databases.
Configure different LLM providers and optimize for cost and performance.
Monitor, trace, and debug your AI agent systems.
Create a .env file for API keys:
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_hereExample agents.yaml:
agents:
- name: Researcher
role: Research Analyst
goal: Provide accurate researchEach module contains multiple examples demonstrating different aspects of CrewAI. Navigate to the specific module directory and run the examples:
cd src/1_basics
python 1_create_crew_programmatically.py- Start with Module 1 - Understand the basics
- Move to Module 2 - Learn task management
- Explore Modules 3-4 - Advanced crew features
- Integrate knowledge - Module 5
- Configure LLMs - Module 6
- Add observability - Module 7
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available for educational purposes.
If you find this repository helpful, please consider giving it a star! β
Built with β€οΈ for the AI agent community