Multi-Agent Grounding Patterns 2026
Three patterns for grounding multi-agent systems: shared search cache, per-agent search budgets, and critic-loop verification. Code for each.
Multi-agent research systems built with LangGraph or CrewAI need reliable data grounding to avoid hallucinated outputs. The key patterns: shared search cache between agents, per-agent budget limits, critic-verified citations, and structured JSON over prose summaries for inter-agent communication.
Pattern 1: shared search cache
When multiple agents research related topics, they often search for the same or similar queries. A shared cache prevents duplicate API calls and ensures all agents work from the same source data.
import os, requests, hashlib, json
CACHE = {}
H = {"x-api-key": os.environ["SCAVIO_API_KEY"],
"Content-Type": "application/json"}
def cached_search(query: str) -> list:
key = hashlib.md5(query.encode()).hexdigest()
if key not in CACHE:
resp = requests.post(
"https://api.scavio.dev/api/v1/search",
headers=H,
json={"query": query, "country_code": "us"},
)
CACHE[key] = resp.json().get("organic_results", [])[:5]
return CACHE[key]Pattern 2: per-agent budget limits
class BudgetedSearchTool:
def __init__(self, max_queries: int = 20, cost_per_query: float = 0.005):
self.remaining = max_queries
self.cost_per_query = cost_per_query
self.total_spent = 0.0
def search(self, query: str) -> list:
if self.remaining <= 0:
return [{"error": "Budget exhausted"}]
self.remaining -= 1
self.total_spent += self.cost_per_query
return cached_search(query)
researcher = BudgetedSearchTool(max_queries=30)
critic = BudgetedSearchTool(max_queries=10)Pattern 3: structured JSON over prose
When agents pass information to each other, structured JSON fits in context windows better and is more precisely parseable than prose summaries. A research agent should output a typed result object, not a paragraph of text.
# Bad: prose handoff (wastes tokens, loses structure)
handoff = "I found that Tavily costs $0.008 per credit and..."
# Good: structured handoff (compact, parseable)
handoff = {
"query": "tavily pricing 2026",
"findings": [
{"source": "tavily.com/pricing", "fact": "Free: 1000/mo",
"verified": True},
{"source": "tavily.com/pricing", "fact": "Pay-as-you-go: $0.008/credit",
"verified": True},
],
"confidence": 0.95,
"cost": 0.005,
}Pattern 4: critic-verified citations
The critic agent should not just evaluate output quality. It should verify that cited sources actually exist and contain the claimed information. This catches hallucinated references before they reach the final output.
Anti-pattern: unbudgeted search loops
Without budget limits, a researcher agent can burn through hundreds of search queries in a single task. At $0.005/query, 200 searches cost $1.00 per research task. Cap at 30-50 queries per agent per task and use the cache to maximize coverage per query dollar.