RAG_Techniques README

The project's README from github.com/NirDiamant/RAG_Techniques. As one markdown file: README.md.

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. 20 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 a full module, free

🎬
7-minute
video lecture
🛠️
Hands-on
tutorial
🤖
AI assistant
inside Claude Code

One npm install adds the module's AI assistant to your Claude Code, and it guides you through the tutorial as you build.

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

Contextual AI Contextual AI CodeRabbit CodeRabbit Qodo

Individual Sponsors

📫 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.


🆕 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


RAG Explained: Why AI Gets Your Own Documents Wrong

why chunks overlap, what "meaning space" is, and where simple RAG breaks down

How Do You Search a Spreadsheet by Meaning?

turn each row into one labelled line and search the table by meaning

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

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

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

🚀 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) [](https://europe-west1-rag-techniques-views-tracker.cloudfunctions.net/rag-techniques-tracker?notebook=main-readme&click=youtube-hyde-table&targ

RAG_Techniques (NirDiamant/RAG_Techniques)

Searching Database…

这是什么?一个由社区维护的高级 RAG(检索增强生成)技术合集——让大语言模型的回答基于检索到的文档,所有技术都被提炼成可以直接运行的 notebook 教程。
这是一个可以安装的库,还是一套教程?是一套教程,不是软件包:42 个以上各自独立的 Jupyter notebook,每个都讲解一种 RAG 技术,包含原理讲解、代码和参考资料。
我怎么学习其中一种技术?克隆这个仓库,在 Jupyter 中打开对应技术的笔记本,从头到尾运行一遍——每个 notebook 都是一节独立的课,你可以把它改成适配自己的技术栈。
运行这些 notebook 需要安装和配置什么?需要 Python 和 Jupyter。按照仓库的标签,这些 notebook 基于 LangChain 和 LlamaIndex 构建,并使用 OpenAI 的 GPT 模型,所以其中大部分都需要准备一个 OpenAI API 密钥。
开始之前有什么要注意的坑吗?它教的是技术方法,而不是提供一个可用于生产的库——你需要把代码移植到自己的系统里。另外,notebook 会调用托管的 LLM API,所以全部跑一遍会消耗 API 额度。
RAG 新手能有收获吗,还是只适合已经在搭建系统的人?都适合:内容从最基础的知识一直讲到最前沿,而且是为推动 RAG 能力边界的研究者和实践者编写的。
普通笔记本电脑能跑吗,还是需要特殊硬件?任何装了 Python 和 Jupyter 的机器都可以——Windows、macOS 或 Linux 都行;LLM 相关的计算通过云端 API 完成,不依赖你自己的硬件。
这个合集涵盖哪些类型的技术?从基础 RAG、块大小优化和命题分块,到查询变换、HyDE(假设性文档嵌入)和智能体 RAG,应有尽有,还包括 MemoRAG 和端到端 RAG 评估等较新的内容。
新手应该从哪里入手?从 Foundational(基础)部分开始:先学 Basic RAG,然后依次是 RAG with CSV Files、Reliable RAG、Optimizing Chunk Sizes 和 Proposition Chunking,之后再学习 HyDE 等查询增强技术。
这个合集还在更新吗,还是已经过时了?依然活跃并持续增长:README 列出了近期新增的内容(MemoRAG、End-to-End RAG Evaluation、Open-RAG-Eval、JSON RAG),统计有 42 个 notebook,并承诺定期更新。该仓库未被归档,大约有 29.8k 颗星。
这里所有内容都免费吗?notebook 是免费的。作者对配套内容收费——一个 20 个模块的 Prompt to Production 课程和 400 页的书 RAG Made Simple——两者都在 README 中有链接。
Creator
NirDiamant
Size
40.1 MB
Stars
29.9K
Age
2y
Commits · 90 Days