RAG Techniques

Active
GitHub Jupyter Notebook NOASSERTION

Description

NirDiamant's RAG_Techniques repository systematically collects and demonstrates cutting-edge retrieval-augmented generation techniques and engineering practices.

Key Features

  • Systematic taxonomy — techniques organised by simple / advanced / modular levels for targeted learning
  • Runnable notebooks — every technique ships with a Jupyter notebook and minimal runnable code
  • Evaluation & comparison — retrieval quality and answer quality evaluation scripts with visualisation
  • Multi-backend — implementations spanning LangChain, LlamaIndex, Haystack and more
  • Continuously updated — tracks academic and industry progress, regularly adds new methods
  • Teaching-friendly — accompanying articles, tutorials and companion book on Amazon

Use Cases

💡 Systematically learning advanced RAG techniques and engineering practices
💡 Comparing and evaluating RAG approaches for internal technology selection
💡 Copy-pasting notebook snippets directly into production projects
💡 Using as teaching material for internal RAG training programmes
💡 Bridging latest RAG research with open-source implementations

Strengths & Limitations

Strengths

  • Actively maintained, recent updates
  • High community interest (29.3k stars)
  • Established track record (2 years in production)
  • Responsive to issues, low backlog

⚠️ Limitations

  • No clear open-source license

Categories

Quick Start

# Clone the repo
git clone https://github.com/NirDiamant/RAG_Techniques.git
cd RAG_Techniques

# Create a virtual environment
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

# Launch Jupyter
jupyter notebook

# Pick any technique notebook in all_rag_techniques/ and run it

Related Projects

LightRAG

39.3k · Python
Active A+

LightRAG is a simple and fast Retrieval-Augmented Generation framework using graph-enhanced retrieval, published at EMNLP 2025.

raggraphretrieval +2
  • · Graph-enhanced retrieval — Dual-level retrieval (local/global) using knowledge graph entities and relationships, more precise than vector search
  • · Four text chunking strategies — Fixed, Recursive, Vector, and Paragraph chunking adapted to different document types
  • · Multi-backend storage — Neo4j, PostgreSQL, MongoDB, OpenSearch, JSON KV Store and other storage backends supported

KAG

9.0k · Python
Stale B

KAG is a logical form-guided reasoning and retrieval framework based on OpenSPG engine and LLMs for building logical reasoning and factual Q&A solutions for professional domain knowledge bases, effectively overcoming the limitations of traditional RAG vector similarity models.

knowledge-graphragreasoning +2
  • · Bidirectional knowledge-text indexing: KG nodes cross-reference original text chunks for complete context preservation
  • · Logic form-guided hybrid reasoning: transforms natural language into formal logical inference combining exact match, text retrieval, numerical computation, and semantic reasoning
  • · Schema-constrained knowledge construction: supports both free-form information extraction and structured domain expert knowledge representation

Haystack

26.4k · Python
Active A+

Haystack is an enterprise-grade framework for RAG and search applications, covering document processing, retrieval, generation, and evaluation end to end.

ragretrievalllm +1
  • · Modular pipeline architecture — compose retrieval, routing, memory, and generation components as DAGs with conditional branches and loops
  • · Model and vendor agnostic — swap OpenAI, Anthropic, Cohere, Hugging Face, AWS Bedrock, and local models without rewriting
  • · Context engineering control — explicit control over how information is retrieved, ranked, filtered, combined, and routed before reaching the model