This is a cache of https://www.elastic.co/search-labs/blog/ai-agentic-workflows-elastic-ai-agent-builder. It is a snapshot of the page at 2025-09-24T01:01:23.285+0000.
Building AI Agentic workflows with Elasticsearch - Elasticsearch Labs

Building AI Agentic workflows with Elasticsearch

Learn about Agent Builder, a new AI layer in Elasticsearch that provides a framework for building AI agentic workflows, using hybrid search to provide agents with the context they need to reason and act.

Elasticsearch has native integrations with the industry-leading Gen AI tools and providers. Check out our webinars on going Beyond RAG Basics, or building prod-ready apps with the Elastic vector database.

To build the best search solutions for your use case, start a free cloud trial or try Elastic on your local machine now.

Here at Elastic, we’ve been bringing context to LLMs and conversational interfaces with AI Assistants, advanced RAG, and vector database improvements. Recently, with the rise of AI Agents, we’ve seen the need for relevant context grow, and learned that high-impact AI Agents need great search. So we built new native capabilities in the Elastic Stack designed to help develop AI Agents that leverage your data in Elasticsearch. We would like to share our progress in this journey and where we see it going next.

Agent Builder: A Foundation for Building Data-Driven AI Agents

The promise of an AI Agent is simple: give it an objective and it gets the job done. But for developers, the reality is a series of complex challenges. First, an agent is only as good as its perception of their environment and the tools they are given to achieve user objectives. Then, delivering the right context from a sea of diverse enterprise data is a massive challenge. Finally, all of this has to be orchestrated by a reliable reasoning loop that can plan, execute, and learn.

To solve this, developers need to build a complex and brittle stack from scratch. Today’s agent architecture requires you to stitch together multiple, disparate pieces: an LLM, a vector database, a metadata store, separate systems for logging and tracing, and some way to evaluate if it's all even working. This isn't just complex; it's costly, error-prone, and makes it difficult to build the high-quality, trustworthy AI systems your users demand.

So we want to make it simpler. To do this, our approach is to take the essential pieces of an effective context-driven agent and integrate them directly into the core of Elasticsearch with a new set of capabilities called Elastic AI Agent Builder. This new layer provides a framework with all the essential building blocks for creating AI Agents powered by Elasticsearch: an open set of primitives, standards‑based protocols, and secure access to data - so you can build agentic systems tailored to real-world data and requirements:

Delivering AI Experiences: this is the ultimate goal. With our Search AI Platform and your data as a foundation, you can build any type of generative AI application: from custom chat interfaces to integrations with agentic frameworks like LangChain or business applications like Salesforce.

Powered by Agents & Tools: on top of the platform, we expose a clean, simple layer of abstractions. You interact directly with Agents and Tools, which you can customize to fit your specific needs. You can also access the platform's capabilities through robust APIs and open standards like MCP and A2A.

Enabled by the Search AI Platform: this is the core engine where we've integrated the components. The advanced vector database, the agent logic, the query construction, security features, tracing for evaluation, all live here, managed and optimized by Elastic.

Unlocking the power of Your Data: the foundation of any great agent is great data. Our platform starts with the ability to ingest or federate access to all of your enterprise data

Agent Building in the Platform

Agent Builder, integrated into the Search AI Platform, provides a complete framework for agent development. It is built on five key pillars, each designed to address a critical aspect of building and deploying production-grade AI systems. Let's break down how agents define the objective, Tools provide the capabilities, Open Standards ensure interoperability, Evaluation delivers transparency, and Security provides the trust.

Agents

Agents are the highest-level building block in this new layer of Elasticsearch. An agent defines the objective to be achieved, the set of tools available for execution, and the data sources it can operate over. Agents are not limited to conversational interactions; they can power full workflows, task automation, or user-facing experiences.

