Retrieval-Augmented Generation system for document question-answering. Upload PDFs or Markdown files and ask questions — powered by FAISS vector search and LLMs.
- 📄 Multi-format ingestion — PDF, Markdown, plain text
- 🔍 FAISS vector indexing — fast similarity search over document chunks
- 🧠 LLM-powered synthesis — contextual answers from retrieved passages
- ⚡ FastAPI REST API — clean endpoints for upload, index, and query
- 🐳 Docker-ready — one command to deploy
graph LR
A[📄 Documents] --> B[Chunking]
B --> C[Embedding Model]
C --> D[FAISS Index]
E[❓ Query] --> F[Query Embedding]
F --> D
D --> G[Top-K Retrieval]
G --> H[LLM Synthesis]
H --> I[💬 Answer]
git clone https://github.com/OMUZ9924/rag-document-qa.git
cd rag-document-qa
pip install -r requirements.txt
uvicorn src.api:app --reload
# → http://localhost:8000/docs| Method | Endpoint | Description |
|---|---|---|
| POST | /upload |
Upload a document (PDF/MD/TXT) |
| POST | /index |
Build FAISS index from uploaded documents |
| POST | /query |
Ask a question, get an answer with sources |
| GET | /documents |
List indexed documents |
| GET | /health |
Health check |
rag-document-qa/
├── src/
│ ├── api.py # FastAPI endpoints
│ ├── chunker.py # Document chunking strategies
│ ├── embeddings.py # Embedding model wrapper
│ ├── indexer.py # FAISS index management
│ ├── retriever.py # Retrieval logic
│ └── synthesizer.py # LLM answer generation
├── tests/
├── Dockerfile
├── requirements.txt
└── README.md
MIT