-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Labels
Description
Add parent-to-subagent communication in agentMessage tool
Description
Currently, the agentMessage
tool only allows a parent agent to check the log data from a sub-agent but doesn't provide a way for the parent agent to communicate with the sub-agent. This enhancement would add bidirectional communication between parent and sub-agents.
Proposed Changes
- Modify the
AgentState
interface to include aparentMessages
array to store messages from the parent agent - Update the
agentMessage
tool to append messages to this array when theguidance
parameter is provided - Modify the
toolAgent
core to check for parent messages on each iteration and insert them into the message queue - Add appropriate documentation and tests
Benefits
- Allows parent agents to provide real-time guidance to sub-agents
- Enables more sophisticated agent collaboration patterns
- Improves the usefulness of sub-agents for complex tasks
Implementation Details
- The
parentMessages
array will be a list of strings from the parent agent - Each
agentMessage
call with aguidance
parameter will append a string to this list - The agent will check for new messages on each iteration and insert them into its message queue
- Messages will be clearly marked as coming from the parent agent