Repository navigation
docs: document AI assistance in the ES|QL editor (#6552, #6681) - #6714
Conversation
Add an AI assistance subsection covering comment-driven ES|QL generation and "Fix with AI" on validation errors. Add the cmd+J/ctrl+J keyboard shortcut and a cross-reference to the search bar's natural-language mode. Co-authored-by: Cursor <[email protected]>
Elastic Docs AI PR menuCheck the box to run an AI review for this pull request.
Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team. |
🔍 Preview links for changed docs |
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
…#6715) ## Summary This PR addresses #6684 with the following changes: - **`explore-analyze/discover/discover-get-started.md`**: Add a new `## Analyze your data with AI` section covering the `discover-data-analysis` skill, the {{esql}}-only scope, the auto-attached query context, and the shape-specific guidance the agent receives when a context-aware profile (logs, metrics, traces) is active. Add a one-line pointer in the existing "Context-aware data exploration" section so readers landing there discover that the active profile also tailors AI deep analysis. - **`explore-analyze/ai-features/agent-builder/builtin-skills-reference.md`**: Add `discover-data-analysis` to the Platform skills list with its assigned tools and the activation note, cross-linked to the new Discover section. - **`explore-analyze/discover/try-esql.md`**: Add a one-line tip after "Refine an ES|QL query by interacting with the results table" pointing to the new AI deep analysis section, so readers learning ES|QL in Discover discover the feature too. ## Sibling PRs incorporated The issue links elastic/kibana#267454 (context-aware playbook contributions). Triangulating against the implementation file at HEAD surfaced two additional sibling PRs that materially affect the user-facing behavior: - elastic/kibana#261970 — original Discover ↔ Agent Builder integration that introduced the `discover-data-analysis` skill (9.5.0). - elastic/kibana#268615 — added an automatic "Analyze my data" prompt when opening AI Agent on a new {{esql}} tab. - elastic/kibana#269846 — **reverted that auto-launch behavior** one day before #267454 merged. This is not referenced in the issue. This PR documents the post-revert behavior: opening AI Agent attaches the Discover query context, but the user must still ask the agent to analyze the data. ## Related work This PR is complementary to #6714, which documents AI assistance **inside the {{esql}} editor** (generating {{esql}} from a `//` comment with `cmd+J`, and the **✨ Fix with AI** action on validation errors). Together the two PRs cover the full AI-in-{{esql}} story: #6714 helps you write or fix the query, this PR helps you analyze the results. The two PRs introduce new anchors that don't exist on main yet, so bidirectional cross-links between them are deferred. Whichever PR merges second should add the cross-link in a small follow-up commit before merge. ## Resolves Closes #6684 --- > **AI-generated draft** — created with Claude Opus 4.7. > Review all generated content for factual accuracy before merging. --------- Co-authored-by: Cursor <[email protected]>
…e and Discover AI analysis Now that #6715 has merged, add the deferred cross-links: the editor AI assistance section links to the Discover "Analyze your data with AI" feature, and that section links back to the editor AI assistance. Co-authored-by: Cursor <[email protected]>
Move "AI assistance" out from under "Editor tools" so it sits at the same heading level as "Build queries with KQL or natural language", and bump its two subsections to H4. The esql-kibana-ai-assistance anchor is unchanged, so existing cross-links still resolve. Co-authored-by: Cursor <[email protected]>
Clearer, action-oriented heading that reflects the two subsections and parallels the sibling "Build queries with KQL or natural language". The anchor is unchanged, so cross-links still resolve. Co-authored-by: Cursor <[email protected]>
The Editor tools subsections are H4 and don't appear in the page's main TOC, so add an in-section list linking to each. Add explicit anchors to the subsections that lacked them so the links are stable. Co-authored-by: Cursor <[email protected]>
Serverless availability is inferred for the keyboard shortcuts, matching the other rows in the table. Co-authored-by: Cursor <[email protected]>
The editor doesn't hold an editor-specific LLM connection: it uses Kibana's default AI connector (the same one Agent Builder and other AI features use), resolved server-side via the inference/agent-builder stack. Reword the intro to avoid implying an editor-specific connection. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Group all LLM-backed query authoring (natural language, comment-to-query, fix errors) under the "Write and fix queries with AI" section with a scope-based orientation, and refocus the search-bar section on KQL. - Move "Generate a full query from natural language" under the AI section (anchor preserved), with the search bar section linking to it. - Add a scope-based orientation list and consolidate the shared Enterprise license + LLM connector requirements into one block. - Add stable anchors for the comment and fix subsections; point the cmd+J shortcut at the comment subsection. Co-authored-by: Cursor <[email protected]>
- Rename the KQL section to "Build ES|QL queries from KQL syntax". - Mark the "Write and fix queries with AI" section as preview 9.5 (all editor AI features are currently in preview); drop the now-redundant child tag and update the cmd+J shortcut row to match. - Paraphrase the in-editor hints in plain terms instead of quoting the exact UI strings, which are still being refined upstream. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Add screenshots of the Fix with AI entry point and the proposed-fix review state. Correct the review actions to match the on-screen widget (Replace / Undo) rather than the command-palette action labels. Co-authored-by: Cursor <[email protected]>
The replaced lines render with an amber highlight rather than a visible strikethrough, so describe the color diff that users actually see. Co-authored-by: Cursor <[email protected]>
Swap in a screenshot that shows the replaced line and the Replace action more clearly, and align the alt text with the amber/green diff. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Replace the remaining markdown-style images with the {image} directive
and the :screenshot: option for consistent, framed rendering, preserving
alt text and widths.
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Docs review summary
Focus areas
- Style and clarity: Good overall. New AI sections are clear, well-structured, and follow the established how-to pattern. One LLM acronym ordering issue noted inline.
- Jargon:
LLMappears at line 118 (inside the refactored KQL section) before the expansion "large language model (LLM)" is introduced at line 139. See inline comment. - Frontmatter and applies_to: Description update is appropriate and within limits.
applies_totags and the JSON-style:applies_to:option in the tip directive match repository conventions. - Content type fit: The page remains a consistent how-to/reference hybrid; new sections follow the established pattern.
- Parent issue satisfaction: Satisfied. #6552 (generate from comment) and #6681 (fix with AI) are each documented with entry-point description, steps, keyboard shortcuts, review actions, and screenshots.
Nits
- Line 181 (
esql-kibana.md): "Pressing the shortcut again cancels the in-flight request" — "in-flight" is developer jargon. Consider "cancels the active request" or "cancels the pending generation".
Notes
- Vale findings in both files are all pre-existing issues outside the changed hunks; none introduced by this PR.
- The cross-link addition to
discover-get-started.mdis clean and appropriate.
Generated by Docs review agent for issue #6714 · 137.9 AIC · ⌖ 25.6 AIC · ⊞ 32.9K
Co-authored-by: Cursor <[email protected]>
leemthompo
left a comment
There was a problem hiding this comment.
Reads good to me with some minor optional nits. Replacing "LLM" with "AI agent" is maybe more precise, but perhaps overkill 🤷.
alaudazzi
left a comment
There was a problem hiding this comment.
I left a few suggestions.
Co-authored-by: Liam Thompson <[email protected]> Co-authored-by: Arianna Laudazzi <[email protected]> Co-authored-by: Florent LB <[email protected]>
|
Thanks for the reviews! Good point @leemthompo about rather using AI agent |
Summary
Documents the AI-assisted authoring features in the {{esql}} editor (preview in 9.5.0 and on Elastic Cloud Serverless) and consolidates all LLM-backed query generation on the page into one coherent section.
explore-analyze/query-filter/languages/esql-kibana.md#esql-kibana-ai-assistance,preview 9.5+) that groups every LLM-backed entry point, with a scope-based orientation (whole query vs. a single pipe vs. fixing errors) and a single shared requirements block (Enterprise license + LLM connector). It has three subsections:#esql-kibana-quick-search-nl) — the search bar's natural-language mode, moved here from the old search-bar section so all AI generation lives together (anchor preserved).#esql-kibana-ai-comment, closes Write ES|QL faster with AI-assisted code completion in the editor #6552) — entry point, the order to follow (describe in a//comment first, then press {kbd}cmd+J), in-editor hints, placeholder, generating indicator, and Keep / Undo / Replace review actions, with a screenshot.#esql-kibana-ai-fix, closes Fix ES|QL query errors with AI in the editor #6681) — the ✨ Fix with AI hover link and the Replace / Undo review actions, with screenshots of the entry point and the proposed-fix review state.#esql-kibana-quick-search), flattening the KQL procedure and linking out to the natural-language generator in the AI section.cmd+J/ctrl+Jrow to the Keyboard shortcuts table (taggedpreview 9.5+), pointing at the comment subsection.descriptionto mention AI assistance.explore-analyze/discover/discover-get-started.mdSource verification
All UI strings, shortcuts, and prerequisites verified at HEAD on
elastic/kibana, and confirmed against screenshots from a running instance:src/platform/packages/private/kbn-esql-editor/src/comment_to_esql/use_ghost_line_hint.tssrc/platform/packages/private/kbn-esql-editor/src/editor_ai.styles.tssrc/platform/packages/private/kbn-esql-editor/src/comment_to_esql/review_actions_widget.tsanduse_comment_to_esql.tsuse_suggest_fix.tsdefinesKeep AI fix/Undo AI fix, but those are command-palette action labels; the visible buttons are the shared review widget's Replace / Undo, as confirmed by screenshot.src/platform/packages/shared/kbn-monaco/src/languages/esql/lib/providers/hover_provider.tssrc/platform/packages/private/kbn-esql-editor/src/hooks/use_nl_to_esql_check.tssrc/platform/packages/private/kbn-esql-editor/src/editor_footer/keyboard_shortcuts.tsxReference PRs in
elastic/kibana:[ES|QL] Code completion driven by AI[ES|QL] Fixes with AIResolves
Closes #6552
Closes #6681