Models, Retrieval, Tools, and Control Flow › Why not just prompt harder
Language AI HandbookAll chapters Put the titles and prices from a static catalog into a prompt and a model has enough input to attempt a catalog answer. The prompt stays tied to that snapshot. It carries no information about a sale that happened after the snapshot was taken. Put fresh stock in the same prompt and the freshness problem moves to whatever code fetched those counts. Someone still has to decide what to fetch, whose inventory to show, and what to do when the fetch returns late.
Separate the two questions early. “Which Trail Runners have a size 10 variant?” is a question about fields in product records. “Can I get one right now?” needs information from inventory. Conflating the two leads the interface to show “available” even if the source only reports a list of offered sizes. A scoped retrieval step lets the orchestrator ask for candidate records first, with the stock step deferred until there is a concrete product and size.
The example gives the parser and generator the shape of a model client, but both are small functions. That is useful when debugging the wiring. Give the parser a fixture input and inspect the query plan. Give the generator a particular candidate set and check the IDs its answer cites. If the complete result is wrong, keep the input fixed while swapping one component at a time. With two model calls, this also exposes which call had a bad input before you attribute its output to the model.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!