Skip to content

karidasd/Advanced-RAG-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced RAG Logo

Advanced RAG System (Chat with your PDF)

A Full-Stack Generative AI Chatbot using Retrieval-Augmented Generation (RAG).

Python Streamlit LangChain OpenAI ChromaDB


📖 About The Project

This repository contains a Full-Stack Generative AI application built with Streamlit and LangChain. It allows users to upload any PDF document and chat with it in real-time using a Local Vector Database (ChromaDB).

The system implements the Retrieval-Augmented Generation (RAG) architecture to completely eliminate LLM hallucinations by grounding the AI's answers strictly on the provided documents.

🔥 Enterprise-Grade Features

  • Dual LLM Support: Easily toggle between Premium OpenAI (gpt-4o-mini) and Free Open-Source models (via HuggingFace).
  • Persistent Local Memory: Chat history is maintained seamlessly within the Streamlit session state.
  • Dynamic Chunking: Employs RecursiveCharacterTextSplitter for semantic document chunking.
  • Local Vector Store: Uses ChromaDB embedded locally, requiring zero cloud database setup.

🏗️ Architecture (RAG Pipeline)

graph TD
    A[User Uploads PDF] -->|PyPDFLoader| B(Document Processor)
    B -->|Recursive Chunking| C(Text Chunks)
    C -->|Embeddings| D[(ChromaDB Vector Store)]
    
    E[User Asks Question] -->|Semantic Search| D
    D -->|Top-K Relevant Chunks| F[LangChain RAG Chain]
    E --> F
    F -->|Context + Prompt| G((LLM - OpenAI / HuggingFace))
    G -->|Grounded Answer| H[Streamlit Chat UI]
Loading

🚀 Getting Started

1. Installation

Clone the repository and install the dependencies:

git clone https://github.com/karidasd/Advanced-RAG-System.git
cd Advanced-RAG-System
pip install -r requirements.txt

2. Configuration

Copy the environment template and insert your API keys:

cp .env.example .env

Add your keys inside .env:

OPENAI_API_KEY=sk-...
HUGGINGFACEHUB_API_TOKEN=hf_...

3. Run the App

Launch the Streamlit web server:

streamlit run app.py

Open your browser at http://localhost:8501 to use the chatbot!


Built by Karydas
AI & Data Science Instructor / PhD Candidate

About

"A Full-Stack Generative AI Chatbot using Retrieval-Augmented Generation (RAG). Built with Streamlit, LangChain, and ChromaDB for chatting with local PDF documents. Supports both OpenAI and Open-Source LLMs."

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors