CoolFace
Apppublic

kumardatascience/Multi-Source-RAG-AI-System-with-Query-Routing

sourceHugging Faceupdated 3mo agoView on Hugging Face
1likes
README.md92 linesDownload Raw Back to root
1---2title: Multi-Source RAG AI Assistant3emoji: ๐Ÿค–4colorFrom: blue5colorTo: indigo6sdk: docker7app_port: 80008pinned: false9---10 11 12# ๐Ÿค– AI Chat Assistant13 14[![CI](https://github.com/kumardatascience/ai-chat-assistant-themis/actions/workflows/ci.yml/badge.svg)](https://github.com/kumardatascience/ai-chat-assistant-themis/actions/workflows/ci.yml)15 16๐Ÿš€ **[Live Demo on Hugging Face Spaces โ†’](https://huggingface.co/spaces/kumardatascience/Multi-Source-RAG-AI-System-with-Query-Routing)**17 18An intelligent AI chatbot that routes queries between direct LLM, document retrieval (RAG), and live web search โ€” built with **LlamaIndex Workflows**, **Gemini**, **ChromaDB**, **Tavily**, and **Chainlit**.19 20## โœจ Features21 22- ๐Ÿ’ฌ ChatGPT-like UI with streaming responses23- ๐Ÿšฆ Intelligent query routing (direct / rag / web / multi)24- ๐Ÿ“š Document Q&A with ChromaDB25- ๐ŸŒ Live web search via Tavily26- ๐Ÿง  Conversation memory27- ๐Ÿ” Transparent reasoning steps28- ๐Ÿณ Dockerized29- โœ… CI tested via GitHub Actions30 31## ๐Ÿš€ Quick Start32 33**Prerequisites:** Python 3.12+, [Gemini API key](https://aistudio.google.com/apikey), [Tavily API key](https://tavily.com)34 35```bash36# Clone and set up37git clone https://github.com/kumardatascience/ai-chat-assistant-themis.git38cd ai-chat-assistant-themis39python3 -m venv .venv40source .venv/bin/activate41pip install -r requirements.txt42 43# Add your API keys44cp .env.example .env45# Edit .env and fill in GOOGLE_API_KEY and TAVILY_API_KEY46 47# (Optional) Add documents to data/documents/ then index them48python3 src/app/rag.py49 50# Run51cd src/app52chainlit run main.py -w53```54 55Open [http://localhost:8000](http://localhost:8000).56 57## ๐Ÿณ Docker58 59```bash60docker build -t ai-chat-assistant .61docker run --rm -p 8000:8000 --env-file .env ai-chat-assistant62```63 64## ๐Ÿงช Tests65 66```bash67pytest -v68```69 70## ๐Ÿ“ Project Structure71 72```73src/app/74โ”œโ”€โ”€ main.py          # Chainlit entry point75โ”œโ”€โ”€ llm.py           # Gemini wrapper76โ”œโ”€โ”€ rag.py           # Document indexing + retrieval77โ”œโ”€โ”€ web_search.py    # Tavily search78โ””โ”€โ”€ router.py        # LlamaIndex Workflow router79data/documents/      # Your PDFs/text files80tests/               # Pytest tests81Dockerfile82.github/workflows/ci.yml83```84 85## ๐Ÿ› ๏ธ Tech Stack86 87Chainlit ยท Google Gemini ยท LlamaIndex Workflows ยท ChromaDB ยท Tavily ยท HuggingFace embeddings (BAAI/bge-small-en-v1.5) ยท pytest ยท Docker ยท GitHub Actions88 89## ๐Ÿ“ License90 91MIT92