Add agent sleeping#214
Draft
CaelumF wants to merge 2 commits into
Draft
Conversation
2128416 to
e8a3115
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context from message I sent in discussion in our community discord:
Since this relates to token savings, scaling and noise reduction, and the interface seems relatively stable it is a core functionality rather than a plugin.
With sleeping, agent instances will have a sleep state in the coral server, which is a changeable boolean.
A REST interface, looking something like GET, PUT, POST (for custom tools) /sessions///sleeping will expose that sleeping state.
Agents in the graph will have added "sleep events" and "wake events" fields, which will be lists of events that cause the agent to be set to sleep or set to not sleep.
available wake events:
available sleep events:
Agents start out not sleeping, unless they have the agent started sleep event.
When an agent's state is sleeping, any MCP call (including MCP resource GET, which should happen before every LLM request in supporting agents), or proxied LLM request will hang until the agent is awoken.
A common pattern would be to have all agents apart from 1 or a few starting agents in the graph set to sleep on agent started, and to awake when included in a thread, this would be well suited for search or chat applications,
Since there is a REST interface for sleeping agents, more advanced sleeping behaviour can be implemented by applications, and tools could be used to let agents to intentionally put themselves or others to sleep or awake.
In general this should help to make applications much more LLM token efficient