How the Machine Actually Works
Before the patterns β RAG, agents, tools β it's worth seeing the whole machine once, end to end: where a model's knowledge comes from, how it "makes sense" of text, and how an agent finds things it was never trained on. Every later module is a variation on this one picture.
Where understanding comes from
An LLM is trained on one deceptively simple task: predict the next word, over trillions of words of text. To do that well, the model is forced to internalize how language works β grammar, facts, concepts, cause and effect, code semantics β because you cannot reliably complete "the capital of France is ___" without modeling what the sentence means. That compressed model of the world ends up stored in the network's weights. This is parametric knowledge: everything the model knows without being told, frozen at the moment training ended.
Inside, meaning is geometry. The model represents words and concepts as vectors β positions in a vast space where related things sit near each other ("invoice" near "billing"). Its attention mechanism relates every token to every other, so a pronoun binds to the right noun and a question binds to the relevant part of the context. This is the same idea behind the embeddings in Module 4 β retrieval embeddings are a small, externalized version of the model's own internal trick for representing meaning.
Two sources of knowledge, one reader
At answer time the model draws on exactly two things: its weights and its context window (the prompt β your question, retrieved documents, tool results). Parametric knowledge is frozen, fuzzy, and uncitable β compression means the model sometimes reconstructs plausible-but-wrong detail, which is all a hallucination is. Context is current, exact, and citable. That is the entire reason RAG exists: retrieval doesn't create understanding β it supplies raw material. An embedding search only finds text that is about the right topic; the LLM then comprehends those chunks with the same machinery it applies to everything else. Comprehension always happens in the model; RAG just changes what's in front of it.
How an agent "finds" things
The model can only see what's in its context window β it cannot reach out on its own. An agent is simply a loop around it: the LLM is given descriptions of tools (search an index, query a database, fetch a page), it decides β by generating text β "call the search tool with these terms," the surrounding program executes the call, and the results are pasted back into the context, where the model reads them like anything else. Then it decides the next step. That's the whole design: LLM + tools + a loop. The finding is done by ordinary code; the judgment about what to find and what the results mean is the model.
The one-sentence mental model
The weights are a compressed library the model absorbed during training; the context window is the desk in front of it right now; retrieval and tools are runners that fetch documents to the desk; and the model's forward pass is the reader that comprehends whatever is on the desk β including what it fetched for itself. Hold onto that picture: every architecture in this course is just a decision about what belongs in the library, what belongs on the desk, and who the runners are.