Model or dataset
huangjia2019/rag-in-action avatar
huangjia2019/rag-in-action

rag-in-action: A Course Repository That Walks Ten RAG Components in Order

End-to-end RAG system design, evaluation, and optimization. 极客时间RAG训练营,RAG 10大组件全面拆解,4个实操项目吃透 RAG 全流程。RAG的落地,往往是面向业务做RAG,而不是反过来面向RAG做业务。这就是为什么我们需要针对不同场景、不同问题做针对性的调整、优化和定制化。魔鬼全在细节中,我们深入进去探究。

831 stars323 forksJupyter NotebookLicense varies

At a glance

What is it?
huangjia2019/rag-in-action is a Jupyter Notebook repository built as the companion code for a paid Geekbang RAG course and a printed book. It is organized as eleven numbered modules rather than as an installable library, and that shape determines both what it is good for and where it stops.
Who is it for?
Adopt this repository if you want a guided, module-by-module walk through the RAG pipeline and you are willing to install its pinned requirement files yourself. Do not adopt it if you need a packaged library with a stable API, or if your team cannot read Chinese, since the README, module names, and course material are in Chinese.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 22 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The Problem It Targets: RAG Is a Pipeline, Not a Prompt

The repository's own framing is that a working RAG system is assembled from many separate decisions, and that the details of each decision determine whether the result is usable. The README states the underlying position directly: RAG deployment is usually business-oriented RAG rather than RAG-oriented business, which is why different scenarios and different questions require targeted adjustment, optimization, and customization. That sentence is the thesis of the whole repository. It is aimed at engineers who already know how to call a language model and now need to understand why their retrieval keeps returning the wrong passages. The intended audience is narrow in one respect: the repository is the code companion to a paid course at Geekbang and to a book published by Posts and Telecom Press, and the README links to both. The code is public under what the README describes as an MIT licence, but the explanatory material lives behind those two products. You can read the notebooks; the reasoning behind each module is sold separately.

Eleven Numbered Modules, Each Owning One Stage

The architecture is a flat list of directories, numbered from 00 to 10, and the numbering is the curriculum. The README's module table assigns each one a function, a stack, and a dependency. 00-简单RAG-SimpleRAG is the baseline system built on LangChain or LlamaIndex. 01-数据导入-DataLoading handles loading and preprocessing with pandas and PyPDF2. 02-文本切块-DocChunking covers splitting strategies through LangChain Splitters. 03-向量嵌入-Embedding covers vectorization with HuggingFace and BGE, with GPU support marked optional. 04-向量存储-VectorDB covers Milvus and Chroma. 05-检索前处理-PreRetrieval covers query expansion. 06-索引优化-Indexing covers hierarchical and keyword indexes. 07-检索后处理-PostRetrieval covers reranking and filtering. 08-响应生成-Generation covers LLM integration. 09-系统评估-Evaluation covers RAGAS and TruLens. 10-高级RAG-AdvanceRAG covers Graph RAG and multi-agent patterns. Two things stand out. First, evaluation is module 09, not module 01, so a reader who wants to measure quality has to walk the whole pipeline first. Second, the modules are not wired into a single callable system; each is a self-contained example with its own documentation, and the README tells you to follow them in order rather than import them.

Getting It Running: Four Requirement Files and a Virtual Environment

The setup path is explicit and repetitive by design, because the repository ships separate requirement files per framework and per hardware profile. For LangChain on Ubuntu with a GPU, the README gives: python -m venv venv-rag-langchain, then source venv-rag-langchain/bin/activate, then pip install -r 91-环境-Environment/requirements_langchain_20250413_Ubuntu-with-GPU.txt. The CPU variant swaps in requirements_langchain_Ubuntu-with-CPU.txt, and Mac and Windows use requirements_langchain_无GPU版_Mac-Win.txt. The LlamaIndex track mirrors this exactly with venv-rag-llamaindex and the requirements_llamaindex_* files. Conda is offered as an alternative, with python=3.10.12 pinned in the example. Hardware expectations are stated: an NVIDIA GPU with at least 8GB of VRAM, CUDA 11.8 or higher, and cuDNN 8.0 or higher on the GPU side; at least 16GB of RAM and a four-core processor on the CPU side. Ubuntu 22.04 LTS is recommended, Apple Silicon can use MPS acceleration, and Windows users are pointed at WSL2 with Ubuntu. Two extra requirement files exist for specific jobs: requirements_camelot_20250413.txt for PDF processing, which may also need ghostscript and python3-tk via apt on Ubuntu or ghostscript and tcl-tk via brew on Mac, and requirements_marker_20250413.txt for the annotation tooling. The README notes that some modules may need additional model downloads or API keys, without saying which ones.

