AI · Retrieval-Augmented Generation

RAG Document-Chat App

An "Ask my documents" assistant that answers questions from a private library of PDFs — physics, philosophy, language and security essays — with grounded, cited answers, and politely refuses anything the documents don't cover.

Python FastAPI Google Gemini NumPy Docker Hugging Face Spaces
ask-my-documents — live chat widget
The RAG document-chat assistant answering a question with cited passages
Embedded on this very site — look for the chat bubble in the corner. Open the live widget →

Overview

This is a full retrieval-augmented generation (RAG) pipeline I built end to end — from PDF ingestion to a deployed API to the chat widget embedded on this very site (look for the bubble in the corner). It turns a folder of documents into a question-answering assistant that only answers from those documents and always shows where each answer came from.

What it does

📌 Grounded & cited

Every answer is built from retrieved passages and returns citations, so you can trace each claim back to the source document.

🚧 Stays on topic

If the documents don't cover a question, it says so rather than hallucinating — verified against off-topic prompts.

🔁 Resilient

Automatic retry with backoff and model fallback handle free-tier rate limits and transient 503s gracefully.

💰 Cost-guarded

Per-minute rate limiting and a daily cap protect the API budget, since the edge can't enforce CORS on the host.

How it works

Built on free credits and a card-free host: the backend runs on Hugging Face Spaces (the original GCP plan was dropped when billing required a card). Data is public by design, so protection focuses on rate limiting rather than secrecy.