A Retrieval-Augmented Generation (RAG) based document question-answering system built using FastAPI, embeddings, and semantic search. Upload documents and ask questions — the system retrieves relevant context and generates accurate answers.
- 📄 Upload PDF documents
- 🔍 Semantic search using embeddings
- 🤖 Retrieval-Augmented Generation (RAG)
- ⚡ FastAPI backend
- 🌐 Simple UI for asking questions
- 📚 Multi-document support
- 🧠 Context-aware answers
- 🗂️ Automatic document chunking
rag-fastapi/
│
├── main.py # FastAPI app
├── rag.py # RAG pipeline logic
├── requirements.txt
│
├── templates/
│ └── index.html # UI
│
├── uploads/ # uploaded docs (empty in repo)
│ └── .gitkeep
│
└── README.md
git clone https://github.com/nyasalohiya/rag-fastapi.git
cd rag-fastapi
pip install -r requirements.txt
uvicorn main:app --reload
Server starts at:
http://127.0.0.1:8000
API Docs:
http://127.0.0.1:8000/docs
- Upload PDF document
- Text extracted and chunked
- Embeddings generated
- Stored in vector format
- User asks question
- Relevant chunks retrieved
- LLM generates answer
- Pharma SOP QA
- Research paper assistant
- Personal knowledge base
- Document chatbot
- Compliance document search
- Study material assistant
- FastAPI
- Python
- Sentence Transformers / Embeddings
- PyPDF2
- HTML (UI)
- Uvicorn
- Add vector database (FAISS / Chroma)
- Multi-file upload
- Chat history
- Streaming responses
- Authentication
- Docker support
Nyasa Lohiya