When a query is directed to an agent, it follows a structured cycle:

  1. Interpret your input and objective
  2. Select the right tool and arguments for execution
  3. Reason over the tool’s response
  4. Decide whether to return a result or continue with further tool invocations

Elastic handles the orchestration, context, and execution of this cycle. Developers focus on defining what the agent should do: objectives, tools, and data, while the system manages how the reasoning and workflows are carried out.

The Default Agent

Our first agent built on this platform is a native conversational agent in Kibana, giving you the ability to immediately interact with your data. It provides a ready-to-use experience while remaining fully extensible and makes it possible to begin interacting with your data immediately, without additional configuration.

You can interact with this experience directly in Kibana through a new chat user experience or over API.

Querying the default agent through the API requires only a single call:

As conversations are stateful, you can continue interacting with an agent using a conversation_id , or retrieve the full conversation history:

Custom Agents

Developers can also create their own custom agents through simple APIs. Agents encapsulate instructions, tools and data access, creating tailored reasoning engines.

Creating a custom agent is as simple as making a single API call. The sample below shows an example, the “configuration” field holds all the key details, such as instructions or available tools:

Once created, the agent can be queried directly:

This approach transforms the agent from a complex system to build from scratch into a simple, declarative unit of business logic, allowing you to deliver intelligent automation faster.

Tools

If agents define what to accomplish, tools define how.

Tools expose specific Elastic core capabilities for agents to execute and retrieve information or perform an action. Tools can include core capabilities like get indexes, or get mappings, or more advanced capabilities like natural language to ES|QL.

Elasticsearch ships with a set of default tools optimized for common needs. But the real flexibility comes from creating your own. By defining tools, you decide exactly which queries, indices, and fields are exposed to an agent with ES|QL, giving you precise control over speed, accuracy, and security.

Registering a new tool is also as simple as a single API call. You could create a tool that leverages our ES|QL (Elasticsearch Query Language) to find news about a specific financial asset:

Once registered, you can assign the new tool to your custom agents, giving them a curated set of abilities to reason over and invoke whenever it’s the right fit.

We provide a platform to create custom tools for your specific needs e.g. with ES|QL that transforms the agent from a general-purpose agent into a domain-specific expert, grounded in your unique data and business domain.

Open Standards and Interoperability

Elasticsearch Agents and Tools are exposed via open standard APIs, making them easy to integrate as foundational blocks within the broader ecosystem of agentic frameworks. Our approach is simple: no black boxes. We want you to be able to take Elastic’s core strength in search and pair it with complementary capabilities and other agentic systems.

To make this possible, we are exposing our capabilities through APIs, emerging protocols and open standards.

Model Context Protocol (MCP)

Model Context Protocol (MCP) is quickly becoming the open standard for connecting tools across systems. By supporting MCP, Elasticsearch can connect conversational AI to your databases, indices, and external APIs. With a remote MCP server built into the Elastic Stack, any MCP-compatible client can access Elastic’s tools and use them as building blocks in your larger agentic workflows.

This isn’t a one-way street. You’ll also be able to import tools from external MCP servers and make them available inside Elasticsearch. Soon, MCP servers will likely be available for almost everything and be far more comprehensive than anything we would create ourselves. Elastic provides search and retrieval at scale, and you can combine that with specialized capabilities from other platforms to build effective agents.

Agent-to-Agent (A2A)

We’re also working on Agent-to-Agent (A2A) support. Where MCP is about connecting tools, A2A is all about connecting agents. With an A2A server, the Elastic agents you build will be able to talk directly with agents from other systems: sharing context, delegating tasks, and coordinating workflows.

Think of it as interoperability at the reasoning layer. Your Elastic agent could handle search and retrieval, then hand off a task to a specialized support or IT agent, and get the result back seamlessly. The result is an ecosystem of cooperating agents, each doing what they do best.

Ultimately, adopting MCP and A2A reinforces our commitment to Elasticsearch's role as a first-class citizen, ensuring open integration across the broader agentic ecosystem.

