[Agent Builder] Adds GenAI Settings UI for managing installation of documentation#245749
[Agent Builder] Adds GenAI Settings UI for managing installation of documentation#245749spong merged 9 commits intoelastic:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new "Documentation" section to the GenAI Settings page, enabling users to manage installation of documentation assets (Elastic Documentation and Security Labs content) that enhance Agent Builder responses. The implementation includes client-side React hooks for product documentation management and UI components for displaying installation status and actions.
Key changes:
- Added client hooks (
useProductDocStatus,useInstallProductDoc,useUninstallProductDoc) to theproduct_doc_baseplugin for managing documentation installation - Created a new Documentation section UI with install/uninstall capabilities in the GenAI Settings page
- Added
llm_product_docprivilege to the OneChat feature for direct API access
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
x-pack/platform/plugins/shared/onechat/server/features.ts |
Added llm_product_doc privilege to OneChat feature permissions |
x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/hooks/use_product_doc_status.ts |
New hook for fetching product documentation installation status with auto-polling |
x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/hooks/use_install_product_doc.ts |
New hook for installing product documentation with query invalidation |
x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/hooks/use_uninstall_product_doc.ts |
New hook for uninstalling product documentation with query invalidation |
x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/hooks/index.ts |
Exports for the new product documentation hooks |
x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/hooks/constants.ts |
React Query keys for product documentation operations |
x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/index.ts |
Exports new hooks from product_doc_base plugin public API |
x-pack/platform/plugins/private/gen_ai_settings/public/components/documentation/documentation_section.tsx |
Main UI component for the Documentation section with installation management |
x-pack/platform/plugins/private/gen_ai_settings/public/components/documentation/types.ts |
Type definitions for documentation items and status |
x-pack/platform/plugins/private/gen_ai_settings/public/components/documentation/translations.ts |
i18n translations for the Documentation section |
x-pack/platform/plugins/private/gen_ai_settings/public/components/documentation/index.ts |
Exports DocumentationSection component |
x-pack/platform/plugins/private/gen_ai_settings/public/components/gen_ai_settings_app.tsx |
Integrated Documentation section into the GenAI Settings page |
x-pack/platform/plugins/private/gen_ai_settings/public/plugin.ts |
Added productDocBase dependency to plugin start dependencies |
Configuration files (tsconfig.json, moon.yml, kibana.jsonc, limits.yml) |
Updated dependencies and bundle size limits |
x-pack/platform/plugins/private/gen_ai_settings/public/components/documentation/documentation_section.test.tsx |
Unit tests for Documentation section component |
Comments suppressed due to low confidence (1)
x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/hooks/use_product_doc_status.ts:1
- Corrected capitalization of 'Tech Preview' to 'TECH PREVIEW' to match the translation constant.
/*
| // Check if product documentation is installed | ||
| const isAvailable = await isProductDocAvailable(llmTasks); | ||
| if (!isAvailable) { | ||
| // Build the full settings URL using the request's base path (includes space prefix) | ||
| const basePath = coreSetup.http.basePath.get(request); | ||
| const settingsUrl = `${basePath}${GENAI_SETTINGS_APP_PATH}`; | ||
|
|
||
| return { | ||
| results: [ | ||
| createErrorResult({ | ||
| message: `Product documentation is not installed. To use this tool, please install Elastic documentation from the GenAI Settings page: ${settingsUrl}. Do not perform any other tool calls, and provide the user with a link to install the documentation.`, | ||
| metadata: { | ||
| settingsUrl, | ||
| }, | ||
| }), | ||
| ], | ||
| }; | ||
| } | ||
|
|
There was a problem hiding this comment.
@pgayvallet @sorenlouv @yuliia-fryshko
Now the tool is always available, and will link the user off to the settings page to install the docs if not yet installed:
… for now, and remove tech preview
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
History
cc @spong |
…ocumentation (elastic#245749) ## Summary This PR adds a new `Documentation` section to the `GenAI Settings` page for managing the installation of documentation assets like the [Elastic Documentation](https://www.elastic.co/docs/reference/kibana/configuration-reference/ai-assistant-settings) used by the [Product Docs Platform Tool](elastic#242598) and the Security Labs content used by the `security.security_labs_search` tool Design issue: elastic/ai-enhancements#77 <p align="center"> <img width="700" src="https://github.com/user-attachments/assets/46d7805e-5ef1-4213-8ec9-25875a4f039d" /> </p> > [!NOTE] > Security Labs content is not yet served up by the product docs CDN, so it is currently a disabled placeholder until I work elastic#244946 next. We can hide this item for now if that is preferred. ### Implementation notes * The `product_docs` API's are called directly from the client instead of plumbing a new AB API. In support of this, the `llm_product_doc` privilege was added to the `ONECHAT_FEATURE_ID`. If this is not desired, we can remove this addition and plumb a dedicated API. * This UI section should be conditionally visible based on if the Agent Builder experience is enabled/feature is available. ~I need to confirm, but I believe this is coming in elastic#244532 This functionality has been added. * Client hooks for managing product docs were added to `/ai_infra/product_doc_base` instead of `gen_ai_settings`. I originally had them in the setting public code, but figured they made more sense alongside the product docs. Happy to change is there is preference here. * As previously discussed, we're only supporting installing ELSER embeddings at the moment. ~We'll probably want to update the Platform Docs tool do instruct the model to do query re-writing to english in support of this.~ This is done in: elastic#245259 * This uses the same product docs API as the O11y/Security Assistants, so there is no compatibility issues when switching the AB experience on/off or using the old assistants. * RBAC support provided such that documentation management actions are disabled unless the user has `agentBuilder['all']` Kibana feature privileges. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [X] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [X] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [X] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) _PR developed with Cursor + Opus 4.5_ --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>

Summary
This PR adds a new
Documentationsection to theGenAI Settingspage for managing the installation of documentation assets like the Elastic Documentation used by the Product Docs Platform Tool and the Security Labs content used by thesecurity.security_labs_searchtoolDesign issue: https://github.com/elastic/ai-enhancements/issues/77
Note
Security Labs content is not yet served up by the product docs CDN, so it is currently a disabled placeholder until I work #244946 next. We can hide this item for now if that is preferred.
Implementation notes
product_docsAPI's are called directly from the client instead of plumbing a new AB API. In support of this, thellm_product_docprivilege was added to theONECHAT_FEATURE_ID. If this is not desired, we can remove this addition and plumb a dedicated API.I need to confirm, but I believe this is coming in [ML] Agent Builder: Opt-in flow #244532.This functionality has been added./ai_infra/product_doc_baseinstead ofgen_ai_settings. I originally had them in the setting public code, but figured they made more sense alongside the product docs. Happy to change is there is preference here.We'll probably want to update the Platform Docs tool do instruct the model to do query re-writing to english in support of this.This is done in: [Agent Builder] Adds Integration Knowledge platform tool #245259agentBuilder['all']Kibana feature privileges.Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:*label is applied per the guidelinesPR developed with Cursor + Opus 4.5