A simple RAG (Retrieval-Augmented Generation) application built with LangChain, ChromaDB, and Gradio.
- Document ingestion from PDF and text files
- Webpage ingestion with URL support
- Efficient document chunking and embedding
- Interactive chat interface
- Persistent vector store
- Modular architecture with clear separation of concerns
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file:
cp .env.example .env
- Run the application:
python main.py
simple-rag/
├── app/
│ ├── core/ # Core functionality (config, vectorstore)
│ ├── document/ # Document processing (loader, processor)
│ ├── rag/ # RAG implementation (chain)
│ └── ui/ # Gradio interface
├── data/
│ └── vectorstore/ # ChromaDB storage
- Launch the application
- Upload Documents: Select PDF, TXT, or MD files to process
- Add Webpages: Enter URLs (one per line or comma-separated) to ingest web content
- Start chatting with your documents and webpages
The application follows a modular architecture:
- UI Layer (
app/ui/
): Gradio interface components - Document Layer (
app/document/
): Document loading and processing logic - RAG Layer (
app/rag/
): Retrieval-augmented generation implementation - Core Layer (
app/core/
): Configuration and vector store management
To understand RAG in the bigger picture checkout my LinkedIn Post
MIT