Skip to content

[Security Solution][AI Assistant] Update Message schema and interface (#13657)#232394

Merged
e40pud merged 9 commits intoelastic:mainfrom
e40pud:security/genai/conversations/13657-message-schema
Aug 28, 2025
Merged

[Security Solution][AI Assistant] Update Message schema and interface (#13657)#232394
e40pud merged 9 commits intoelastic:mainfrom
e40pud:security/genai/conversations/13657-message-schema

Conversation

@e40pud
Copy link
Copy Markdown
Contributor

@e40pud e40pud commented Aug 20, 2025

Summary

Epic: https://github.com/elastic/security-team/issues/12768
Meta: https://github.com/elastic/security-team/issues/13657
RFC: internal link

With these changes we update the conversation Message schema by adding a new field id. This will allow us to easily refer messages that are summarized.

New messages

All new messages will be added with the id field set.

Existing messages

The id field for all existing messages will be undefined and will be updated whenever a user updates the conversation:

  • appends new messages
  • regenerates a last assistant respond

In those case above, all messages within the ongoing conversation will be updated and will have a id field set.

Testing scenarios

  1. Existing messages without id
  • Create conversation with messages in "pre this PR" code (e.g. main branch)
  • Checkout code from this PR
  • Check via Dev Tools that messages within the conversations index do not have id field set
  • Add a new message to one of the conversations
  • Check that all messages within that conversation are updated and id field set for all of them
  1. New messages
  • Checkout code from this PR
  • Create a new chat and add new messages
  • Check via Dev Tools that all messages within the new conversation have id field set

@e40pud e40pud added this to the 9.2 milestone Aug 20, 2025
@e40pud e40pud self-assigned this Aug 20, 2025
@e40pud e40pud requested a review from a team as a code owner August 20, 2025 13:15
@e40pud e40pud added release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Feature:Security Assistant Security Assistant Team:Security Generative AI Security Generative AI backport:version Backport to applied version labels v9.2.0 labels Aug 20, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@e40pud e40pud requested a review from spong August 20, 2025 13:18
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner August 20, 2025 13:53
@e40pud
Copy link
Copy Markdown
Contributor Author

e40pud commented Aug 20, 2025

/ci

@e40pud e40pud requested a review from KDKHD August 22, 2025 09:01
Copy link
Copy Markdown
Member

@KDKHD KDKHD left a comment

Choose a reason for hiding this comment

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

Tested locally and all is working as expected!

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 10.2MB 10.2MB +20.0B

History

cc @e40pud

@e40pud e40pud merged commit 9b7718a into elastic:main Aug 28, 2025
12 checks passed
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 1, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 232394 locally
cc: @e40pud

@e40pud e40pud removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 1, 2025
@e40pud e40pud added backport:skip This PR does not require backporting and removed backport:version Backport to applied version labels labels Sep 1, 2025
qn895 pushed a commit to qn895/kibana that referenced this pull request Sep 2, 2025
…ce (elastic#13657) (elastic#232394)

## Summary

Epic: elastic/security-team#12768
Meta: elastic/security-team#13657
RFC: [internal
link](https://docs.google.com/document/d/13jAJ5Q3_At_zAuwKjvpYehnM5uzKJSwZIZ1aJJNAf5k)

With these changes we update the conversation `Message` schema by adding
a new field `id`. This will allow us to easily refer messages that are
summarized.

### New messages

All new messages will be added with the `id` field set.

### Existing messages

The `id` field for all existing messages will be `undefined` and will be
updated whenever a user updates the conversation:
- appends new messages
- regenerates a last assistant respond

In those case above, all messages within the ongoing conversation will
be updated and will have a `id` field set.

### Testing scenarios

1. **Existing messages without `id`**

- Create conversation with messages in "pre this PR" code (e.g. main
branch)
- Checkout code from this PR
- Check via Dev Tools that messages within the conversations index do
not have `id` field set
- Add a new message to one of the conversations
- Check that all messages within that conversation are updated and `id`
field set for all of them

2. **New messages**

- Checkout code from this PR
- Create a new chat and add new messages
- Check via Dev Tools that all messages within the new conversation have
`id` field set

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
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 Feature:Security Assistant Security Assistant release_note:skip Skip the PR/issue when compiling release notes Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants