NirDiamant/RAG_Techniques

▲ 33 stars today★ 30,159⑂ 3,696

This repository showcases various advanced techniques for Retrieval-Augmented Generation (RAG) systems. Each technique has a detailed notebook tutorial.

About NirDiamant/RAG_Techniques

NirDiamant/RAG_Techniques is an open-source project on GitHub, mainly written in Jupyter Notebook. This repository showcases various advanced techniques for Retrieval-Augmented Generation (RAG) systems. Each technique has a detailed notebook tutorial. It currently holds 30,159 stars and 3,696 forks with 7 open issues, and was last pushed on 2026-10-31 (repository created 2024-07-13).

Project Overview

AI Homed tracks it on the Today's Trending board, currently at rank #52 with 33 new stars today.

GitHub Repository Details

Repository NirDiamant/RAG_Techniques · default branch main · size 39201 KB · watchers 251 · source: GitHub REST API and repository README

README

_AI Agents Made Simple_ reached #1 in Software Development, Software Engineering and Software Design Tools on Amazon.com's Kindle Store.
A decision guide to building AI agents that work: 28 chapters, 148 illustrations, no code.
Get the book on Amazon →

Advanced RAG Techniques 🚀

Elevating Your Retrieval-Augmented Generation Systems

A community-driven hub of 42+ runnable notebooks covering RAG techniques from foundational to cutting-edge - the intuition, the code, and the references to build more accurate, context-rich retrieval systems.

---

PRs Welcome LinkedIn Twitter Reddit Discord Sponsor

📖 Go deeper: the book

https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/RAG Made Simple book cover

RAG Made Simple - the 400-page visual companion to this repo.
Amazon Bestseller in Generative AI

Get it on Amazon (paperback · Kindle · free on Kindle Unlimited) → · Read Chapter 1 free

Sponsors ❤️

We gratefully acknowledge the organizations and individuals who have made significant contributions to this project.

Company Sponsors

https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/Contextual AI https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/Contextual AI https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/CodeRabbit https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/CodeRabbit https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/Qodo

Individual Sponsors

https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/

📫 Stay Updated!

🚀
Cutting-edge
Updates
💡
Expert
Insights
🎯
Top 0.1%
Content

Subscribe to DiamantAI Newsletter

Join over 50,000 AI enthusiasts getting unique cutting-edge insights and free tutorials! Plus, subscribers get exclusive early access and special 33% discounts on my books!

DiamantAI's newsletter

🎬 Prefer video?

I break these ideas down into short, one-idea-per-episode explainers on YouTube.

https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/
🆕 AI Is Rewarded for Guessing [Hallucination]

why a model guesses instead of saying I don't know, watched on its own token probabilities, and where retrieval moves the fact out of the guess

https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/
RAG Explained: Why AI Gets Your Own Documents Wrong

why chunks overlap, what "meaning space" is, and where simple RAG breaks down
https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/
How Do You Search a Spreadsheet by Meaning?

turn each row into one labelled line and search the table by meaning
https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/
How Do You Know Your RAG Answer Isn't Made Up?

three checkpoints that catch a bad chunk on the way in and an unsupported claim on the way out
https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/
Why Does RAG Return a Paragraph When You Asked for One Fact?

why a paragraph's embedding is a blend that points at nothing in particular

Subscribe on YouTube   Browse every episode →

Introduction

Retrieval-Augmented Generation (RAG) is revolutionizing the way we combine information retrieval with generative AI. This repository showcases a curated collection of advanced techniques designed to supercharge your RAG systems, enabling them to deliver more accurate, contextually relevant, and comprehensive responses.

Our goal is to provide a valuable resource for researchers and practitioners looking to push the boundaries of what's possible with RAG. By fostering a collaborative environment, we aim to accelerate innovation in this exciting field.

Related Projects

🚀 Agents Towards Production - code-first tutorials for shipping production-grade GenAI agents, prototype to scale.

🤖 GenAI Agents - a broad collection of AI agent implementations and tutorials.

🖋️ Prompt Engineering Techniques - prompting strategies from basics to advanced.

🧠 Agent Memory Techniques - 30 notebooks on agent memory: vector stores, knowledge graphs, Mem0, MemGPT, Zep, Graphiti.

Join the community

Contributions make this better - propose ideas, share techniques, or give feedback via CONTRIBUTING.md.

r/EducationalAI · Discord · LinkedIn

Key Features

Advanced Techniques

Explore our extensive list of cutting-edge RAG techniques:

Recently added: Document Parsing with Mistral OCR 4 (sponsored by Mistral AI), MemoRAG (memory-augmented retrieval), End-to-End RAG Evaluation, Open-RAG-Eval, JSON RAG. 42 notebooks and growing.

| # | Category | Technique | View | |---|----------|-----------|------| | 1 | Foundational 🌱 | Basic RAG | Image from the project README Image from the project README Image from the project README | | 2 | Foundational 🌱 | RAG with CSV Files | Image from the project README Image from the project README Image from the project README | | 3 | Foundational 🌱 | Reliable RAG | Image from the project README Image from the project READMEImage from the project README | | 4 | Foundational 🌱 | Optimizing Chunk Sizes | Image from the project README Image from the project README | | 5 | Foundational 🌱 | Proposition Chunking | Image from the project README Image from the project README Image from the project README | | 6 | Query Enhancement 🔍 | Query Transformations | Image from the project README Image from the project README Image from the project README | | 7 | Query Enhancement 🔍 | HyDE (Hypothetical Document Embedding) | Image from the project README Image from the project README Image from the project README | | 8 | Query Enhancement 🔍 | HyPE (Hypothetical Prompt Embedding) | Image from the project README Image from the project README | | 9 | Context Enrichment 📚 | Contextual Chunk Headers | Image from the project README Image from the project README Image from the project README | | 10 | Context Enrichment 📚 | Relevant Segment Extraction | Image from the project README Image from the project README | | 11 | Context Enrichment 📚 | Context Window Enhancement | Image from the project README Image from the project README | | 12 | Context Enrichment 📚 | Semantic Chunking | Image from the project README Image from the project README | | 13 | Context Enrichment 📚 | Contextual Compression | Image from the project README Image from the project README | | 14 | Context Enrichment 📚 | Document Augmentation | Image from the project README Image from the project README | | 15 | Advanced Retrieval 🚀 | Fusion Retrieval | Image from the project README Image from the project README | | 16 | Advanced Retrieval 🚀 | Reranking | Image from the project README Image from the project README | | 17 | Advanced Retrieval 🚀 | Multi-faceted Filtering | Image from the project README Image from the project README | | 18 | Advanced Retrieval 🚀 | Hierarchical Indices | Image from the project README Image from the project README | | 19 | Advanced Retrieval 🚀 | Dartboard Retrieval | [

GitHub Stars & Activity

30,159Stars
3,696Forks
7Open issues
Jupyter NotebookLanguage

GitHub Popularity

GitHub stars30,159
Forks3,696
Open issues7
Primary languageJupyter Notebook
LicenseNOASSERTION
Stars gained today33
Created2024-07-13
Last pushed2026-10-31

Trending History

Daily boardrank #52 · ▲ 33 stars
Monthly boardrank #73 · ▲ 576 stars

Related AI Projects

1

patchy631 / ai-engineering-hub

Jupyter Notebook★ 38,652⑂ 6,352▲ 78 stars
→
2

datawhalechina / happy-llm

Jupyter Notebook★ 34,671⑂ 3,279▲ 22 stars
→
3

datawhalechina / self-llm

Jupyter Notebook★ 32,657⑂ 3,147▲ 12 stars
→
4

microsoft / OmniParser

Jupyter Notebook★ 25,597⑂ 2,239▲ 3 stars
→
5

karpathy / nn-zero-to-hero

Jupyter Notebook★ 25,129⑂ 3,650▲ 42 stars
→
6

QwenLM / Qwen3-VL

Jupyter Notebook★ 20,152⑂ 1,881▲ 8 stars
→
7

karpathy / micrograd

Jupyter Notebook★ 18,355⑂ 2,927▲ 59 stars
→
8

SakanaAI / AI-Scientist

Jupyter Notebook★ 14,884⑂ 2,081▲ 40 stars
→

More AI Rankings