This repository contains a Jupyter Notebook that demonstrates how to build a Retrieval-Augmented Generation (RAG) system using:
- Python ๐
- Ollama (for running LLM locally)
- LangChain (for retrieval & orchestration)
- ChromaDB (for vector storage)
- SentenceTransformers (for text embeddings)
โ
What is RAG, and how does it work?
โ
How to extract text from PDFs
โ
How to create embeddings and store them in ChromaDB
โ
How to retrieve relevant information
โ
How to use Ollamaโs LLM to generate responses
1๏ธโฃ Clone this repository:
git clone https://github.com/yourusername/rag-system.git
cd rag-system3๏ธโฃ Create a virtual environment & install dependencies:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install langchain chromadb sentence-transformers pypdf ollama4๏ธโฃ Pull LLM Model:
ollama pull llama3.2โ
Load and process PDF documents
โ
Generate text embeddings using SentenceTransformers
โ
Store embeddings in ChromaDB for efficient retrieval
โ
Query and retrieve relevant documents
โ
Use Ollamaโs LLM to generate responses