Skip to content

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.

Notifications You must be signed in to change notification settings

garvitjain-02/Modular-RAG-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

git clone https://github.com/garvitjain-02/Modular-RAG-Chatbot.git
cd Modular-RAG-Chatbot

2. Setup the Backend (FastAPI)

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)

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


✉️ Contact

For questions or suggestions, open an issue or contact at [garvitjainjnv@gmail.com]


Happy Building! 🚀

About

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.

Topics

Resources

Stars

Watchers

Forks

Languages