Tracing and Evaluation

As search integrates with agents, the challenge of effective evaluation becomes critical. To confidently deploy agents in real-world enterprise settings, you need assurance that they are not only accurate but also efficient and reliable. How do you measure performance, diagnose a bad response, or improve the baseline? It all starts with visibility.

This is why we’ve designed our agent APIs for transparency from the ground up. Consider this simple agent interaction:

The response includes not just the final answer, but the complete execution trace, detailing which tools the agent selected, the parameters it used, and the results from each step.

Comprehensive tracing and logging are essential for a continuous improvement loop, and soon, you’ll be able to store and view these agent traces directly in Elasticsearch. Better yet, these traces are built on the OpenTelemetry protocol, ensuring they are standardized and portable for integration with the observability platform of your choice.

This level of detail is the foundation for a true continuous improvement loop. It empowers you to build a comprehensive suite of tests, debug failures, identify failure modes to prevent regressions, and capture successful patterns to fine-tune performance. Ultimately, this data-driven approach is the key to transforming a promising prototype into a production-grade, trustworthy AI system.

Security

As agents and tools become more capable, security isn’t optional - it’s foundational. Exposing APIs, automating tasks, and workflows require enterprise systems to be trusted. Especially as Agents begin to automate more workflows, the ability to secure these and ensure they meet enterprise requirements is essential.

The capabilities above all inherit the controls already available in Elastic today, including role-based access control (RBAC) for API calls and API key management. We’re also extending the same controls to new protocols like MCP. That means support for standards such as OAuth, as well as the ability to plug in custom authentication mechanisms.

Our goal is to get you the flexibility to experiment with agents and tools, while maintaining the level of security, compliance, and governance your organization demands.

What Comes Next

We’re not just adding features; we are expanding Elasticsearch for agentic context engineering. We plan to develop going forward based on these principles:

1. Commitment to Open Source & Standards

Our commitment to open source and open standards, ensures that these capabilities remain interoperable with external agentic frameworks. You will always be able to connect, extend, and compose agents across your ecosystem while keeping your data and workflows under your control.

2. Value of Context

An AI Agent's context is its greatest asset. Managing the context as agents perform searches and workflow operations can be a challenging task. We are leveraging Elastic’s core strengths to solve context engineering, ensuring that the most relevant information is always available for your agent.

3. Focus on Agentic Data Streams

Going forward, agents will be a larger and larger source of data, including the output of agents (generated documents, reports, visualizations) and the execution trace of agents (their thinking, tool calls, memory/context). Elastic is well-suited for handling this type of data, and we are working on research around performing analytics, evaluation, and automated improvement using this data.

4. Security and Safety by Design

AI Agents introduce a whole new set of security and safety challenges. Elastic has always been a leader for secure solutions, and we continue to build in enterprise-grade guardrails, access controls, and "zero-trust" principles.

5. Embedded in the Platform

The capabilities for building AI Agents are embedded in the Elasticsearch platform. This means that platform-level capabilities like tracing, evaluation, visualization, and analysis are all applicable to agents. Want to develop dashboards based on agent executions - that's built in. Want to evaluate the AI Agent performance using sentiment analysis - the platform enables that. This gives the ability to build a complete lifecycle around your AI experiences.

Elastic’s goal is to give you the interfaces to build conversational AI and automated workflows that are fully integrated, extensible, and grounded in your data. More technical details and progress will be shared soon.

Agent Builder is available now in private preview. Connect with us to request access. Have questions or feedback? Connect with our developer community in our Slack workspace or on our discussion forum.

Related content

Ready to build state of the art search experiences?

Sufficiently advanced search isn’t achieved with the efforts of one. Elasticsearch is powered by data scientists, ML ops, engineers, and many more who are just as passionate about search as your are. Let’s connect and work together to build the magical search experience that will get you the results you want.

Try it yourself