-
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
Feature/ai assistant citations #205586
base: main
Are you sure you want to change the base?
Feature/ai assistant citations #205586
Conversation
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
…ana into feature/ai-assistant-citations
e0e6b14
to
7785e37
Compare
…ana into feature/ai-assistant-citations
jest.mock('@kbn/zod', () => ({ | ||
z: { | ||
string: jest.fn().mockReturnValue({ describe: (str: string) => str }), | ||
number: jest.fn().mockReturnValue({ describe: (str: string) => str }), | ||
boolean: jest.fn().mockReturnValue({ describe: (str: string) => str }), | ||
object: jest.fn().mockReturnValue({ describe: (str: string) => str }), | ||
any: jest.fn().mockReturnValue({ describe: (str: string) => str }), | ||
}, | ||
})); |
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 mock started breaking tests because it did not mock everything in zod. The tests also passed without the mock so I removed this.
💛 Build succeeded, but was flaky
Failed CI Steps
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
|
Summary
This PR adds citations to the security AI assistant. Citations are produced when tools are used and they are displayed in the LLM response as numbered superscript elements. A label appears when the user hovers over the numbered elements and clicking on the label opens a new tab that displays the cited data.
Tools that are cited:
Changes:
citationElement
string e.g.!{citation[global_threat_report_entry](/app/management/kibana/securityAiAssistantManagement?tab=knowledge_base&entry_search_term=5e981c00-26bb-497b-a3ee-feb8bfe19bfc)}
citationElement
s from the LLM response and renders them in the AI assistant.Considerations:
Eventually direct prompting in combination with
citationElement
meant that the LLM had enough contextual information to produce good citations and no additional LLM calls were required.Jan-07-2025.14-33-21.mov
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breaking
label should be applied in these situations.release_note:*
label is applied per the guidelinesIdentify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.