NirDiamant/RAG_Techniques

▲ 44 stars today★ 29,762⑂ 3,646

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 29,762 stars and 3,646 forks with 7 open issues, and was last pushed on 2026-09-21 (repository created 2024-07-13).

Project Overview

Git Homed tracks it on the Today's Trending board, currently at rank #79 with 44 new stars today.

GitHub Repository Details

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

README

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

🎓 From RAG prototypes to production

Prompt to Production - my full course on building software with AI the way professionals do: the methods and paradigms behind reliable, efficient, modular production systems, taught systematically. 17 modules, each pairing a video lecture with a hands-on lab, from your first structured prompt to a working production system.

The course is live. Every module is out, lecture and lab.

🎁 Try it on your own repo, free

Your coding agent starts every session knowing nothing about your project, so it guesses. Paste one line into the agent you already have open, and about fifteen minutes later your repository has a docs layer written from the code itself, plus a card scoring what your agent knew before and after.

We ran it on six repositories you already depend on. Each one was asked five questions about itself, cold, then again after the layer was written. The last column counts statements in that project's own documentation that its own code disproves:

| repo | before | after | own docs its code disproves | |---|---|---|---| | fastapi | 2 of 5 | 5 of 5 | 2 | | flask | 3 of 5 | 5 of 5 | 6 | | django | 3 of 5 | 4 of 5 | 1 | | express | 2 of 5 | 4 of 5 | 4 | | requests | 2 of 5 | 4 of 5 | 0 | | langchain | 5 of 5 | 4 of 5 | 5 |

Flask's six include four documentation examples that raise TypeError when you run them. Langchain scored lower afterwards, because it already ships a 380-line agent instruction file and the cold read was grading theirs; that row is in the table anyway.

Clone any of those repos, paste the same line, and check the number yourself. No signup.

https://github.com/NirDiamant/RAG_Techniques/blob/HEAD/Claim your free module

👉 Get the full course

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 to my book and the upcoming RAG Techniques course!

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.

📖 Go deeper: the book

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

RAG Made Simple - the 400-page visual companion to this repo. Amazon Bestseller in Generative AI · 1,500+ readers · ⭐ 4.6

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

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: 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 | | | 2 | Foundational 🌱 | RAG with CSV Files | | | 3 | Foundational 🌱 | Reliable RAG | | | 4 | Foundational 🌱 | Optimizing Chunk Sizes | | | 5 | Foundational 🌱 | Proposition Chunking | | | 6 | Query Enhancement 🔍 | Query Transformations | | | 7 | Query Enhancement 🔍 | HyDE (Hypothetical Document Embedding) | | | 8 | Query Enhancement 🔍 | HyPE (Hypothetical Prompt Embedding) | | | 9 | Context Enrichment 📚 | Contextual Chunk Headers | | | 10 | Context Enrichment 📚 | Relevant Segment Extraction | | | 11 | Context Enrichment 📚 | Context Window Enhancement | | | 12 | Context Enrichment 📚 | Semantic Chunking | | | 13 | Context Enrichment 📚 | Contextual Compression | [](htt

GitHub Stars & Activity

29,762Stars
3,646Forks
7Open issues
Jupyter NotebookLanguage

GitHub Popularity

GitHub stars29,762
Forks3,646
Open issues7
Primary languageJupyter Notebook
LicenseNOASSERTION
Stars gained today44
Created2024-07-13
Last pushed2026-09-21

Trending History

Daily boardrank #79 · ▲ 44 stars

Related GitHub Projects

1

jackfrued / Python-100-Days

Jupyter Notebook★ 187,000⑂ 55,751▲ 41 stars
→
2

Lordog / dive-into-llms

Jupyter Notebook★ 56,174⑂ 6,715▲ 147 stars
→
3

NirDiamant / agents-towards-production

Jupyter Notebook★ 21,598⑂ 2,868▲ 45 stars
→
4

mattpocock / skills

Shell★ 284,242⑂ 23,793▲ 1,737 stars
→
5

multica-ai / andrej-karpathy-skills

★ 218,142⑂ 21,976▲ 279 stars
→
6

microsoft / vscode

TypeScript★ 193,524⑂ 44,983▲ 43 stars
→
7

flutter / flutter

Dart★ 179,439⑂ 33,566▲ 164 stars
→
8

huggingface / transformers

Python★ 167,167⑂ 34,796▲ 94 stars
→

More Trending Repositories