Type to search.

Context Engine APIs

Serverless Experimental

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.

Stack Planned

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Planned

    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.

Use the Context Engine APIs to manage AI indices, inspect their configuration, and query their Knowledge Indicators (KIs) with ES|QL. The Kibana API reference provides their complete parameters, request and response schemas, and errors.

Turn on the contextEngine:enabled advanced setting in each Kibana space where you want to use the APIs. Requests to a space where the setting is turned off return 404.

API requests use the permissions and space of the authenticated caller. Include the space in the request URL when you are not using the default space.

The caller also needs the read index privilege on each AI index's backing index (ai-index-*). Describing an AI index also requires the view_index_metadata privilege. AI indices without read are left out of list results, and query or describe requests return 403 when the caller lacks a required privilege.

The following operations are available:

Operation Endpoint
List AI indices GET /api/context_engine/ai_index
Create an AI index POST /api/context_engine/ai_index
Query AI indices POST /api/context_engine/ai_index/_query
Get an AI index GET /api/context_engine/ai_index/{aiIndexId}
Create or update an AI index PUT /api/context_engine/ai_index/{aiIndexId}
Delete an AI index DELETE /api/context_engine/ai_index/{aiIndexId}
Describe an AI index GET /api/context_engine/ai_index/{aiIndexId}/_describe

For task-oriented examples, refer to Create and manage AI indices, Add and manage sources, and Retrieve context from an AI index.