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.
Web search tool — Claude docs. The built-in search: Anthropic runs the search, and the results come back in the same API response.
Exa Developer quickstart — A search API built for AI applications, with separate Search and Contents endpoints; Contents returns the text of each page.
Perplexity Search API Overview — Returns ranked web results as JSON, with no generated answer, for an agent to filter or pass to its own model.
Brave Search API — Web search results from Brave's own independent index, with no dependence on Google or Bing.
LLM06:2025 Excessive Agency — OWASP Gen AI Security Project. Covers tools granted more permission than they need, including a read-only tool connected with UPDATE, INSERT, and DELETE rights, and an agent that needs read access to only one table.
Language Models as Knowledge Bases? — Petroni et al., EMNLP 2019. An early study of the factual knowledge stored in a model's weights: parametric retrieval.