CoolFace
Apppublic

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

sourceHugging Faceupdated 3mo agoView on Hugging Face
1likes
App README

๐Ÿค– AI Chat Assistant

![CI](https://github.com/kumardatascience/ai-chat-assistant-themis/actions/workflows/ci.yml)

๐Ÿš€ [Live Demo on Hugging Face Spaces โ†’](https://huggingface.co/spaces/kumardatascience/Multi-Source-RAG-AI-System-with-Query-Routing)

An 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.

โœจ Features

  • โ€”๐Ÿ’ฌ ChatGPT-like UI with streaming responses
  • โ€”๐Ÿšฆ Intelligent query routing (direct / rag / web / multi)
  • โ€”๐Ÿ“š Document Q&A with ChromaDB
  • โ€”๐ŸŒ Live web search via Tavily
  • โ€”๐Ÿง  Conversation memory
  • โ€”๐Ÿ” Transparent reasoning steps
  • โ€”๐Ÿณ Dockerized
  • โ€”โœ… CI tested via GitHub Actions

๐Ÿš€ Quick Start

Prerequisites: Python 3.12+, Gemini API key, Tavily API key

bash
# Clone and set up
git clone https://github.com/kumardatascience/ai-chat-assistant-themis.git
cd ai-chat-assistant-themis
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Add your API keys
cp .env.example .env
# Edit .env and fill in GOOGLE_API_KEY and TAVILY_API_KEY

# (Optional) Add documents to data/documents/ then index them
python3 src/app/rag.py

# Run
cd src/app
chainlit run main.py -w

Open http://localhost:8000.

๐Ÿณ Docker

bash
docker build -t ai-chat-assistant .
docker run --rm -p 8000:8000 --env-file .env ai-chat-assistant

๐Ÿงช Tests

bash
pytest -v

๐Ÿ“ Project Structure

src/app/
โ”œโ”€โ”€ main.py          # Chainlit entry point
โ”œโ”€โ”€ llm.py           # Gemini wrapper
โ”œโ”€โ”€ rag.py           # Document indexing + retrieval
โ”œโ”€โ”€ web_search.py    # Tavily search
โ””โ”€โ”€ router.py        # LlamaIndex Workflow router
data/documents/      # Your PDFs/text files
tests/               # Pytest tests
Dockerfile
.github/workflows/ci.yml

๐Ÿ› ๏ธ Tech Stack

Chainlit ยท Google Gemini ยท LlamaIndex Workflows ยท ChromaDB ยท Tavily ยท HuggingFace embeddings (BAAI/bge-small-en-v1.5) ยท pytest ยท Docker ยท GitHub Actions

๐Ÿ“ License

MIT