- A lightweight Retrieval Augmented Generation (RAG) application.
- Enables users to ask natural language questions about the provided website content.
- The system extracts information from webpages, converts them into semantic vector embeddings, retrieves the most relevant context using ChromaDB, and generates accurate, context-aware responses using a locally hosted LLM through Ollama.
Built with LangChain 1.x, ChromaDB, HuggingFace Embeddings, and Ollama.
- Retrieval Augmented Generation (RAG)
- Web page ingestion using WebBaseLoader
- Automatic Document chunking
- Semantic search with Chroma Vector Database
- Local inference using Ollama
- HuggingFace Sentence embeddings
- Modular project structure
- No cloud based LLM APIs required
- Python 3.10+
- LangChain 1.x
- ChromaDB
- Hugging Face Embeddings (
BAAI/bge-base-en-v1.5) - Ollama
- Llama 3.2 (1B) (or any compatible Ollama model)
WebRAG/
│
├── ingest.py # Builds the vector database
├── chatbot.py # Runs the chatbot
├── chroma_db/ # Persistent Chroma database
├── .env.example
├── .gitignore
├── requirements.txt
└── README.md
- Clone the repository
git clone <repo-url>
cd WebRAG
- Create a virtual environment
python3 -m venv rag
source rag/bin/activate
- Install dependencies
pip install -r requirements. txt
- Download and install Ollama
curl -fsSL https://ollama.com/install.sh | sh
- Pull an LLM
Example -
ollama pull llama3.2:1b
Create a .env file in the project root.
Example-
HF_TOKEN=hf_xxxxxxx
Note: The Hugging Face token is only required if you are using hosted Hugging Face services.
Local embedding models typically do not require it once downloaded.
Run the ingestion script once.
~$ python ingest.py
This script:
- Downloads the webpages.
- Splits them into chunks.
- Generates embeddings.
- Stores them in the ChromaDB.
The vector database is saved inside the chroma_db/ directory. You only need to run this again if you change or add source documents.
~$ python chatbot.py
- PDF document ingestion
- Multiple website support
- Web Interface or Frontend UI
- Conversation Memory
- Faster responses
