Explained Episode 4 of 8

04 Context: what an AI model actually sees

11 min Watch on YouTube

What an AI model actually sees while it works: the context window, how an agent fills it step by step, why a bigger window doesn't mean better answers (context rot), how to keep it clean, and how RAG (retrieval-augmented generation) finds the right documents, and what happens when it finds the wrong ones.

Chapters

  1. 0:00Intro
  2. 0:53What the model sees
  3. 2:17How fast does an agent fill it?
  4. 3:44Why cut anything?
  5. 5:06How do you keep the form clean?
  6. 6:34What about a question the data can't answer?
  7. 8:18Is that right?
  8. 10:13What should a model see?

Sources 19

Every claim in the episode, and where it comes from.

  1. Anthropic, models overview (1M-token context windows) platform.claude.com
  2. OpenAI, models (about a million tokens) developers.openai.com
  3. Google, Gemini models (1M tokens) aistudio.google.com
  4. Google, Gemini API long-context docs (a million tokens is eight novels; finding one fact) aistudio.google.com
  5. Anthropic docs, context windows (context rot; what counts toward the window; too-long requests are refused; dropping the oldest messages) platform.claude.com
  6. Claude Help Center, usage and length limits (Claude sums up earlier messages) support.claude.com
  7. Google, Gemma 4 31B tokenizer (our token counts for the sales agent's run, before and after cleaning it up) huggingface.co
  8. Liu et al. 2023, Lost in the Middle (20 documents; 75.8% when the answer came first, 53.8% in the middle, 56.1% with none) arxiv.org
  9. Chroma 2025, Context Rot (18 models, less reliable as the input grows) trychroma.com
  10. Google DeepMind, Gemini 4 Argon model card (2026 scores on short and long inputs) deepmind.google
  11. Google, Gemini 2.5 report (Gemini playing Pokémon tended to repeat old moves past about 100,000 tokens) storage.googleapis.com
  12. Anthropic, Effective context engineering for AI agents (the smallest set of high-signal tokens; what a good summary keeps; searching with tools) anthropic.com
  13. Anthropic, Managing context on the Claude Developer Platform (clearing old tool results cut tokens 84%) claude.com
  14. Google, Gemini API token docs (about ¾ of a word a token, for "about 4 million tokens") aistudio.google.com
  15. Lewis et al. 2020, retrieval-augmented generation (the name, from 2020) arxiv.org
  16. Anthropic, Introducing Contextual Retrieval (chunks; keyword and meaning search; a line of context, with keyword search, cut failed searches from 5.7% to 2.9%) anthropic.com
  17. OpenAI, embeddings docs (an embedding is a list of numbers, 1,536 of them for one OpenAI model) developers.openai.com
  18. Latent Space, Claude Code interview (early versions used RAG; the switch to searching with tools, mostly by feel) latent.space
  19. Cursor, semantic search (word search plus meaning search: +12.5% answer accuracy on average, in Cursor's own test) cursor.com

Written by Kiran Krishna. Narrated with an AI voice.

LinkedIn: linkedin.com/in/kiran-krishna-au