Skip to content

Uysim/simple-rag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple RAG

A simple RAG (Retrieval-Augmented Generation) application built with LangChain, ChromaDB, and Gradio.

Features

  • 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

Setup

  1. Create a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file:
cp .env.example .env
  1. Run the application:
python main.py

Project Structure

simple-rag/
├── app/
│   ├── core/               # Core functionality (config, vectorstore)
│   ├── document/           # Document processing (loader, processor)
│   ├── rag/               # RAG implementation (chain)
│   └── ui/                # Gradio interface
├── data/
│   └── vectorstore/       # ChromaDB storage

Usage

  1. Launch the application
  2. Upload Documents: Select PDF, TXT, or MD files to process
  3. Add Webpages: Enter URLs (one per line or comma-separated) to ingest web content
  4. Start chatting with your documents and webpages

Architecture

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

Reference

To understand RAG in the bigger picture checkout my LinkedIn Post

License

MIT

About

Make RAG simple

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages