elOpenMike
← Back to blog

Published May 20, 2026 · Updated August 12, 2026 · 1 min read

Grounding agents in real data

Why retrieval beats prompt-stuffing, and a pattern for wiring tools to an agent without losing the plot.

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:

TypeScript
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.

Web-slinger mode off