-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLM tasks] Add product documentation retrieval task #194379
[LLM tasks] Add product documentation retrieval task #194379
Conversation
Pinging @elastic/appex-ai-infra (Team:AI Infra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kibana.jsonc
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/kbn-optimizer/limits.yml
… src/core/server/integration_tests/ci_checks'
Moving back to draft as I will use the PR for the installation logic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for addressing my previous feedback. Switching to use the task manager makes a lot of sense for our use case.
I have some non-blocking comments that we should address, either here or in a follow up.
Additionally, I'd like to test the install procedure in a memory constrained environment, such as a 1GB ESS instance.
x-pack/plugins/ai_infra/product_doc_base/server/services/doc_manager/doc_manager.ts
Show resolved
Hide resolved
x-pack/plugins/ai_infra/product_doc_base/server/services/doc_manager/doc_manager.ts
Show resolved
Hide resolved
[INSTALL_ALL_TASK_TYPE]: { | ||
title: 'Install all product documentation artifacts', | ||
timeout: '10m', | ||
maxAttempts: 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check with response ops about the cost
attribute for all of our tasks (https://github.com/pgayvallet/kibana/blob/1ddad2f6cd6b23333a6d2070e50d705ec79ab2fd/x-pack/plugins/task_manager/server/task.ts#L21-L25).
We know this is a long-running task which is capable of emitting event loop utilization warnings. Right now our cost
options are tiny
, normal
, and extra large
. I'm not sure if this qualifies as extra large
or not, but maybe response ops can help us determine the appropriate cost
to select.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I asked Mike about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra large means it needs a lot of CPU and memory resources compared to other typical background tasks (5x more than normal tasks). For example, indicator match rules in security solution.
Setting extra large indicates to task manager that it should consider these types of tasks as the equivalent of five normal background tasks, so it reduces overall task concurrency on the running node to accommodate these tasks. In general we recommend optimizing the task type for memory and CPU instead of setting extra large as it does affect Kibana throughput on a given node quite a bit when they run.
taskId: string; | ||
timeout?: number; | ||
interval?: number; | ||
}): Promise<boolean> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the return value doesn't appear to be used anywhere
wait: true, | ||
}); | ||
|
||
return res.ok<PerformInstallResponse>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will incorrectly report installed: true
if the task fails.
Steps:
- Change the
artifactRepositoryUrl
to something that will not resolve - Navigate to o11y ai assistant settings
- Click the
Install
button to invoke this endpoint - Wait for the request to complete. It will eventually return a successful response after TM exhausts all retry attempts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.. working with remote task execution is quite awkward. The issue I have is that once executed, the task instance is deleted, so we can't even retrieve the output status from it. But maybe in case of error the instance is preserved... idk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I fixed it in b9145ef.
What I learned though, is that in case of task failure, the failure isn't stored anywhere (the task instance object still gets deleted at the end of the run), so
- I have to manually detect if the task was successful or not (by checking install status after the run)...
- meaning I can't surface the failure cause to the UI...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pgayvallet nice, I think that'll work well enough given our constraints. Thanks for digging into this.
@legrego on serverless oblt project (with, AFAIK, 1gb BG nodes): Takes ~6mins, but install is successful |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Saved Objects .kibana field count
Unknown metric groupsAPI count
ESLint disabled in files
Total ESLint disabled count
History
|
Starting backport for target branches: 8.x |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary Close elastic#193473 Close elastic#193474 This PR utilize the documentation packages that are build via the tool introduced by elastic#193847, allowing to install them in Kibana and expose documentation retrieval as an LLM task that AI assistants (or other consumers) can call. Users can now decide to install the Elastic documentation from the assistant's config screen, which will expose a new tool for the assistant, `retrieve_documentation` (only implemented for the o11y assistant in the current PR, shall be done for security as a follow up). For more information, please refer to the self-review. ## General architecture <img width="1118" alt="Screenshot 2024-10-17 at 09 22 32" src="https://github.com/user-attachments/assets/3df8c30a-9ccc-49ab-92ce-c204b96d6fc4"> ## What this PR does Adds two plugin: - `productDocBase`: contains all the logic related to product documentation installation, status, and search. This is meant to be a "low level" components only responsible for this specific part. - `llmTasks`: an higher level plugin that will contain various LLM tasks to be used by assistants and genAI consumers. The intent is not to have a single place to put all llm tasks, but more to have a default place where we can introduce new tasks from. (fwiw, the `nlToEsql` task will probably be moved to that plugin). - Add a `retrieve_documentation` tool registration for the o11y assistant - Add a component on the o11y assistant configuration page to install the product doc (wiring the feature to the o11y assistant was done for testing purposes mostly, any addition / changes / enhancement should be done by the owning team - either in this PR or as a follow-up) ## What is NOT included in this PR: - Wire product base feature to the security assistant (should be done by the owning team as a follow-up) - installation - utilization as tool - FTR tests: this is somewhat blocked by the same things we need to figure out for elastic/kibana-team#1271 ## Screenshots ### Installation from o11y assistant configuration page <img width="1476" alt="Screenshot 2024-10-17 at 09 41 24" src="https://github.com/user-attachments/assets/31daa585-9fb2-400a-a2d1-5917a262367a"> ### Example of output #### Without product documentation installed <img width="739" alt="Screenshot 2024-10-10 at 09 59 41" src="https://github.com/user-attachments/assets/993fb216-6c9a-433f-bf44-f6e383d20d9d"> #### With product documentation installed <img width="718" alt="Screenshot 2024-10-10 at 09 55 38" src="https://github.com/user-attachments/assets/805ea4ca-8bc9-4355-a434-0ba81f8228a9"> --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Alex Szabo <[email protected]> Co-authored-by: Matthias Wilhelm <[email protected]> Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 455c781) # Conflicts: # .github/CODEOWNERS
…200754) # Backport This will backport the following commits from `main` to `8.x`: - [[LLM tasks] Add product documentation retrieval task (#194379)](#194379) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Pierre Gayvallet","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-19T14:28:26Z","message":"[LLM tasks] Add product documentation retrieval task (#194379)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/193473\r\nClose https://github.com/elastic/kibana/issues/193474\r\n\r\nThis PR utilize the documentation packages that are build via the tool\r\nintroduced by #193847, allowing to\r\ninstall them in Kibana and expose documentation retrieval as an LLM task\r\nthat AI assistants (or other consumers) can call.\r\n\r\nUsers can now decide to install the Elastic documentation from the\r\nassistant's config screen, which will expose a new tool for the\r\nassistant, `retrieve_documentation` (only implemented for the o11y\r\nassistant in the current PR, shall be done for security as a follow up).\r\n\r\nFor more information, please refer to the self-review.\r\n\r\n## General architecture\r\n\r\n<img width=\"1118\" alt=\"Screenshot 2024-10-17 at 09 22 32\"\r\nsrc=\"https://github.com/user-attachments/assets/3df8c30a-9ccc-49ab-92ce-c204b96d6fc4\">\r\n\r\n## What this PR does\r\n\r\nAdds two plugin:\r\n- `productDocBase`: contains all the logic related to product\r\ndocumentation installation, status, and search. This is meant to be a\r\n\"low level\" components only responsible for this specific part.\r\n- `llmTasks`: an higher level plugin that will contain various LLM tasks\r\nto be used by assistants and genAI consumers. The intent is not to have\r\na single place to put all llm tasks, but more to have a default place\r\nwhere we can introduce new tasks from. (fwiw, the `nlToEsql` task will\r\nprobably be moved to that plugin).\r\n\r\n- Add a `retrieve_documentation` tool registration for the o11y\r\nassistant\r\n- Add a component on the o11y assistant configuration page to install\r\nthe product doc\r\n\r\n(wiring the feature to the o11y assistant was done for testing purposes\r\nmostly, any addition / changes / enhancement should be done by the\r\nowning team - either in this PR or as a follow-up)\r\n\r\n## What is NOT included in this PR:\r\n\r\n- Wire product base feature to the security assistant (should be done by\r\nthe owning team as a follow-up)\r\n - installation\r\n - utilization as tool\r\n\r\n- FTR tests: this is somewhat blocked by the same things we need to\r\nfigure out for https://github.com/elastic/kibana-team/issues/1271\r\n\r\n## Screenshots \r\n\r\n### Installation from o11y assistant configuration page\r\n\r\n<img width=\"1476\" alt=\"Screenshot 2024-10-17 at 09 41 24\"\r\nsrc=\"https://github.com/user-attachments/assets/31daa585-9fb2-400a-a2d1-5917a262367a\">\r\n\r\n### Example of output\r\n\r\n#### Without product documentation installed \r\n\r\n<img width=\"739\" alt=\"Screenshot 2024-10-10 at 09 59 41\"\r\nsrc=\"https://github.com/user-attachments/assets/993fb216-6c9a-433f-bf44-f6e383d20d9d\">\r\n\r\n#### With product documentation installed\r\n\r\n<img width=\"718\" alt=\"Screenshot 2024-10-10 at 09 55 38\"\r\nsrc=\"https://github.com/user-attachments/assets/805ea4ca-8bc9-4355-a434-0ba81f8228a9\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Alex Szabo <[email protected]>\r\nCo-authored-by: Matthias Wilhelm <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"455c781c6d1e1161f66e275299cf06064a0ffde2","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:cloud-deploy","Team:Obs AI Assistant","ci:project-deploy-observability","Team:AI Infra","v8.17.0"],"number":194379,"url":"https://github.com/elastic/kibana/pull/194379","mergeCommit":{"message":"[LLM tasks] Add product documentation retrieval task (#194379)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/193473\r\nClose https://github.com/elastic/kibana/issues/193474\r\n\r\nThis PR utilize the documentation packages that are build via the tool\r\nintroduced by #193847, allowing to\r\ninstall them in Kibana and expose documentation retrieval as an LLM task\r\nthat AI assistants (or other consumers) can call.\r\n\r\nUsers can now decide to install the Elastic documentation from the\r\nassistant's config screen, which will expose a new tool for the\r\nassistant, `retrieve_documentation` (only implemented for the o11y\r\nassistant in the current PR, shall be done for security as a follow up).\r\n\r\nFor more information, please refer to the self-review.\r\n\r\n## General architecture\r\n\r\n<img width=\"1118\" alt=\"Screenshot 2024-10-17 at 09 22 32\"\r\nsrc=\"https://github.com/user-attachments/assets/3df8c30a-9ccc-49ab-92ce-c204b96d6fc4\">\r\n\r\n## What this PR does\r\n\r\nAdds two plugin:\r\n- `productDocBase`: contains all the logic related to product\r\ndocumentation installation, status, and search. This is meant to be a\r\n\"low level\" components only responsible for this specific part.\r\n- `llmTasks`: an higher level plugin that will contain various LLM tasks\r\nto be used by assistants and genAI consumers. The intent is not to have\r\na single place to put all llm tasks, but more to have a default place\r\nwhere we can introduce new tasks from. (fwiw, the `nlToEsql` task will\r\nprobably be moved to that plugin).\r\n\r\n- Add a `retrieve_documentation` tool registration for the o11y\r\nassistant\r\n- Add a component on the o11y assistant configuration page to install\r\nthe product doc\r\n\r\n(wiring the feature to the o11y assistant was done for testing purposes\r\nmostly, any addition / changes / enhancement should be done by the\r\nowning team - either in this PR or as a follow-up)\r\n\r\n## What is NOT included in this PR:\r\n\r\n- Wire product base feature to the security assistant (should be done by\r\nthe owning team as a follow-up)\r\n - installation\r\n - utilization as tool\r\n\r\n- FTR tests: this is somewhat blocked by the same things we need to\r\nfigure out for https://github.com/elastic/kibana-team/issues/1271\r\n\r\n## Screenshots \r\n\r\n### Installation from o11y assistant configuration page\r\n\r\n<img width=\"1476\" alt=\"Screenshot 2024-10-17 at 09 41 24\"\r\nsrc=\"https://github.com/user-attachments/assets/31daa585-9fb2-400a-a2d1-5917a262367a\">\r\n\r\n### Example of output\r\n\r\n#### Without product documentation installed \r\n\r\n<img width=\"739\" alt=\"Screenshot 2024-10-10 at 09 59 41\"\r\nsrc=\"https://github.com/user-attachments/assets/993fb216-6c9a-433f-bf44-f6e383d20d9d\">\r\n\r\n#### With product documentation installed\r\n\r\n<img width=\"718\" alt=\"Screenshot 2024-10-10 at 09 55 38\"\r\nsrc=\"https://github.com/user-attachments/assets/805ea4ca-8bc9-4355-a434-0ba81f8228a9\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Alex Szabo <[email protected]>\r\nCo-authored-by: Matthias Wilhelm <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"455c781c6d1e1161f66e275299cf06064a0ffde2"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194379","number":194379,"mergeCommit":{"message":"[LLM tasks] Add product documentation retrieval task (#194379)\n\n## Summary\r\n\r\nClose https://github.com/elastic/kibana/issues/193473\r\nClose https://github.com/elastic/kibana/issues/193474\r\n\r\nThis PR utilize the documentation packages that are build via the tool\r\nintroduced by #193847, allowing to\r\ninstall them in Kibana and expose documentation retrieval as an LLM task\r\nthat AI assistants (or other consumers) can call.\r\n\r\nUsers can now decide to install the Elastic documentation from the\r\nassistant's config screen, which will expose a new tool for the\r\nassistant, `retrieve_documentation` (only implemented for the o11y\r\nassistant in the current PR, shall be done for security as a follow up).\r\n\r\nFor more information, please refer to the self-review.\r\n\r\n## General architecture\r\n\r\n<img width=\"1118\" alt=\"Screenshot 2024-10-17 at 09 22 32\"\r\nsrc=\"https://github.com/user-attachments/assets/3df8c30a-9ccc-49ab-92ce-c204b96d6fc4\">\r\n\r\n## What this PR does\r\n\r\nAdds two plugin:\r\n- `productDocBase`: contains all the logic related to product\r\ndocumentation installation, status, and search. This is meant to be a\r\n\"low level\" components only responsible for this specific part.\r\n- `llmTasks`: an higher level plugin that will contain various LLM tasks\r\nto be used by assistants and genAI consumers. The intent is not to have\r\na single place to put all llm tasks, but more to have a default place\r\nwhere we can introduce new tasks from. (fwiw, the `nlToEsql` task will\r\nprobably be moved to that plugin).\r\n\r\n- Add a `retrieve_documentation` tool registration for the o11y\r\nassistant\r\n- Add a component on the o11y assistant configuration page to install\r\nthe product doc\r\n\r\n(wiring the feature to the o11y assistant was done for testing purposes\r\nmostly, any addition / changes / enhancement should be done by the\r\nowning team - either in this PR or as a follow-up)\r\n\r\n## What is NOT included in this PR:\r\n\r\n- Wire product base feature to the security assistant (should be done by\r\nthe owning team as a follow-up)\r\n - installation\r\n - utilization as tool\r\n\r\n- FTR tests: this is somewhat blocked by the same things we need to\r\nfigure out for https://github.com/elastic/kibana-team/issues/1271\r\n\r\n## Screenshots \r\n\r\n### Installation from o11y assistant configuration page\r\n\r\n<img width=\"1476\" alt=\"Screenshot 2024-10-17 at 09 41 24\"\r\nsrc=\"https://github.com/user-attachments/assets/31daa585-9fb2-400a-a2d1-5917a262367a\">\r\n\r\n### Example of output\r\n\r\n#### Without product documentation installed \r\n\r\n<img width=\"739\" alt=\"Screenshot 2024-10-10 at 09 59 41\"\r\nsrc=\"https://github.com/user-attachments/assets/993fb216-6c9a-433f-bf44-f6e383d20d9d\">\r\n\r\n#### With product documentation installed\r\n\r\n<img width=\"718\" alt=\"Screenshot 2024-10-10 at 09 55 38\"\r\nsrc=\"https://github.com/user-attachments/assets/805ea4ca-8bc9-4355-a434-0ba81f8228a9\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Alex Szabo <[email protected]>\r\nCo-authored-by: Matthias Wilhelm <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"455c781c6d1e1161f66e275299cf06064a0ffde2"}},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
## Summary Close elastic#193473 Close elastic#193474 This PR utilize the documentation packages that are build via the tool introduced by elastic#193847, allowing to install them in Kibana and expose documentation retrieval as an LLM task that AI assistants (or other consumers) can call. Users can now decide to install the Elastic documentation from the assistant's config screen, which will expose a new tool for the assistant, `retrieve_documentation` (only implemented for the o11y assistant in the current PR, shall be done for security as a follow up). For more information, please refer to the self-review. ## General architecture <img width="1118" alt="Screenshot 2024-10-17 at 09 22 32" src="https://github.com/user-attachments/assets/3df8c30a-9ccc-49ab-92ce-c204b96d6fc4"> ## What this PR does Adds two plugin: - `productDocBase`: contains all the logic related to product documentation installation, status, and search. This is meant to be a "low level" components only responsible for this specific part. - `llmTasks`: an higher level plugin that will contain various LLM tasks to be used by assistants and genAI consumers. The intent is not to have a single place to put all llm tasks, but more to have a default place where we can introduce new tasks from. (fwiw, the `nlToEsql` task will probably be moved to that plugin). - Add a `retrieve_documentation` tool registration for the o11y assistant - Add a component on the o11y assistant configuration page to install the product doc (wiring the feature to the o11y assistant was done for testing purposes mostly, any addition / changes / enhancement should be done by the owning team - either in this PR or as a follow-up) ## What is NOT included in this PR: - Wire product base feature to the security assistant (should be done by the owning team as a follow-up) - installation - utilization as tool - FTR tests: this is somewhat blocked by the same things we need to figure out for elastic/kibana-team#1271 ## Screenshots ### Installation from o11y assistant configuration page <img width="1476" alt="Screenshot 2024-10-17 at 09 41 24" src="https://github.com/user-attachments/assets/31daa585-9fb2-400a-a2d1-5917a262367a"> ### Example of output #### Without product documentation installed <img width="739" alt="Screenshot 2024-10-10 at 09 59 41" src="https://github.com/user-attachments/assets/993fb216-6c9a-433f-bf44-f6e383d20d9d"> #### With product documentation installed <img width="718" alt="Screenshot 2024-10-10 at 09 55 38" src="https://github.com/user-attachments/assets/805ea4ca-8bc9-4355-a434-0ba81f8228a9"> --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Alex Szabo <[email protected]> Co-authored-by: Matthias Wilhelm <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
throw new Error(`Timeout waiting for ML model ${modelId} to be deployed`); | ||
}; | ||
|
||
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little late but any reason why you opted for custom retry logic instead of p-retry
? Same for waitUntilTaskCompleted
## Summary Follow-up of #194379. Turns out, the prefix for kibana system indices is `.kibana_*`, so our indices were not considered as kibana system indices and causing warnings when created, such as ``` Elasticsearch deprecation: 299 Elasticsearch-6db572c986d7e114b8b46f1d6f4169bed06717c5 "index name [.kibana-ai-product-doc-kibana] starts with a dot '.', in the next major version, index names starting with a dot are reserved for hidden indices and system indices" Origin:kibana ``` This PR addresses it, by changing the product doc index names to follow our system index pattern.
## Summary Follow-up of elastic#194379. Turns out, the prefix for kibana system indices is `.kibana_*`, so our indices were not considered as kibana system indices and causing warnings when created, such as ``` Elasticsearch deprecation: 299 Elasticsearch-6db572c986d7e114b8b46f1d6f4169bed06717c5 "index name [.kibana-ai-product-doc-kibana] starts with a dot '.', in the next major version, index names starting with a dot are reserved for hidden indices and system indices" Origin:kibana ``` This PR addresses it, by changing the product doc index names to follow our system index pattern. (cherry picked from commit d5cf0a6)
## Summary Follow-up of elastic#194379. Turns out, the prefix for kibana system indices is `.kibana_*`, so our indices were not considered as kibana system indices and causing warnings when created, such as ``` Elasticsearch deprecation: 299 Elasticsearch-6db572c986d7e114b8b46f1d6f4169bed06717c5 "index name [.kibana-ai-product-doc-kibana] starts with a dot '.', in the next major version, index names starting with a dot are reserved for hidden indices and system indices" Origin:kibana ``` This PR addresses it, by changing the product doc index names to follow our system index pattern. (cherry picked from commit d5cf0a6)
## Summary Close elastic#193473 Close elastic#193474 This PR utilize the documentation packages that are build via the tool introduced by elastic#193847, allowing to install them in Kibana and expose documentation retrieval as an LLM task that AI assistants (or other consumers) can call. Users can now decide to install the Elastic documentation from the assistant's config screen, which will expose a new tool for the assistant, `retrieve_documentation` (only implemented for the o11y assistant in the current PR, shall be done for security as a follow up). For more information, please refer to the self-review. ## General architecture <img width="1118" alt="Screenshot 2024-10-17 at 09 22 32" src="https://github.com/user-attachments/assets/3df8c30a-9ccc-49ab-92ce-c204b96d6fc4"> ## What this PR does Adds two plugin: - `productDocBase`: contains all the logic related to product documentation installation, status, and search. This is meant to be a "low level" components only responsible for this specific part. - `llmTasks`: an higher level plugin that will contain various LLM tasks to be used by assistants and genAI consumers. The intent is not to have a single place to put all llm tasks, but more to have a default place where we can introduce new tasks from. (fwiw, the `nlToEsql` task will probably be moved to that plugin). - Add a `retrieve_documentation` tool registration for the o11y assistant - Add a component on the o11y assistant configuration page to install the product doc (wiring the feature to the o11y assistant was done for testing purposes mostly, any addition / changes / enhancement should be done by the owning team - either in this PR or as a follow-up) ## What is NOT included in this PR: - Wire product base feature to the security assistant (should be done by the owning team as a follow-up) - installation - utilization as tool - FTR tests: this is somewhat blocked by the same things we need to figure out for elastic/kibana-team#1271 ## Screenshots ### Installation from o11y assistant configuration page <img width="1476" alt="Screenshot 2024-10-17 at 09 41 24" src="https://github.com/user-attachments/assets/31daa585-9fb2-400a-a2d1-5917a262367a"> ### Example of output #### Without product documentation installed <img width="739" alt="Screenshot 2024-10-10 at 09 59 41" src="https://github.com/user-attachments/assets/993fb216-6c9a-433f-bf44-f6e383d20d9d"> #### With product documentation installed <img width="718" alt="Screenshot 2024-10-10 at 09 55 38" src="https://github.com/user-attachments/assets/805ea4ca-8bc9-4355-a434-0ba81f8228a9"> --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Alex Szabo <[email protected]> Co-authored-by: Matthias Wilhelm <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
## Summary Follow-up of elastic#194379. Turns out, the prefix for kibana system indices is `.kibana_*`, so our indices were not considered as kibana system indices and causing warnings when created, such as ``` Elasticsearch deprecation: 299 Elasticsearch-6db572c986d7e114b8b46f1d6f4169bed06717c5 "index name [.kibana-ai-product-doc-kibana] starts with a dot '.', in the next major version, index names starting with a dot are reserved for hidden indices and system indices" Origin:kibana ``` This PR addresses it, by changing the product doc index names to follow our system index pattern.
Summary
Close #193473
Close #193474
This PR utilize the documentation packages that are build via the tool introduced by #193847, allowing to install them in Kibana and expose documentation retrieval as an LLM task that AI assistants (or other consumers) can call.
Users can now decide to install the Elastic documentation from the assistant's config screen, which will expose a new tool for the assistant,
retrieve_documentation
(only implemented for the o11y assistant in the current PR, shall be done for security as a follow up).For more information, please refer to the self-review.
General architecture
What this PR does
Adds two plugin:
productDocBase
: contains all the logic related to product documentation installation, status, and search. This is meant to be a "low level" components only responsible for this specific part.llmTasks
: an higher level plugin that will contain various LLM tasks to be used by assistants and genAI consumers. The intent is not to have a single place to put all llm tasks, but more to have a default place where we can introduce new tasks from. (fwiw, thenlToEsql
task will probably be moved to that plugin).Add a
retrieve_documentation
tool registration for the o11y assistantAdd a component on the o11y assistant configuration page to install the product doc
(wiring the feature to the o11y assistant was done for testing purposes mostly, any addition / changes / enhancement should be done by the owning team - either in this PR or as a follow-up)
What is NOT included in this PR:
Wire product base feature to the security assistant (should be done by the owning team as a follow-up)
FTR tests: this is somewhat blocked by the same things we need to figure out for https://github.com/elastic/kibana-team/issues/1271
Screenshots
Installation from o11y assistant configuration page
Example of output
Without product documentation installed
With product documentation installed