End-to-end RAG pipeline — ingest documents, embed locally with ONNX, retrieve semantically, synthesise answers with source citations. No external embedding API required.
Live demo: rag-chatbot-4n44.onrender.com
Stack: Python · Flask · ChromaDB · all-MiniLM-L6-v2 (ONNX) · OpenRouter
- Local ONNX embeddings — no OpenAI embedding API, runs offline
- ChromaDB vector store with persistent storage
- Multi-model LLM fallback chain handles OpenRouter rate limits
- Source citations returned with every answer
/ingestendpoint to reload documents without restarting
pip install -r requirements.txt
cp .env.example .env # add OPENROUTER_API_KEY
python3 ingest.py # chunk + embed docs from docs/
python3 app.py # API on :5050ingest.pychunks.txtfiles fromdocs/(500 chars, 50 char overlap), embeds withall-MiniLM-L6-v2, stores vectors in ChromaDB- On query: embed the question, retrieve top-3 chunks by cosine similarity, build a grounded prompt
- LLM synthesises an answer and cites the source files
POST /chat { "query": "your question" }
POST /ingest re-run the ingest pipeline
GET /health