Skip to content
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

[Security Assistant] Product documentation tool #199694

Merged
merged 27 commits into from
Dec 4, 2024

Conversation

stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented Nov 11, 2024

Summary

Implements product documentation retrieval task in the security assistant.

  • Add a check in AIAssistantService.initializeResources to ensure installation of product docs
  • Adds a product documentation tool that calls the product documentation retrieval task when product docs are available

Without product docs:

LangSmith Trace
Screenshot 2024-11-11 at 11 51 51 AM

With product docs:

LangSmith Trace
123

Testing

  1. Ask the assistant: What is Elastic Painless?
  2. Check the run in LangSmith and ensure the ProductDocumentationTool was called

@stephmilovic stephmilovic marked this pull request as ready for review December 3, 2024 18:19
@stephmilovic stephmilovic requested review from a team as code owners December 3, 2024 18:19
@stephmilovic stephmilovic added release_note:enhancement Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Team:Security Generative AI Security Generative AI labels Dec 3, 2024
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

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

Dependency update LGTM

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #52 / Observability Rules Synthetics SyntheticsCustomStatusRule "after all" hook in "SyntheticsCustomStatusRule"
  • [job] [logs] Jest Tests #4 / useUpdateTags should call onSuccess when bulk update tags succeeds
  • [job] [logs] Jest Tests #4 / useUpdateTags should call show error toast when bulk update tags fails
  • [job] [logs] Jest Tests #4 / useUpdateTags should call show error toast when update tags fails

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
elasticAssistant 38 41 +3
Unknown metric groups

API count

id before after diff
elasticAssistant 53 56 +3

History

};
},
tags: ['product-documentation'],
// TODO: Remove after ZodAny is fixed https://github.com/langchain-ai/langchainjs/blob/main/langchain-core/src/tools.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I tried to follow the link to learn more, but it's 404 at the time of this writing. I was wondering if this file was the intended link, but it doesn't appear to explain this comment.

Copy link
Contributor

@andrew-goldstein andrew-goldstein left a comment

Choose a reason for hiding this comment

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

Thanks @stephmilovic for adding this feature 🙏
✅ Desk tested locally while the ProductDocumentationTool was still installing locally, and after it was available
LGTM 🚀

@stephmilovic stephmilovic merged commit e099b31 into elastic:main Dec 4, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12168452351

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 4, 2024
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 4, 2024
)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Assistant] Product documentation tool
(#199694)](#199694)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-04T21:16:45Z","message":"[Security
Assistant] Product documentation tool
(#199694)","sha":"e099b3189323a03dc833a8efd4eaf9ebc8cf3d16","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","Team:
SecuritySolution","backport:prev-minor","Team:Security Generative
AI"],"title":"[Security Assistant] Product documentation
tool","number":199694,"url":"https://github.com/elastic/kibana/pull/199694","mergeCommit":{"message":"[Security
Assistant] Product documentation tool
(#199694)","sha":"e099b3189323a03dc833a8efd4eaf9ebc8cf3d16"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199694","number":199694,"mergeCommit":{"message":"[Security
Assistant] Product documentation tool
(#199694)","sha":"e099b3189323a03dc833a8efd4eaf9ebc8cf3d16"}}]}]
BACKPORT-->

Co-authored-by: Steph Milovic <[email protected]>
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Dec 9, 2024
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Dec 9, 2024
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 9, 2024
Samiul-TheSoccerFan pushed a commit to Samiul-TheSoccerFan/kibana that referenced this pull request Dec 10, 2024
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:enhancement Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants