RAG-powered document Q&A — upload any PDF and ask questions in plain language. Runs fully free with a Groq key and local embeddings.
- Upload a PDF (up to 10 MB) or paste text
- Text is chunked and embedded locally using sentence-transformers (
all-MiniLM-L6-v2) — no API call, no cost - Embeddings are indexed in FAISS for fast cosine similarity search
- Your question is embedded the same way and matched against the index
- Top-4 chunks are passed to Groq (Llama 3.3 70B) for a grounded answer with source citations
| Layer | Choice |
|---|---|
| LLM | Groq / Llama 3.3 70B (free tier) |
| Embeddings | sentence-transformers all-MiniLM-L6-v2 (local, no API key) |
| Vector store | FAISS (CPU) |
| UI | Streamlit |
| PDF parsing | pypdf |
| Alt provider | OpenAI (switchable via sidebar) |
git clone https://github.com/biswajeetdev/doc-qa-ai
cd doc-qa-ai
pip install -r requirements.txt
cp .env.example .env # add your GROQ_API_KEY
streamlit run app.pyGet a free Groq key (no credit card) at console.groq.com/keys.
The sentence-transformers model (~22 MB) downloads automatically on first run.
- Chunk text is HTML-escaped before rendering to prevent XSS
- PDF uploads capped at 10 MB
- API key entered in-session only, never stored to disk