This project is a modular Retrieval-Augmented Generation (RAG) application that allows users to upload PDF documents and chat with an AI assistant that answers queries based on the document content. It features a microservice architecture with a decoupled FastAPI backend and Streamlit frontend, using ChromaDB as the vector store and Groq's LLaMA3 model as the LLM.
ragbot2.0/
├── client/ # Streamlit Frontend
│ |──components/
| | |──chatUI.py
| | |──history_download.py
| | |──upload.py
| |──utils/
| | |──api.py
| |──app.py
| |──config.py
├── server/ # FastAPI Backend
│ ├── chroma_store/ ....after run
| |──modules/
│ ├── load_vectorestore.py
│ ├── llm.py
│ ├── pdf_handler.py
│ ├── query_handlers.py
| |──uploaded_pdfs/ ....after run
│ ├── logger.py
│ └── main.py
└── README.md
- 📄 Upload and parse PDFs
- 🧠 Embed document chunks with HuggingFace embeddings
- 💂️ Store embeddings in ChromaDB
- 💬 Query documents using LLaMA3 via Groq
- 🌍 Microservice architecture (Streamlit client + FastAPI server)
Retrieval-Augmented Generation (RAG) enhances LLMs by injecting external knowledge. Instead of relying solely on pre-trained data, the model retrieves relevant information from a vector database (like ChromaDB) and uses it to generate accurate, context-aware responses.
git clone https://github.com/garvitjain-02/Modular-RAG-Chatbot.git
cd Modular-RAG-Chatbot
cd server
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Set your Groq API Key (.env)
GROQ_API_KEY="your_key_here"
# Run the FastAPI server
uvicorn main:app --reload
cd ../client
pip install -r requirements.txt # if you use a separate venv for client
streamlit run app.py
POST /upload_pdfs/
— Upload PDFs and build vectorstorePOST /ask/
— Send a query and receive answers
Testable via Postman or directly from the Streamlit frontend.
For questions or suggestions, open an issue or contact at [garvitjainjnv@gmail.com]
Happy Building! 🚀