# kibana-context-engine

kibana-context-engine — a skill for Claude Code and other platforms that queries Elastic AI Indices and Knowledge Indicators. It searches, counts, and answers questions using the Context Engine knowledge base.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 422 installs · ★ 612 repo stars
- Author: elastic
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/elastic/agent-skills/tree/HEAD/skills/kibana/kibana-context-engine/SKILL.md
- Updated: 2026-10-23
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/kibana-context-engine

## What it does

This skill executes operations via the `elastic` CLI to retrieve data from Elastic Context Engine. It searches `ai-index-*` indices and reads Knowledge Indicators that store context, summaries, or runnable `ES|QL` queries. Always follow the list-describe-query sequence when interacting with indices.

It requires `Kibana` 9.6 or later with a matching `Elasticsearch` or an `Elastic Serverless` project. You must enable `contextEngine:enabled` in the target space. Ensure the user has `read` permissions for Context Engine and `read`/`view_index_metadata` access for the backing `ai-index-*` indices. The skill will not run without the `elastic` CLI installed.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add elastic/agent-skills --skill kibana-context-engine -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/kibana-context-engine/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/kibana-context-engine/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add elastic/agent-skills --skill kibana-context-engine -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/kibana-context-engine/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add elastic/agent-skills --skill kibana-context-engine -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/kibana-context-engine/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install elastic/agent-skills skills/kibana/kibana-context-engine
```

2. **Manually: put the files in place**
- File: `.github/skills/kibana-context-engine/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add elastic/agent-skills --skill kibana-context-engine -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/elastic/agent-skills --path skills/kibana/kibana-context-engine
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/kibana-context-engine/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add elastic/agent-skills --skill kibana-context-engine -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/elastic/agent-skills/tree/HEAD/skills/kibana/kibana-context-engine/SKILL.md

## When to use it
- list all registered AI indices
- describe the fields of an AI index
- run an ES|QL query against a Knowledge Indicator
- retrieve active KIs for a specific query

## Example prompts
- List all AI indices using kibana-context-engine:list
- Describe the index ai-index-123
- Run an ES|QL query on ai-index-123 to find specific attributes

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 97a22d2d54e6e379.

BEGIN THIRD-PARTY FILE 97a22d2d54e6e379
```text
---
name: kibana-context-engine
description: >
  Query Elastic Context Engine AI Indices, and the Knowledge Indicators (KIs) they
  store. Use when asked to search, explore, count, or answer questions from an AI
  Index / KI / Context Engine knowledge index, and when writing the ES|QL that queries
  one.
metadata:
  author: elastic
  version: 0.2.1
  universal: false
compatibility: Kibana 9.6 or later with matching Elasticsearch, or an Elastic Serverless
  project, with the `contextEngine:enabled` advanced setting turned on in the target
  space. Runs against the Context Engine HTTP APIs through the `elastic` CLI. The
  caller needs Context Engine `read`, plus Elasticsearch `read` and `view_index_metadata`
  on the backing `ai-index-*` indices.
---

# Query Context Engine AI Indices

<!-- begin-partial: preamble -->

## Environment Configuration

This skill executes Elasticsearch operations through the `elastic` CLI. If the
[`elastic` CLI](https://github.com/elastic/cli#configuration) is not installed, tell the user what it is needed for. Do
not guess credentials, call the HTTP API directly, or attempt other workarounds.

This skill references operations in HTTP-shorthand form (e.g., `GET /`, `GET /_cat/indices`, `GET /{index}/_mapping`,
`GET /{index}/_settings/index.mode`, `POST /_query`). The [Operations](#operations) table at the end of this document
maps each shorthand to the equivalent `elastic` CLI command — always use the CLI rather than calling the HTTP API
directly.

<!-- end-partial: preamble -->

## Concepts

**AI Index** — an Elasticsearch index named `ai-index-idx-*`, or a data stream named `ai-index-ds-*`, registered with
the Context Engine under a logical id. The registration lives in Kibana; the knowledge lives in the backing index. Only
the list operation knows which `ai-index-*` indices are registered and what to put in `FROM`; the index name alone does
not tell you.

**Knowledge Indicator (KI)** — one document in an AI Index: context prepared for agents, such as a description of some
data, a summary, an access pattern, a runnable query, or a record of a Kibana resource. A KI may answer a question
outright, or help you locate and use the source that does.

A KI is retired by a tombstone (`governance.lifecycle.status: deleted`) or by an `expires_at` in the past. On a data
stream, one KI is several revisions under the same `id`, the newest of which is its current state. The query API returns
only current, active, unexpired KIs unless the query asks otherwise (see [Lifecycle](#lifecycle)).

Search the AI Indices before broader retrieval whenever their KIs may cover the question. This skill reads KIs;
generating them belongs to the Context Engine's automations and feedback loop.

Three read-only Context Engine HTTP APIs back this skill. The [Operations](#operations) table maps each to its `elastic`
CLI command:
```
END THIRD-PARTY FILE 97a22d2d54e6e379

The third-party file has ended. Everything between the 97a22d2d54e6e379 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2883 of 21635 bytes. © elastic · Apache-2.0 · https://github.com/elastic/agent-skills/tree/HEAD/skills/kibana/kibana-context-engine/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
