[Agent builder] Builtin Product documentation tool#242598
[Agent builder] Builtin Product documentation tool#242598stephmilovic merged 32 commits intoelastic:mainfrom
Conversation
… into product_docs_ab_tool
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
pgayvallet
left a comment
There was a problem hiding this comment.
The tool implementation looks good. I have concerns on how the tool is being registered and how we propagate the required llmTasks dependency to it (more details on slack)
… into product_docs_ab_tool
|
@elasticmachine merge upstream |
| // Try to get inferenceId from the connector, fall back to default ELSER endpoint | ||
| let inferenceId = defaultInferenceEndpoints.ELSER; | ||
| if (connector.type === InferenceConnectorType.Inference && connector.config?.inferenceId) { | ||
| inferenceId = connector.config.inferenceId; | ||
| } |
There was a problem hiding this comment.
@pgayvallet not sure this is the best way to make the inference endpoint configurable, but not sure another way at the moment. Do you think we should go forward with getting it off the connector, should I just default it to ELSER or do you see another way forward?
There was a problem hiding this comment.
I don't have a better idea. Now that we're getting "unified" through AB, I imagine we should have a platform level setting for the embedding model we use for our semantic_text fields at some point. Until we do...
One question - is that inferenceId on the inference connector config something users can already configure to specify an embedding model to use for a specific connector? if so, I'm fine using it. Otherwise I would just KISS and default to using ELSER until we figure out how to do it better.
There was a problem hiding this comment.
I think inferenceId is only on inference connector type:
elastic-llm:
name: Elastic LLM
actionTypeId: .inference
exposeConfig: true
config:
provider: 'elastic'
taskType: 'chat_completion'
inferenceId: '.rainbow-sprinkles-elastic'
providerConfig:
model_id: 'rainbow-sprinkles'
And considering we're expecting .elser-2-elasticsearch or .multilingual-e5-small-elasticsearch, that doesn't seem right. I'll hardcode to ELSER for now and leave a comment
| // Try to get inferenceId from the connector, fall back to default ELSER endpoint | ||
| let inferenceId = defaultInferenceEndpoints.ELSER; | ||
| if (connector.type === InferenceConnectorType.Inference && connector.config?.inferenceId) { | ||
| inferenceId = connector.config.inferenceId; | ||
| } |
There was a problem hiding this comment.
I don't have a better idea. Now that we're getting "unified" through AB, I imagine we should have a platform level setting for the embedding model we use for our semantic_text fields at some point. Until we do...
One question - is that inferenceId on the inference connector config something users can already configure to specify an embedding model to use for a specific connector? if so, I'm fine using it. Otherwise I would just KISS and default to using ELSER until we figure out how to do it better.
|
@elasticmachine merge upstream |
|
merge conflict between base and head |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
|
…ocumentation (#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](#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 #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 #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: #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>
…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
Adds a product documentation tool to Agent Builder that retrieves Elastic product documentation using the LlmTasks plugin. The tool uses the conditional availability pattern and is only available when product documentation is installed.
Changes
platform.core.product_documentationbuiltin tool toagent_builder_platformthat searches Elastic product docssetup()with conditional availability using theavailabilityconfiguration patternllmTasks.retrieveDocumentationAvailable()using the inference endpoint from the connector configurationinferenceIdfrom the connector config when using an inference connector, falling back to the default ELSER endpoint (defaultInferenceEndpoints.ELSER) for other connector typesllmTasksvia closure throughcoreSetup.getStartServices()instead of through service dependenciesTechnical Details
llmTasksas optional dependency toagent_builder_platformplugin (kibana.jsoncandPluginStartDependencies)registerTools()in pluginsetup()phase, following the same pattern as other built-in toolsavailabilityconfiguration withcacheMode: 'space'to conditionally show/hide the tool based on product documentation availabilityllmTasksis accessed via closure in the tool definition, not passed throughToolHandlerContextor internal service layerscoreSetup.getStartServices()to accessllmTasksat runtimedefaultInferenceEndpoints.ELSER, TODO to update to dynamicinferenceIdConsiderations