A hands-on demo project exploring multi-agent architectures using the CrewAI framework. This project showcases how autonomous AI agents can collaborate, delegate tasks, and leverage specialized tools like SQL databases, vector stores (RAG), and web search.
The project implements multiple agent crews with different architectures:
A Manager Agent coordinates specialized agents and delegates tasks based on user requests:
A two-agent pipeline for automated newsletter generation:
| Feature | Description |
|---|---|
| 🎭 Hierarchical Multi-Agent System | Manager agent that delegates to specialized workers |
| 🔍 RAG Pipeline | FAISS vector store with Azure OpenAI embeddings for document retrieval |
| 💾 SQL Agent | Natural language queries on a SQLite database (Northwind) |
| 🌐 Web Research Agent | Real-time web search via Exa.ai |
| 💬 Streamlit Chat UI | Interactive chat interface with verbose output mode |
| 📊 Observability | OpenLit integration for tracing and monitoring |
src/crewai_demo/
├── config/ # Agent & Task definitions (YAML)
│ ├── agents.yaml # Allrounder agent configurations
│ ├── tasks.yaml # Allrounder task definitions
│ ├── newsletter_*.yaml
│ ├── database_*.yaml
│ ├── rag_*.yaml
│ └── web_*.yaml
├── tools/ # Custom CrewAI tools
│ ├── db.py # SQL database tool
│ ├── rag.py # Vector store search tool
│ └── research.py # Exa.ai web search tools
├── rag_vectorstore/ # FAISS vector store management
├── sql_database/ # SQLite Northwind integration
├── services/ # Azure OpenAI service wrappers
├── crew.py # Crew orchestration & agent definitions
└── main.py # Entry points for different crews
src/gui/
└── app.py # Streamlit Chat UI
- Python 3.10 - 3.12
- Poetry for dependency management
- API Keys: Azure OpenAI (or OpenAI), Exa.ai
# Install Poetry (if not already installed)
pip install poetry
# Install dependencies
poetry lock
poetry installCreate a .env file based on .env_example with your API keys:
# Azure OpenAI
AZURE_OPENAI_API_KEY=your-key
AZURE_OPENAI_ENDPOINT=https://your-endpoint.openai.azure.com/
DEPLOYMENT_NAME=your-deployment
OPENAI_API_VERSION=2024-02-15-preview
# Exa.ai (for web search)
EXA_API_KEY=your-exa-key# Individual crews
poetry run crewai_newsletter # Newsletter generation
poetry run crewai_database # SQL database queries
poetry run crewai_rag # RAG document retrieval
poetry run crewai_web # Web research
# Allrounder with all agents
poetry run crewai_allrounder
# Chat UI (Streamlit)
streamlit run src/gui/app.pyNote: Disable/comment out
openlitincrew.py&app.pyif you don't have OpenLit running.
Or start OpenLit with Docker: OpenLit Setup Guide
Generates a newsletter based on a given topic:
- Researcher Agent – Searches the web for recent articles (last 7 days) using Exa.ai
- Review Analyst Agent – Reviews and summarizes findings into a markdown report
Single agent with SQL capabilities:
- Queries the Northwind database (customers, orders, products, etc.)
- Translates natural language to SQL
Single agent for document retrieval:
- Uses FAISS vector store with pre-indexed documents
- Retrieves relevant chunks based on semantic similarity
Single agent for real-time web research:
- Searches the web via Exa.ai
- Returns summarized results with source links
Combines all specialized agents under a Manager Agent:
- Manager handles chitchat and simple questions directly
- Delegates specialized tasks (database, RAG, web) to appropriate agents
- Uses hierarchical process for coordination
- Agents: Modify
src/crewai_demo/config/*_agents.yaml - Tasks: Modify
src/crewai_demo/config/*_tasks.yaml - Tools: Add custom tools in
src/crewai_demo/tools/ - Crew Logic: Adjust orchestration in
src/crewai_demo/crew.py
- Multi-agent orchestration with task delegation
- Integration of LLMs (Azure OpenAI) with CrewAI
- Building custom tools for agents
- RAG implementation with FAISS and embeddings
- SQL database integration for natural language queries
- Building a chat interface with Streamlit
This is a personal demo project for learning and experimentation purposes.