The Dependency Surface Is the Real Cost

This is not a package you install once. The README maintains four parallel requirement files for the two frameworks across GPU and CPU profiles, plus two more for PDF and annotation tooling, and it names the versions by date (20250413) rather than by semantic range. That naming tells you the maintainer refreshes them periodically, and it also tells you the files are snapshots, not constraints that resolve forward. The README's own troubleshooting section lists dependency conflicts as a known failure, with the prescribed fix being a virtual environment and strict adherence to the requirement files. A GPU setup also inherits the CUDA and cuDNN version requirements, and the first listed common problem is CUDA errors caused by driver and toolkit mismatches. The practical consequence: budget time for environment work before you see a single retrieval result, and expect the CPU profile to be the safer default on a laptop. The repository was last pushed in August 2026 according to the repository metadata, and no releases are published, so there is no versioned artifact to pin against. You track the master branch or you track nothing.

What the Repository Does Not Give You

Three gaps are visible from the material alone. The licence is the first. The README's final section states the project uses the MIT licence, but the repository metadata supplied here lists the licence as unknown, which usually means no LICENSE file sits at the repository root. If you need to redistribute the code inside a commercial product, confirm the file exists before relying on the README sentence. The second gap is language. The README, the module directory names, and by extension the course material are in Chinese, and there is no indication of an English translation. An engineer who cannot read Chinese can still run the notebooks but loses the explanation that justifies each chunking or reranking choice, which is the part the repository is actually selling. The third gap is that the repository is a teaching artifact, not a service. There is no API, no CLI, no configuration schema described in the README, and no statement about how the modules would be composed into one deployed system. If your goal is to ship a retrieval endpoint this week, the numbered directories are reference material, not scaffolding. The README also points readers at a separate Star History chart aggregating five of the author's repositories, which is a promotional element rather than a technical one.

How It Differs From a Framework's Own Tutorials

The natural comparison is LangChain's or LlamaIndex's own documentation, since both are named as the frameworks here. The difference is scope of responsibility. A framework tutorial teaches you that framework's abstractions and stops where the abstraction stops. This repository is organized by pipeline stage instead, and it deliberately crosses framework boundaries: the same eleven stages are offered in a LangChain track and a LlamaIndex track, with separate requirement files for each. That parallel structure is the useful part, because it lets you see which stages are framework-specific and which are inherent to retrieval. It also lets you see where the frameworks disagree, for example in how chunking or index construction is expressed. The cost of that structure is that nothing is integrated. A framework's own end-to-end example gives you one runnable path; this repository gives you eleven separate ones and expects you to draw the connections. For a reader who wants to understand retrieval rather than a specific vendor's API, the stage-first ordering is the better teaching shape. For a reader who wants working code today, it is more work.

Who Should Adopt It and What to Check First

The repository fits an engineer who has already built a naive RAG loop and found it lacking, and who wants a structured pass over the stages that could be responsible. The module ordering from data loading through chunking, embedding, storage, pre-retrieval, indexing, post-retrieval, generation, and evaluation is a reasonable checklist to audit an existing system against, even if you never run the notebooks. It fits less well in three cases. If your team works in English only, the explanatory layer is inaccessible. If you need a maintained dependency you can pin, the dated requirement files and the absence of releases make that awkward. If your retrieval problem is narrow, for example a single well-structured document set where a keyword index already works, walking ten stages is disproportionate. Before investing time, check the licence file at the repository root rather than trusting the README line, confirm that the module directory you care about contains a notebook you can actually execute, and pick your requirement file by hardware first, since installing the GPU file on a CPU-only machine is the failure mode the README's own troubleshooting section anticipates.

Editorial conclusion

Adopt this repository if you want a guided, module-by-module walk through the RAG pipeline and you are willing to install its pinned requirement files yourself. Do not adopt it if you need a packaged library with a stable API, or if your team cannot read Chinese, since the README, module names, and course material are in Chinese. Before committing, verify three things: which requirement file matches your hardware, whether the licence file actually exists in the repository, and whether the module you care about has a runnable notebook rather than only documentation.

Official sources

  1. huangjia2019/rag-in-action on GitHub
  2. Issues
  3. Project website
  4. README
Community notes

Community notes