Skip to content

Comments

[onechat] Implement agent modes#224801

Merged
pgayvallet merged 17 commits intoelastic:mainfrom
pgayvallet:onechat-xxx-agent-modes
Jun 26, 2025
Merged

[onechat] Implement agent modes#224801
pgayvallet merged 17 commits intoelastic:mainfrom
pgayvallet:onechat-xxx-agent-modes

Conversation

@pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented Jun 23, 2025

Summary

Follow-up of #223367
Fix https://github.com/elastic/search-team/issues/10259

This PR introduce the concept of agent mode, expose the research agent as a mode instead of a tool, and add the reason and plan modes.

Examples

Calling the Q/A (default) mode

POST kbn:/internal/onechat/chat
{
  "nextMessage": "Find all info related to our work from home policy"
}

Calling the researcher mode

POST kbn:/internal/onechat/chat
{
  "mode": "research",
  "nextMessage": "Find all info related to our work from home policy"
}

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet pgayvallet added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.1.0 labels Jun 23, 2025
@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet pgayvallet marked this pull request as ready for review June 23, 2025 14:26
@pgayvallet pgayvallet requested a review from a team as a code owner June 23, 2025 14:26

const setResearchGoalTool = () => {
return new DynamicStructuredTool({
name: setResearchGoalToolName,
Copy link
Member

Choose a reason for hiding this comment

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

very nitty but was this suppose to be researchGoalToolName instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tool's name is set_research_goal, it's the "internal" tool exposed to the LLM in the first step to define the research goal based on the conversation. It's exposed as a tool because the LLM can also decide to answer with aplain text response if it thinks it need more info before starting the deep-research process

@pgayvallet pgayvallet enabled auto-merge (squash) June 26, 2025 15:15
@pgayvallet pgayvallet merged commit 48e4ede into elastic:main Jun 26, 2025
10 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #5 / Rule execution logic API - Basic License/Essentials Tier @ess @serverless @serverlessQA timestamp tests alerts generated from events with a timestamp in seconds is converted correctly into the forced ISO8601 format when copying KQL query should still use the @timestamp field even with an override field. It should never use the override field

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
@kbn/onechat-common 136 144 +8
@kbn/onechat-server 92 90 -2
total +6

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/onechat-common 3 2 -1

Page load bundle

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

id before after diff
onechat 10.9KB 10.9KB +14.0B
Unknown metric groups

API count

id before after diff
@kbn/onechat-common 203 214 +11
@kbn/onechat-server 177 179 +2
total +13

History

@pgayvallet pgayvallet changed the title [onechat] Add researcher agent mode [onechat] Implement agent modes Jun 27, 2025
delanni added a commit that referenced this pull request Jun 27, 2025
## Summary
Fixing a type error coming from a potential race-merge situation. 
#222816 +
#224801
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 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants