Skip to content

Add parent-to-subagent communication in agentMessage tool #315

@bhouston

Description

@bhouston

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

  1. Modify the AgentState interface to include a parentMessages array to store messages from the parent agent
  2. Update the agentMessage tool to append messages to this array when the guidance parameter is provided
  3. Modify the toolAgent core to check for parent messages on each iteration and insert them into the message queue
  4. 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 a guidance 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions