From 0854996ba19ed61786fc32b9403552ac564e2d85 Mon Sep 17 00:00:00 2001 From: Sander Philipse <94373878+sphilipse@users.noreply.github.com> Date: Sat, 30 Nov 2024 14:52:39 +0100 Subject: [PATCH] [ES3] Enable AI assistant knowledge base (#202210) ## Summary This enables the knowledge base for the Serverless Search AI assistant. It also renames a few options to align naming, including a rename for the settings page in Observability's Serverless deployment to remove a reference to Search. --- config/serverless.es.yml | 8 ++++++- .../inference_endpoint/utils/install_elser.ts | 2 +- .../search_assistant/public/plugin.tsx | 3 ++- x-pack/plugins/search_playground/kibana.jsonc | 1 + .../serverless_observability/public/plugin.ts | 2 +- .../serverless_search/public/plugin.ts | 23 +++++++++++++++++-- 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/config/serverless.es.yml b/config/serverless.es.yml index 4b0d416bacdfc..3132125bfecde 100644 --- a/config/serverless.es.yml +++ b/config/serverless.es.yml @@ -59,6 +59,13 @@ xpack.features.overrides: stackAlerts: name: "Alerts" category: "enterpriseSearch" + ### Observability AI Assistant feature is moved to Search and renamed + observabilityAIAssistant: + name: "AI Assistant" + category: "enterpriseSearch" + ### AI Assistant enables the Inventory feature, moving to Search + inventory: + category: "enterpriseSearch" ## Cloud settings xpack.cloud.serverless.project_type: search @@ -127,7 +134,6 @@ xpack.observabilityAIAssistant.enabled: true xpack.searchAssistant.enabled: true xpack.searchAssistant.ui.enabled: true xpack.observabilityAIAssistant.scope: "search" -xpack.observabilityAIAssistant.enableKnowledgeBase: false aiAssistantManagementSelection.preferredAIAssistantType: "observability" xpack.observabilityAiAssistantManagement.logSourcesEnabled: false xpack.observabilityAiAssistantManagement.spacesEnabled: false diff --git a/x-pack/plugins/ai_infra/product_doc_base/server/services/inference_endpoint/utils/install_elser.ts b/x-pack/plugins/ai_infra/product_doc_base/server/services/inference_endpoint/utils/install_elser.ts index 0e92d765a3d17..c4ad3c43ce071 100644 --- a/x-pack/plugins/ai_infra/product_doc_base/server/services/inference_endpoint/utils/install_elser.ts +++ b/x-pack/plugins/ai_infra/product_doc_base/server/services/inference_endpoint/utils/install_elser.ts @@ -23,7 +23,7 @@ export const installElser = async ({ inference_config: { service: 'elasticsearch', service_settings: { - num_allocations: 1, + adaptive_allocations: { enabled: true }, num_threads: 1, model_id: '.elser_model_2', }, diff --git a/x-pack/plugins/search_assistant/public/plugin.tsx b/x-pack/plugins/search_assistant/public/plugin.tsx index 15c1443045cdc..ef65f256d7b36 100644 --- a/x-pack/plugins/search_assistant/public/plugin.tsx +++ b/x-pack/plugins/search_assistant/public/plugin.tsx @@ -54,8 +54,9 @@ export class SearchAssistantPlugin pluginsStart, }); const isEnabled = appService.isEnabled(); + const aiAssistantIsEnabled = coreStart.application.capabilities.observabilityAIAssistant?.show; - if (!isEnabled) { + if (!isEnabled || !aiAssistantIsEnabled) { return {}; } diff --git a/x-pack/plugins/search_playground/kibana.jsonc b/x-pack/plugins/search_playground/kibana.jsonc index 37562347e9f37..3c4eaaddc81a2 100644 --- a/x-pack/plugins/search_playground/kibana.jsonc +++ b/x-pack/plugins/search_playground/kibana.jsonc @@ -18,6 +18,7 @@ "actions", "data", "encryptedSavedObjects", + "ml", "navigation", "share", "security", diff --git a/x-pack/plugins/serverless_observability/public/plugin.ts b/x-pack/plugins/serverless_observability/public/plugin.ts index 774a76749f8d6..d4df07673e870 100644 --- a/x-pack/plugins/serverless_observability/public/plugin.ts +++ b/x-pack/plugins/serverless_observability/public/plugin.ts @@ -63,7 +63,7 @@ export class ServerlessObservabilityPlugin observabilityAiAssistantManagement: { category: appCategories.OTHER, title: i18n.translate('xpack.serverlessObservability.aiAssistantManagementTitle', { - defaultMessage: 'AI Assistant for Observability and Search Settings', + defaultMessage: 'AI Assistant Settings', }), description: i18n.translate( 'xpack.serverlessObservability.aiAssistantManagementDescription', diff --git a/x-pack/plugins/serverless_search/public/plugin.ts b/x-pack/plugins/serverless_search/public/plugin.ts index 3c24211d2a520..1b804e4bab307 100644 --- a/x-pack/plugins/serverless_search/public/plugin.ts +++ b/x-pack/plugins/serverless_search/public/plugin.ts @@ -13,7 +13,7 @@ import { Plugin, } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; -import { appIds } from '@kbn/management-cards-navigation'; +import { appCategories, appIds } from '@kbn/management-cards-navigation'; import { AuthenticatedUser } from '@kbn/security-plugin/common'; import { QueryClient, MutationCache, QueryCache } from '@tanstack/react-query'; import { of } from 'rxjs'; @@ -168,12 +168,31 @@ export class ServerlessSearchPlugin ): ServerlessSearchPluginStart { const { serverless, management, indexManagement, security } = services; serverless.setProjectHome(services.searchIndices.startRoute); + const aiAssistantIsEnabled = core.application.capabilities.observabilityAIAssistant?.show; const navigationTree$ = of(navigationTree(core.application)); serverless.initNavigation('es', navigationTree$, { dataTestSubj: 'svlSearchSideNav' }); const extendCardNavDefinitions = serverless.getNavigationCards( - security.authz.isRoleManagementEnabled() + security.authz.isRoleManagementEnabled(), + aiAssistantIsEnabled + ? { + observabilityAiAssistantManagement: { + category: appCategories.OTHER, + title: i18n.translate('xpack.serverlessSearch.aiAssistantManagementTitle', { + defaultMessage: 'AI Assistant Settings', + }), + description: i18n.translate( + 'xpack.serverlessSearch.aiAssistantManagementDescription', + { + defaultMessage: + 'Manage knowledge base and control assistant behavior, including response language.', + } + ), + icon: 'sparkles', + }, + } + : undefined ); management.setupCardsNavigation({