LLM Basics
Lesson 6 of 7

Retrieval as an Agentic Capability

Grounding with Retrieved Context, back in Prompt Engineering, handed the model exactly the right passage and let it answer from there. That's the mechanical half of retrieval, and it's honest about handing the model the right passage on purpose. The agentic half is deciding whether what came back is actually good enough, and searching again with a better query when it isn't, without a person stepping in to make that call.

Predict before you look

The first search result below is real information about the library, just not the information the question is actually asking about. Before you look, do you expect the model to answer anyway using what it has, or recognize the gap and search again?

The first search result was genuinely about the right library, hours, address, nothing invented, it just didn't mention late fees at all. Rather than answer anyway, the model recognized the gap and emitted a second, more specific search of its own wording, aimed squarely at the fee policy the first result was missing. Given a second result that actually contained the answer, it responded correctly, 25 cents a day, capped at 5 dollars per item.

This is the same underlying splice-it-into-context mechanism from Prompt Engineering's grounding lesson, more tokens for attention to draw on, but the decision of whether those tokens were enough, and what to search for if they weren't, happened without anyone telling the model what to do next. That decision, not the splicing itself, is the part that belongs in this course rather than Prompt Engineering.

What made this example agentic rather than just retrieval grounding?