Configure agents to use an AI index
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is experimental and is not ready for production usage. Experimental features may change or be removed at any time. Elastic will work to fix any issues, but experimental features are not subject to the support SLA of official GA features. Specific Support terms apply. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability We plan to add this functionality in a future Elastic Stack update. Subject to changes. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Experimental
Experimental
Stack
Planned
Planned
This page is currently hidden from the documentation navigation.
The following Context Engine pages are live:
An agent that retrieves context from an AI index might also need tools and permissions to query source data when a Knowledge Indicator (KI) points to current details. This page explains how to provide that access, tell the agent when to use the AI index, and test the integration. For the list, describe, and query sequence itself, refer to Retrieve context from an AI index.
For implementation steps, follow the guide for Elastic Agent Builder, LangChain and LangGraph, or Claude Code.
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability Experimental This functionality is experimental and is not ready for production usage. Experimental features may change or be removed at any time. Elastic will work to fix any issues, but experimental features are not subject to the support SLA of official GA features. Specific Support terms apply. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. To connect Claude on the web or desktop to Elastic Agent Builder tools over MCP, use the Elastic Cloud Serverless connector for Claude. The connector is a separate access path from the Claude Code skill and Elastic CLI.
Access to an AI index and access to its source data are separate. Provide the agent with both the Context Engine retrieval operations and any tools and permissions it needs to query the source.
The agent only discovers AI indices that its credentials can read in the current Kibana space. A retrieved KI can answer a question directly or provide tested guidance for retrieving current details from source data.
The AI index name and description help the agent decide whether its KIs are relevant. Write them around the subject and questions the AI index supports, rather than the implementation that produced it.
Agent instructions can further define when to use the context, when to query source data, and how to communicate source limitations. Keep these instructions specific to the agent's task. When the integration already provides retrieval instructions, such as the ki-retrieval skill in Elastic Agent Builder, you do not need to repeat how to list, describe, and query AI indices.
Elastic Agent Builder also includes Context Engine skills for planning AI indices, configuring sources and automations, evaluating retrieval results, and retrieving KIs. These skills support Context Engine work, but they do not replace the AI index assignment or the tools required to access source data.
Test the agent with questions that exercise both paths:
- Ask a recurring question that a KI should answer directly.
- Ask for current or detailed information that requires the agent to follow the KI's guidance and query the source.
- Ask an out-of-scope question to confirm that the agent recognizes the AI index's limits.
Inspect the agent's tool calls to confirm that it selected the expected AI index, retrieved a relevant KI, and queried source data only when needed. If the generated context is incomplete or misleading, evaluate and improve the KIs instead of compensating with increasingly detailed agent instructions.
Across a representative set of questions, compare response quality, tool calls, source queries, latency, and model token use. Repeated or related questions are especially useful because they show whether the AI index prevents agents from rediscovering the same information.
For common access and retrieval failures, refer to Troubleshoot retrieval.