About this course
A build-it-yourself course: no libraries to install, no APIs to call. In every session
an AI mentor walks you through writing the retrieval core in pure Python — inverted
index, boolean queries, TF-IDF, BM25, phrase search, spell correction, index
compression, retrieval evaluation, all the way to vector retrieval and hybrid RAG
retrieval. Everyone builds RAG, yet almost nobody has opened the black box of "R":
why does keyword stuffing fool TF-IDF but not BM25? Why can't "new york" be faked
with AND? Why does one tokenization change wreck your recall? The course follows the
topic skeleton of Stanford's Introduction to Information Retrieval, with every
session rewritten as original hands-on teaching for the online sandbox — formulas
typeset, algorithms drawn, parameters draggable, code actually running in
milliseconds in your own sandbox. By the end you can answer the eternal question:
"why does my retrieval miss" — and know which layer to fix.
What you'll learn
- Hand-write an inverted index + boolean queries — millisecond term-to-document retrieval
- Implement TF-IDF and BM25 scoring; understand term-frequency saturation and length normalization
- Watch first-hand why keyword stuffing fools TF-IDF but not BM25
- Build a full text pipeline: mixed zh/en tokenization, positional phrase queries, edit-distance spell correction
- Make the index small and fast with skip pointers, variable-byte compression and block merging, then score and tune retrieval with MAP/NDCG
- Assemble hybrid lexical+vector retrieval and systematically diagnose & fix 'why my RAG retrieval misses'
Syllabus
1A Mini Search Engine: from Inverted Index to BM252 sessions
2Before Text Meets the Index: Tokenization, Phrases & Spell Correction3 sessions
3Index Engineering: Skip Pointers, Compression & Block Merging3 sessions
4Evaluating Retrieval: How Good Is Your Search, Really?2 sessions
5Vector Retrieval: When Keywords Aren't Enough0 sessions
Sessions are on the way.
6The "R" in RAG: Putting the Retrieval Core Back into Your RAG0 sessions
Sessions are on the way.
Same series · 人工智能全透析
AI, End to End
Synthesized from the best material across the web — rebuild the core of AI from scratch, the efficient way.