A production-ready Retrieval-Augmented Generation (RAG) system built with FastAPI, React, ChromaDB, and Hugging Face embeddings. Upload PDF documents, index them into a vector database, and interact with them through a conversational AI interface with source-grounded responses.
- Upload single or multiple PDF documents
- Automatic PDF text extraction
- Document listing and deletion
- Persistent document storage
- PDF parsing and text cleaning
- Intelligent text chunking with overlap
- Hugging Face sentence-transformer embeddings
- ChromaDB vector storage and retrieval
- Metadata-aware document indexing
- Context-aware question answering
- Source-grounded responses
- Conversation history support
- Streaming responses using Server-Sent Events (SSE)
- Confidence-based document retrieval
- React + Vite
- Responsive UI
- Drag-and-drop file uploads
- Real-time chat interface
- Markdown rendering
- Syntax highlighting
- Upload progress tracking
- FastAPI backend
- Vercel frontend deployment
- Render backend deployment
- Docker support
- Environment-based configuration
- FastAPI
- LangChain
- ChromaDB
- Sentence Transformers
- Hugging Face Embeddings
- PyPDF
- Uvicorn
- React
- Vite
- Axios
- Tailwind CSS
- Framer Motion
- ChromaDB
lang-rag/
│
├── backend/
│ ├── app/
│ │ ├── api/
│ │ ├── core/
│ │ ├── models/
│ │ ├── services/
│ │ └── utils/
│ │
│ ├── uploads/
│ ├── vectorstore/
│ ├── requirements.txt
│ └── main.py
│
├── frontend/
│ ├── src/
│ ├── public/
│ ├── package.json
│ └── vite.config.js
│
├── docker-compose.yml
├── .env.example
└── README.md
git clone https://github.com/Kruthica/lang-rag.git
cd lang-ragcd backend
python -m venv .venvWindows:
.venv\Scripts\activateLinux/macOS:
source .venv/bin/activatepip install -r requirements.txtCreate a .env file inside the backend folder:
HF_TOKEN=your_huggingface_token
UPLOAD_DIR=uploads
CHROMA_DB_DIR=vectorstore
CORS_ORIGINS=http://localhost:5173,http://localhost:5174uvicorn main:app --reload --host 0.0.0.0 --port 8000Backend API:
http://localhost:8000
Swagger Documentation:
http://localhost:8000/docs
cd frontend
npm install
npm run devFrontend:
http://localhost:5173
GET /healthPOST /uploadPOST /askPOST /ask/streamGET /documentsDELETE /documents/{document_id}curl -X POST http://localhost:8000/upload \
-F "files=@sample.pdf"curl -X POST http://localhost:8000/ask \
-H "Content-Type: application/json" \
-d '{
"question":"Summarize this document",
"history":[]
}'curl http://localhost:8000/documentsSet:
VITE_API_URL=https://your-backend-url.onrender.comDeploy:
vercel --prodSet environment variables:
HF_TOKEN=your_tokenStart command:
uvicorn main:app --host 0.0.0.0 --port $PORT- Hybrid search (vector + keyword)
- Reranking pipelines
- OCR support for scanned PDFs
- Multi-user authentication
- Role-based document access
- Citation highlighting
- Document collections and folders
- Voice-based interactions
MIT License
Kruthica
Built as a production-focused Retrieval-Augmented Generation system for document intelligence and conversational knowledge retrieval.