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

[Obs AI Assistant] Boost user prompt in recall #184933

Merged

Conversation

sorenlouv
Copy link
Member

Closes: #180995

@sorenlouv sorenlouv added release_note:skip Skip the PR/issue when compiling release notes v8.15.0 labels Jun 6, 2024
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@dgieselaar
Copy link
Member

dgieselaar commented Jun 7, 2024

WDYT about making recall itself more generic (e.g., accepting queries: Array<{ text:string; boost?:number }>? I think most uses of recall don't need any awareness of what a user prompt is or a screen description, or maybe there are other use cases than screen description. (There will be in #183293).

@sorenlouv
Copy link
Member Author

WDYT about making recall itself more generic (e.g., accepting queries: Array<{ text:string; boost?:number }>? I think most uses of recall don't need any awareness of what a user prompt is or a screen description, or maybe there are other use cases than screen description. (There will be in #183293).

That's not a bad idea. I'll do that.

sorenlouv added 2 commits June 7, 2024 12:44
…pt-over-screen-description

# Conflicts:
#	x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.ts
Comment on lines -120 to +85
queries: queriesOrUserPrompt,
screenDescription,
userPrompt,
Copy link
Member Author

Choose a reason for hiding this comment

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

@dgieselaar Per your comment we now use queries that includes boost parameter in recall but for scoring suggestions I am getting better results by telling the LLM what each query is (user prompt and screen description).

Copy link
Member

Choose a reason for hiding this comment

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

Actually that's a great idea!

Copy link
Member

@dgieselaar dgieselaar left a comment

Choose a reason for hiding this comment

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

lgtm!

@dgieselaar dgieselaar marked this pull request as ready for review June 8, 2024 08:50
@dgieselaar dgieselaar requested a review from a team as a code owner June 8, 2024 08:50
@dgieselaar
Copy link
Member

/ci

@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant labels Jun 8, 2024
@kibana-ci
Copy link
Collaborator

kibana-ci commented Jun 8, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #10 / useGetCaseUserActionsStats returns proper state on getCaseUserActionsStats

Metrics [docs]

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5499 +5499
total size - 8.9MB +8.9MB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observabilityAIAssistant 46.1KB 46.1KB -32.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@sorenlouv sorenlouv merged commit baa22bb into elastic:main Jun 8, 2024
21 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 8, 2024
@sorenlouv sorenlouv deleted the boost-user-prompt-over-screen-description branch June 8, 2024 20:32
delanni added a commit to delanni/kibana that referenced this pull request Jun 10, 2024
dgieselaar added a commit that referenced this pull request Jun 10, 2024
In #184933, we removed the
parameters for the `context` function, however, OpenAI requires at least
an empty `arguments` object, so requests fail. This PR sets arguments to
an empty JSON object (`"{}"`) if `function_call.arguments` is empty.
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Jun 13, 2024
@sorenlouv sorenlouv added v8.14.2 and removed backport:skip This commit does not require backporting labels Jul 1, 2024
@sorenlouv sorenlouv added the auto-backport Deprecated - use backport:version if exact versions are needed label Jul 1, 2024
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.14 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 184933

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@sorenlouv
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.14

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

Questions ?

Please refer to the Backport tool documentation

@sorenlouv sorenlouv removed the auto-backport Deprecated - use backport:version if exact versions are needed label Jul 1, 2024
sorenlouv added a commit to sorenlouv/kibana that referenced this pull request Jul 1, 2024
Closes: elastic#180995

---------

Co-authored-by: Dario Gieselaar <[email protected]>
(cherry picked from commit baa22bb)

# Conflicts:
#	x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/get_context_function_request_if_needed.ts
#	x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.test.ts
#	x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.ts
#	x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/chat/chat_body.test.tsx
sorenlouv added a commit that referenced this pull request Jul 2, 2024
)

# Backport

This will backport the following commits from `main` to `8.14`:
- [[Obs AI Assistant] Boost user prompt in recall
(#184933)](#184933)

<!--- Backport version: 9.5.1 -->

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

<!--BACKPORT [{"author":{"name":"Søren
Louv-Jansen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-06-08T20:32:49Z","message":"[Obs
AI Assistant] Boost user prompt in recall (#184933)\n\nCloses:
https://github.com/elastic/kibana/issues/180995\r\n\r\n---------\r\n\r\nCo-authored-by:
Dario Gieselaar
<[email protected]>","sha":"baa22bb16a179f7c5f13caf06afca315f62d0746","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","auto-backport","Team:Obs
AI
Assistant","ci:project-deploy-observability","v8.15.0","v8.14.2"],"title":"[Obs
AI Assistant] Boost user prompt in
recall","number":184933,"url":"https://github.com/elastic/kibana/pull/184933","mergeCommit":{"message":"[Obs
AI Assistant] Boost user prompt in recall (#184933)\n\nCloses:
https://github.com/elastic/kibana/issues/180995\r\n\r\n---------\r\n\r\nCo-authored-by:
Dario Gieselaar
<[email protected]>","sha":"baa22bb16a179f7c5f13caf06afca315f62d0746"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/184933","number":184933,"mergeCommit":{"message":"[Obs
AI Assistant] Boost user prompt in recall (#184933)\n\nCloses:
https://github.com/elastic/kibana/issues/180995\r\n\r\n---------\r\n\r\nCo-authored-by:
Dario Gieselaar
<[email protected]>","sha":"baa22bb16a179f7c5f13caf06afca315f62d0746"}},{"branch":"8.14","label":"v8.14.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@mistic
Copy link
Member

mistic commented Jul 4, 2024

This PR didn't make it on time to be included in the latest BC for v8.14.2.

@sorenlouv sorenlouv removed the v8.14.2 label Jul 4, 2024
dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Jul 18, 2024
In elastic#184933, we removed the
parameters for the `context` function, however, OpenAI requires at least
an empty `arguments` object, so requests fail. This PR sets arguments to
an empty JSON object (`"{}"`) if `function_call.arguments` is empty.

(cherry picked from commit 8f3359c)
sorenlouv added a commit to sorenlouv/kibana that referenced this pull request Dec 10, 2024
Closes: elastic#180995

---------

Co-authored-by: Dario Gieselaar <[email protected]>
(cherry picked from commit baa22bb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Obs AI Assistant Observability AI Assistant v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Observability AI Assistant] Boost user prompts in recall
6 participants