← Back to blog
May 20, 2026 · 1 min read
Grounding agents in real data
AIDistributed Systems
Prompt-stuffing falls over the moment your data changes. The fix is to let the agent retrieve what it needs at call time.
A minimal tool
Here's the shape of a grounded tool call:
async function searchDocs(query: string) {
const hits = await index.search(query, { topK: 5 });
return hits.map((h) => h.text);
}Keep the surface small, log every call, and ground answers in what came back.