Monigatti describes context engineering as deciding which information from available sources enters an LLM’s context window. She argues that search tools power this selection, and traces the move from fixed RAG pipelines, which retrieve once, to agentic RAG, where an agent can choose whether and when to search again.
Agentic Search for Context Engineering
Speaker
Leonie Monigatti of Elastic explains how to choose and design search tools for agent context engineering at AI Engineer.
Search can fail when an agent skips retrieval, chooses the wrong tool, or supplies invalid parameters. Monigatti recommends clear tool descriptions that explain purpose, trigger conditions, and relationships between tools, with extra guidance in the system prompt when needed. More complex query tools may need error handling so agents can use returned errors to revise their queries.
A semantic search tool works for questions such as which sessions discuss regulatory constraints, but struggles with exact terms such as GPA and offers no metadata filters. Monigatti shows an Elasticsearch ESQL query tool, paired with a skill that supplies syntax guidance, handling keyword search and aggregations; for example, it counts 27 sessions on April 8. A shell tool can search local session files with commands such as grep, while a JinaGraph CLI helps with fuzzy semantic queries.
Monigatti recommends combining specialized tools that are easy to use with general-purpose tools that can handle unexpected questions. If query behavior is unknown, start with a general-purpose tool and log how the agent uses it; four or five calls per question may indicate the tool is too difficult, suggesting a more focused interface. In Q&A, she adds that stronger models reduce parameter errors but do not eliminate them.
Takeaways
- Treat search as a core part of context engineering: decide which sources and tools the agent can retrieve from.
- Describe when each tool should be used, and explain how tools relate to one another.
- Return tool errors in a way the agent can use to correct its query.
- Start with a general-purpose tool when user needs are uncertain, then build focused tools from logged behavior.
- Use search tools to calculate counts or other aggregates instead of asking the LLM to count a long list.
Mentioned in this talk
Search inside this talk
What was claimed 5
- works atLeonie Monigatti works at
Elastic
“I work at Elastic”
YouTube Verified2 sources· Talk, Web· archived
- built
Elastic built
Elasticsearch
“the company behind Elasticsearch”
YouTube Verified17 sources· Talk, GitHub, Job posting, Web· archived
- feature
LangChain: Includes a built-in shell tool and code samples for skill-loading tools
“The shell tool is built in, and it has code samples for skill-loading tools”
YouTube Unverified1 source· Talk
- feature
ES|QL: Pipe query language for filtering, transforming, and analyzing data
“a pipe query language for filtering, transforming, and analyzing data”
YouTube Unverified1 source· Talk
- featureJinaGraph: Supports classification and reranking; demo uses it for semantic search
“JinaGraph has many different modes. You can use it for classification or reranking”
YouTube Unverified1 source· Talk












