Code examples from the blog post: From RAG to Agentic RAG: Building Multi-Agent Search Systems
| File | Description |
|---|---|
classic_rag.py |
Classic RAG pipeline: embed → retrieve → generate with ChromaDB |
agentic_rag.py |
Agentic RAG: AI agent with a semantic search tool that decides when/what to search |
multi_agent_search.py |
Multi-Agent Search System: Main Agent + Search Agent with SQL, semantic, and web tools |
# Clone the repository
git clone https://github.com/OneManCrew/from-rag-to-agentic-rag.git
cd from-rag-to-agentic-rag
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txtSet your OpenAI API key:
export OPENAI_API_KEY="sk-your-key-here"python classic_rag.pyDemonstrates the basic embed-retrieve-generate pipeline with ChromaDB.
python agentic_rag.pyAn AI agent with a semantic search tool that can reformulate queries and search multiple times.
python multi_agent_search.pyA Main Agent delegates to a Search Agent equipped with:
- Semantic search — vector database for document retrieval
- SQL search — structured database queries (products, customers, orders)
- Web search — internet search for current information
User → Main Agent → find_information() → Search Agent
├── semantic_search() → ChromaDB
├── sql_search() → SQLite
└── web_search() → Web API
Read the full article with explanations and architecture diagrams: From RAG to Agentic RAG: Building Multi-Agent Search Systems