Get an AI Index Experimental

GET /api/context_engine/ai_index/{aiIndexId}

Spaces method and path for this operation:

get /s/{space_id}/api/context_engine/ai_index/{aiIndexId}

Refer to Spaces for more information.

Fetches an AI Index by ID from the current space, including the ES|QL query derived from each trace.

Returns a 404 response when Context Engine is turned off in this space (contextEngine:enabled).

For more information, refer to the Context Engine documentation.

[Required authorization] Route required privileges: contextEngine:read.

Path parameters

  • aiIndexId string Required

    The unique identifier of the AI Index.

    Minimum length is 1, maximum length is 256.

Responses

  • 200 application/json

    The requested AI Index.

    Hide response attributes Show response attributes object
    • automations array[object] Required

      Automations associated with the AI Index.

      Hide automations attributes Show automations attributes object
      • type string Required

        Value is workflow.

      • value string Required

        The workflow ID.

    • date_created string Required

      ISO 8601 timestamp of when the AI Index was created.

    • date_modified string Required

      ISO 8601 timestamp of when the AI Index was last modified.

    • description string

      Human-readable description of the AI Index.

    • dest object Required

      The data stream or index that backs the AI Index.

      Additional properties are NOT allowed.

      Hide dest attributes Show dest attributes object
      • type string Required

        The type of the backing store.

        Values are data_stream or index.

      • value string Required

        The data stream or index the AI Index is attached to.

    • feedback_analysis object

      The recurring feedback analysis, which reads agent signals and proposes improvement actions for the AI Index.

      Additional properties are NOT allowed.

      Hide feedback_analysis attributes Show feedback_analysis attributes object
      • agent_id string

        Agent Builder agent ID that runs the analysis.

      • allowed_actions array[string]

        Improvement actions the analysis may propose.

        Values are add_ki, edit_ki, remove_ki, add_workflow, edit_workflow, remove_workflow, add_source, edit_source, or remove_source.

      • enabled boolean Required

        Whether the recurring feedback analysis is desired to run.

      • schedule object

        When the analysis runs.

        Additional properties are NOT allowed.

        Hide schedule attribute Show schedule attribute object
        • interval string Required

          How often to analyze, for example 1h.

      • signal_filter string

        KQL narrowing which signals the analysis reads.

      • signal_time_range object
        Any of:
    • id string Required

      The unique identifier of the AI Index.

    • managed boolean Required

      Whether the AI Index is managed by a plugin and therefore immutable.

    • memory_enabled boolean Required

      Whether this AI Index accepts memory writes.

    • sources array[object] Required

      Additional sources that provide context for the AI Index.

      Hide sources attributes Show sources attributes object
      • type string Required

        esql for an ES|QL query, or connector for a data connector.

        Values are esql or connector.

      • value string Required

        An ES|QL query for esql, or a connector ID for connector.

    • traces array[object] Required

      Trace sources linked to this AI Index, each with its derived ES|QL query.

      Hide traces attributes Show traces attributes object
      • query string Required

        The ES|QL query derived from this trace source at read time.

      • type string Required

        elastic_agent for an Agent Builder agent, index for an index or data stream name or pattern, or esql for an ES|QL query.

        Values are elastic_agent, index, or esql.

      • value string Required

        The trace source value.

  • 404 application/json

    No AI Index with the given ID exists in the current space, or Context Engine is turned off in this space.

    Hide response attributes Show response attributes object
    • error string

      The HTTP status text.

    • message string Required

      A human-readable error message.

    • statusCode number

      The HTTP status code.

GET /api/context_engine/ai_index/{aiIndexId}
curl \
  -X GET "https://${KIBANA_URL}/api/context_engine/ai_index/customer_support" \
  -H "Authorization: ApiKey ${API_KEY}"
GET kbn:/api/context_engine/ai_index/customer_support
Response examples (200)
Example response returning an AI Index by ID
{
  "automations": [
    {
      "type": "workflow",
      "value": "8f1c2d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f"
    }
  ],
  "date_created": "2026-09-22T12:00:00.000Z",
  "date_modified": "2026-09-22T12:00:00.000Z",
  "description": "Knowledge about customer support cases.",
  "dest": {
    "type": "data_stream",
    "value": "ai-index-ds-customer-support"
  },
  "id": "customer_support",
  "managed": false,
  "memory_enabled": true,
  "sources": [
    {
      "type": "esql",
      "value": "FROM support-cases | LIMIT 100"
    }
  ],
  "traces": [
    {
      "query": "FROM traces-agent_builder.otel-default\n| WHERE attributes.gen_ai.agent.id IN (\"elastic-ai-agent\")",
      "type": "elastic_agent",
      "value": "elastic-ai-agent"
    }
  ]
}
Response examples (404)
Context Engine is turned off in this space
{
  "error": "Not Found",
  "message": "Not Found",
  "statusCode": 404
}
No AI Index with the given ID exists in the current space
{
  "error": "Not Found",
  "message": "AI index 'customer_support' not found",
  "statusCode": 404
}