Back to issue
skim55 min

Stop AI Agent Hallucinations: 5 Techniques + Production Patterns - Elizabeth Fuentes, AWS

Elizabeth Fuentes (AWS) · AI Engineer

Five techniques for reducing agent hallucinations that live in code, not prompts — which is exactly the right place for them. Fuentes demos each one: semantic tool selection via vector search, GraphRAG for queries plain RAG botches, a validator/critic agent chain, and business rules enforced as hooks that intercept tool calls so they can't be talked around. The final third is AWS product material; the first 50 minutes are transferable to any stack.

  • Filtering tools with vector search before sending them to the model cuts token consumption from ~3,000 to ~300 per call — and swap_tools keeps long conversations lean.
  • GraphRAG beats traditional RAG on aggregations, counts, and multi-hop reasoning because Cypher queries return computed results instead of text samples.
  • Business rules as code-level hooks that intercept tool calls are unbreakable; the same rules as prompt instructions are merely suggestions.
  • Runtime guardrails can steer instead of block: the agent self-corrects and completes the task (e.g. splitting a 60-guest booking across rooms) rather than failing outright.
Watch on YouTube

Part of Issue Nº 001: LLMs for judgment, code for counting: scaling to 500K sensors on 300x fewer tokens