Skip to content

Shahryar-Sohail/local-rag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Local RAG Assistant

This is an Advanced Retrieval-Augmented Generation (RAG) system built locally to chat with private documents. This version is optimized to run 100% locally on your machine using Ollama, saving costs and ensuring data privacy.


πŸ› οΈ Tech Stack

  • Framework: LangChain πŸ¦œπŸ”—
  • LLM: Llama 3.2:1b (Local via Ollama) πŸ¦™
  • Embeddings: mxbai-embed-large (1024-dim) πŸ”’
  • Vector Store: FAISS (Facebook AI Similarity Search) ⚑
  • Database: Pickle (Metadata storage) πŸ’Ύ
  • Environment: Python 3.10+ 🐍

πŸ“₯ Installation & Setup

  1. Clone the Repository πŸ“‚
git clone https://github.com/Shahryar-Sohail/local-rag/
cd local-rag
  1. Create & Activate Virtual Environment 🍦
python -m venv .venv

On Windows:

.venv\Scripts\activate
  1. Install Dependencies πŸ“¦
pip install -r requirements.txt
  1. Setup Local Models (Ollama) πŸ“₯
ollama pull llama3.2:1b
ollama pull mxbai-embed-large

5.πŸš€ Running the Project To test the backend pipeline and see the AI in action:

python app.py

βš™οΈ How It WorksIngestion:

1-PDFs and text files are loaded from the data/ directory.

2-Chunking: Documents are split into manageable pieces using RecursiveCharacterTextSplitter.

3-Embedding: Each chunk is converted into a 1024-dimensional vector using the mxbai-embed-large model.

4-Indexing: Vectors are stored in a FAISS index for high-speed similarity search.

5-Retrieval: When a query is made, the system finds the top-$k$ most relevant chunks.

6-Generation: Llama 3.2 uses the retrieved context to generate a concise, factual summary.

About

πŸ’» Chat with your PDFs privately using Ollama (Llama 3.2) & LangChain! πŸš€ πŸ”₯ πŸ”’ 100% Privacy: No Cloud ☁️, No API keys πŸ”‘β€”Pure local AI intelligence powered by Python 🐍, ChromaDB πŸ“ & mxbai-embeddings 🧠 ✨

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages