Skip to content

ALISHA8484/PDF_QA_RAGModel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 PDF_QA_RAGModel: Your Local PDF Question-Answering App

PDF_QA_RAGModel is a Retrieval-Augmented Generation (RAG) application built with Streamlit and LangChain that lets you chat with your PDF documents. It runs powerful language models entirely on your local machine using Ollama, ensuring your data remains private.

RAGproj.mp4

✨ Features

  • Chat with Multiple PDFs: Upload one or more documents to create a knowledge base.
  • Dual-Mode Operation: Seamlessly switch between two modes:
    • Answer from Documents: Get answers based strictly on the content of your files.
    • General Conversation: Chat with the AI using its general knowledge.
  • 100% Local & Private: Uses Ollama to run powerful LLMs (like gemma or Llama 3 or Phi-3) on your own machine. Your documents and queries never leave your computer.
  • Modular Codebase: The code is cleanly separated into a Streamlit UI (app.py), document processing utilities (DocProcessor.py), and the core RAG logic (model.py).

🛠️ Tech Stack

  • Framework: Python, Streamlit
  • AI Orchestration: LangChain
  • LLM Serving: Ollama (gemma3:4b)
  • Embeddings: Sentence-Transformers (Hugging Face)
  • Vector Store: FAISS (In-memory)

🚀 Setup and Installation

Follow these steps to set up and run the project locally.

1. Prerequisites

  • Python 3.11
  • Ollama installed and running.
  • download gemma3:4b model

2. Clone the Repository

git clone [https://github.com/your-username/DocuChat.git](https://github.com/your-username/DocuChat.git)
cd DocuChat

3. Create a Virtual Environment and Install Dependencies

  • On Windows:
    python -m venv .venv
    .\.venv\Scripts\activate
  • On macOS / Linux:
    python3 -m venv .venv
    source .venv/bin/activate
  • Install required packages:
    pip install -r requirements.txt

4. Download a Local LLM

Pull a model to use with Ollama. We recommend gemma3:4b for power or phi3 for speed.

# For power
ollama gemma3:4b

# For speed
ollama pull phi3

▶️ How to Run

With your virtual environment active and Ollama running, start the Streamlit application:

  • For activating your virtual environment:
#1
Set-ExecutionPolicy Bypass -Scope Process

#2
.venv/Scripts/activate
  • And for execution
streamlit run app.py

📂 Project Structure

The project is organized into three main Python files for modularity:

├── app.py              # Main Streamlit UI and application flow
├── DocProcessor.py            # PDF processing, chunking, and vector store creation
├── model.py        # RAG chain setup, LLM, and prompt templates
├── requirements.txt    # Project dependencies
└── .streamlit/
└── config.toml     # Custom theme for the UI

About

A local and private AI-powered chatbot to ask questions from your PDF documents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages