You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A deep dive into 25 Retrieval-Augmented Generation (RAG) variants: from foundational architectures to advanced frameworks, each with detailed tutorials and runnable Python implementations.
Overview
This repository is a hands-on learning resource for developers and researchers exploring RAG techniques. It covers 25 RAG variants ranging from the classic Standard RAG to advanced frameworks like Graph RAG. Each variant includes:
In-depth tutorials (bilingual: English & Chinese): architecture analysis, working principles, use cases, and trade-off analysis
Runnable code: complete Python implementations using sentence-transformers + FAISS + OpenAI API
# Clone the repository
git clone https://github.com/your-username/learn-rag.git
cd learn-rag
# Install dependencies
uv sync
# Configure API Key (required for LLM generation)
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
Run an Example
# Run any variant
uv run python variants/01_standard_rag/main.py
# If you need to load environment variables from .envsource .env # or: export OPENAI_API_KEY=sk-your-key
uv run python variants/01_standard_rag/main.py
A deep dive into 25 Retrieval-Augmented Generation (RAG) variants: from foundational architectures to advanced frameworks, each with detailed tutorials and runnable Python implementations.