Skip to content

[Security AI Assistant] Persist prompts#187040

Merged
YulNaumenko merged 32 commits intoelastic:mainfrom
YulNaumenko:security-ai-assistant-prompt-store
Jul 3, 2024
Merged

[Security AI Assistant] Persist prompts#187040
YulNaumenko merged 32 commits intoelastic:mainfrom
YulNaumenko:security-ai-assistant-prompt-store

Conversation

@YulNaumenko
Copy link
Copy Markdown
Contributor

@YulNaumenko YulNaumenko commented Jun 27, 2024

Moving prompts persistence layer from the local storage to the server side data stream .kibana-elastic-ai-assistant-prompts

@YulNaumenko YulNaumenko added release_note:skip Skip the PR/issue when compiling release notes v8.15.0 labels Jun 27, 2024
@YulNaumenko YulNaumenko self-assigned this Jun 27, 2024
@spong spong mentioned this pull request Jun 28, 2024
3 tasks
…nt-prompt-store

# Conflicts:
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings.tsx
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.tsx
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_settings.tsx
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_selector/quick_prompt_selector.tsx
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/quick_prompt_settings.tsx
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.tsx
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_settings_updater.test.tsx
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_settings_updater.tsx
#	x-pack/packages/kbn-elastic-assistant/impl/assistant/types.ts
#	x-pack/packages/kbn-elastic-assistant/impl/assistant_context/index.tsx
@YulNaumenko YulNaumenko marked this pull request as ready for review July 1, 2024 17:44
@YulNaumenko YulNaumenko requested a review from a team as a code owner July 1, 2024 17:44
@YulNaumenko YulNaumenko requested review from a team as code owners July 1, 2024 18:46
@YulNaumenko YulNaumenko requested a review from jpdjere July 1, 2024 18:46
@YulNaumenko YulNaumenko requested a review from a team July 2, 2024 04:59
Copy link
Copy Markdown
Contributor

@banderror banderror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule Management changes LGTM

@banderror banderror removed the request for review from jpdjere July 2, 2024 09:05
Copy link
Copy Markdown
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data_quality changes LGTM

type: boolean
isShared:
type: boolean
consumer:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be enum?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

his value will come from the Kibana applications.currentAppId$, which is dynamic and we should be flexible enough to supporting new apps

Comment thread x-pack/plugins/security_solution/public/assistant/provider.tsx
Comment thread x-pack/plugins/security_solution/public/assistant/provider.tsx Outdated
Copy link
Copy Markdown
Contributor

@stephmilovic stephmilovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work Yuliia, LGTM!!

@YulNaumenko YulNaumenko enabled auto-merge (squash) July 2, 2024 21:28
http.fetch(ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND, {
method: 'GET',
version: API_VERSIONS.internal.v1,
query: QUERY,
Copy link
Copy Markdown
Contributor

@angorayc angorayc Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The long term goal for prompt settings table would be moving away from the in-memory table and control the pagination. We might want the query to be passed from the payload in the long run. https://github.com/elastic/kibana/pull/186566/files#diff-4e741c819ea07d57f5a686e4a5e024a034ee2e4d16b4775ea3d3501787bb83d6R51

For later, should we add the include the conversations that are using this prompt or update the fetchCurrentConversations function? The current implementation for fetching conversations that using this prompt is actually filtering from all the conversations by their defaultSystemPrompt Id on the client side. This might not be great for performance when there are more and more conversations in the future.

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jul 3, 2024

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Defend Workflows Cypress Tests #11 / Endpoints page should update endpoint policy on Endpoint should update endpoint policy on Endpoint
  • [job] [logs] Defend Workflows Cypress Tests #20 / Response actions history page retains expanded action details on page reload retains expanded action details on page reload

History

cc @YulNaumenko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes v8.15.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants