https://github.com/garvitjain-02/modular-rag-chatbot
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.
https://github.com/garvitjain-02/modular-rag-chatbot
chromadb fastapi generative-ai groq langchain llama3 llm python rag-chatbot streamlit
Last synced: 3 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/garvitjain-02/modular-rag-chatbot
- Owner: garvitjain-02
- Created: 2025-06-12T05:00:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-05T04:49:25.000Z (11 months ago)
- Last Synced: 2025-08-05T06:28:34.194Z (11 months ago)
- Topics: chromadb, fastapi, generative-ai, groq, langchain, llama3, llm, python, rag-chatbot, streamlit
- Language: Python
- Homepage:
- Size: 6.36 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Modular RAG PDF Chatbot with FastAPI, ChromaDB & Streamlit
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.
---
## π Project Structure
```
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
```
---
## β¨ Features
- π 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)
---
## π How RAG Works
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.
---
## π Getting Started Locally
### 1. Clone the Repository
```bash
git clone https://github.com/garvitjain-02/Modular-RAG-Chatbot.git
cd Modular-RAG-Chatbot
```
### 2. Setup the Backend (FastAPI)
```bash
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
```
### 3. Setup the Frontend (Streamlit)
```bash
cd ../client
pip install -r requirements.txt # if you use a separate venv for client
streamlit run app.py
```
---
## π API Endpoints (FastAPI)
- `POST /upload_pdfs/` β Upload PDFs and build vectorstore
- `POST /ask/` β Send a query and receive answers
Testable via Postman or directly from the Streamlit frontend.
---
## π References
- [LangChain](https://www.langchain.com/)
- [ChromaDB](https://www.trychroma.com/)
- [Groq](https://groq.com/)
- [Streamlit](https://streamlit.io/)
---
## βοΈ Contact
For questions or suggestions, open an issue or contact at [garvitjainjnv@gmail.com]
---
> Happy Building! π