Retrieval Beyond Vectors

Module 8, Lecture 8.3 | Retrieval-Augmented Generation (RAG)

Lecture 8.2 covered vector search in depth; this lecture covers the rest of the RAG category and how to choose among its mechanisms. Web search brings in live information from the public web, either built into the model API, where the provider runs the search, or through a search API such as Exa, Perplexity, or Brave called from a tool the developer writes. Database queries answer structured questions exactly: the model translates a natural-language question into SQL, and the tool enforces read-only credentials, an allowed-tables list, and caps on result size. The read_file tool from Module 6 and any tool that calls an external API are retrieval too, and the model's own training data serves as parametric retrieval: fast and free, but stale, opaque, and prone to hallucination. Real agents compose several mechanisms, as Claude Code does with file reads, web search, shell commands, and its training, and the model chooses among retrieval tools by reading their descriptions. The lecture closes on the unifying principle of Module 8: any tool that brings external information into the context is a retrieval mechanism, and only the R in RAG varies.

Read the full lecture narrative

Additional Resources