6 episodes, about 51 min 0 views across the series

Topics: Retrieval and knowledge Code: abhydesai/retrieval-explained-code

Retrieval Explained

Created by Abhyuday DesaiUpdated , episode 6

How AI systems find the passages an answer needs: embeddings and vector search, chunking, keyword and hybrid search, query rewriting, reranking, and tracing a wrong answer to its cause.

Start with episode 1

About this series

Retrieval for AI systems, explained one step at a time: short videos, one idea each, animated diagrams and code scenes, and a companion repo with a runnable folder for every video. The series is for developers building an assistant or a search feature over their own documents. You should be comfortable reading Python; no background in search is needed.

One idea runs through every episode. Before a language model can answer from your documents, something has to find the right passages, and each step on the way can lose them: how the documents were cut, how the search scores a match, how the question was worded, how the results were ordered, and how many of them reach the model. Each video takes one of those steps, runs it on a small example, and counts what it found.

Three sections, six episodes.

How search finds passages

  • 1. Embeddings and Vector Search. A small local model turns a question into 384 numbers; cosine similarity scores passages against it, first exactly, then with an HNSW index, and a question about a pool in winter shows what similarity cannot check.
  • 2. Chunking Documents for Search. One travel policy cut four ways: every hundred characters, with a larger size and overlap, at its own headings with a size budget, and as records that say where each chunk came from.
  • 3. Keyword, Semantic and Hybrid Search. BM25 matches an exact error code and misses a question about speed; embeddings find the caching passage; reciprocal rank fusion merges the two rankings without mixing their scores.

Getting better results

  • 4. Query Transformation. A casual question finds one of its two answers; a rewrite and three rewordings find the same one; a hypothetical answer, HyDE, finds both, and counting hits at five shows which method helped.
  • 5. Reranking Search Results. A cross-encoder reads the question with each passage and moves the right one to the top; we time it, see why it only reads a shortlist, and check it with hit at k.

When an answer is wrong

  • 6. Diagnosing Bad Answers. A support assistant gets an annual refund rule wrong; four checkpoints find the evidence ranked sixth behind a cutoff of five, the model is tested on its own, and the fix is checked in the prompt and in the answer.

Part oneHow search finds passages

  1. 01

    Embeddings and Vector Search

    How a retrieval system finds passages by meaning: what an embedding is, how cosine similarity scores a match, when you need an index, and why the closest passage may not answer the question.

    8:08 0 views Published
    Watch
  2. 02

    Chunking Documents for Search

    How to cut documents into chunks a search can use: why a fixed-size cut can split an answer in two, what size and overlap cost, how to cut at headings, and why each chunk should record its source.

    8:06 0 views Published
    Watch
  3. 03

    Keyword, Semantic and Hybrid Search

    When to search by keywords, by meaning, or both: where BM25 and embeddings each miss, and how to merge their rankings with reciprocal rank fusion without mixing their scores.

    8:08 0 views Published
    Watch

Part twoGetting better results

  1. 04

    Query Transformation

    What to try when the search misses an answer that is in your documents: rewriting the question, expanding it into several queries, and HyDE, and how to measure which one helped.

    9:20 0 views Published
    Watch
  2. 05

    Reranking Search Results

    What to do when search finds the right passage but ranks it too low: how a cross-encoder reranks a shortlist, what it costs, what it cannot fix, and how to check that it helped.

    8:32 0 views Published
    Watch

Part threeWhen an answer is wrong

  1. 06

    Diagnosing Bad Answers

    How to find out why a retrieval system gave a wrong answer: follow the evidence through the documents, the search, the prompt and the model, and fix the first step where it was lost.

    8:46 0 views Published
    Watch