Skip to content

OMUZ9924/rag-document-qa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 RAG Document QA

Python FastAPI License

Retrieval-Augmented Generation system for document question-answering. Upload PDFs or Markdown files and ask questions — powered by FAISS vector search and LLMs.


Features

  • 📄 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

Architecture

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]
Loading

Quick Start

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

API Endpoints

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

Project Structure

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

License

MIT

About

Retrieval-Augmented Generation system for document Q&A with FastAPI, FAISS, and sentence-transformers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors