Building with AILesson 42 of 80

Module 4 · Retrieval and the knowledge problem

Long context instead of retrieval: the arithmetic of skipping the pipeline

In this lesson

  • 9 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 11 of 11 in this chapter

This chapter’s goalBuild a retrieval pipeline from raw documents to a ranked set of chunks (embed, index, fuse with keyword search, rerank, filter by permission) measure its recall on a gold set of your own questions, and say from cost and quality numbers whether a given corpus should be retrieved or simply placed in the context window.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
A 400-page manual, 2,000 questions a dayWhole manual in context,uncached900Two relevant chapters,whole150Whole manual in context,cache warm90Five retrieved chunks15dollars a day at $3 per million input tokensNone of these is the right answer in general. The cached figure assumes traffic steady enough to keepa five-minute window warm; at a few questions an hour the prefix is re-paid each time and the top baris what you get. Retrieval is cheapest and occasionally misses a fact two sections away.
None of these is the right answer in general. The cached figure assumes traffic steady enough to keep a five-minute window warm; at a few questions an hour the prefix is re-paid each time and the top bar is what you get. Retrieval is cheapest and occasionally misses a fact two sections away.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

The window is now bigger than most corpora

Frontier models accept 200,000 tokens as standard and some accept a million or more. A 300-page book is roughly 100,000 tokens. A company’s entire policy handbook, a product’s full documentation, a customer’s complete contract set, a mid-sized codebase: each of these fits in one request. When it fits, the question is legitimate: why build a retrieval pipeline at all?

Sometimes you should not. This lesson is the arithmetic for deciding.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Python, from Zero, for AI exam.

Stuck on something?Ask Sayali, your AI tutor

How to cite: Addaly (2026) ‘Long context instead of retrieval: the arithmetic of skipping the pipeline’, in Building with AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/building-with-ai/long-context-instead-of-retrieval (Accessed: 29 November 2026).