Why Your Agent Still Needs Retrieval - Carly Richmond, Elastic
Do agents still need retrieval? Carly Richmond, developer advocate lead at Elastic, argues they do. Without retrieval, an agent can only answer from what its model learned in training. That knowledge stops at a cutoff date and carries the biases of its data. It was also shaped by evaluations that reward a confident guess over admitting uncertainty. Retrieval puts the right information in front of the model before it answers, and you'll learn when and how to use each approach. Carly uses a Mastra agent that answers questions about sci-fi movies as an example. Vector search finds results by meaning, so a query for Han Solo lands close to Luke and Leia. Lexical search matches exact terms, which still makes it the better fit for things like company names. Agentic RAG turns retrieval into a tool, so the agent decides when to look something up. Re-ranking reorders the results you already have, using reciprocal rank fusion, weighted scores, or a dedicated reranker model. One thing that trips agents up is the tool description. If it's vague, the agent calls no tool, the wrong one, or the right one with the wrong parameters. The demo runs on the Elasticsearch vector store Elastic contributed to Mastra, and she checks relevance with a scorer in Mastra Studio. The Q&A gets into near-duplicate documents at scale and handling misspellings. Recorded at the TypeScript AI Conference in London, July 23, 2026, presented by Mastra. 🔗 MENTIONED IN THIS TALK Elastic: https://www.elastic.co Elasticsearch vector store in Mastra: https://mastra.ai/reference/vectors/elasticsearch Build a RAG agent with Mastra and Elasticsearch: https://mastra.ai/blog/build-rag-agent-mastra-elasticsearch Demo code: https://github.com/elastic/mastra-elasticsearch-example Why Language Models Hallucinate: https://arxiv.org/abs/2509.04664 Jina rerankers on Elastic: https://www.elastic.co/jina-search-models Mastra scorers: https://mastra.ai/docs/evals/overview 📚 MASTRA RESOURCES https://mastra.ai https://x.com/mastra_ai https://mastra.ai/community/discord https://github.com/mastra-ai Learn Mastra: https://mastra.ai/learn https://mastra.ai/books/principles-of-building-ai-agents https://mastra.ai/books/patterns-of-building-ai-agents WHAT IS MASTRA Mastra is an open-source TypeScript framework designed for building and shipping AI-powered applications and agents with minimal friction. It supports the full lifecycle of agent development — from prototype to production. CHAPTERS 00:00 Intro 00:56 Context engineering 02:30 Why LLMs give iffy answers 04:30 RAG as a fixed pipeline 05:12 Vector search and lexical search 06:33 The Elasticsearch vector store in Mastra 08:39 Agentic RAG: retrieval as a tool 10:24 When the agent calls the wrong tool 11:31 Writing tool descriptions like prompts 12:52 Relevance and re-ranking 15:48 Relevancy scoring in Mastra Studio 17:27 Q&A: near-duplicate documents 19:10 Q&A: misspellings 19:59 Q&A: clustering and candidate counts