Interface AgentRegistry


public interface AgentRegistry
The registry contains information about all agents. This is useful when implementing planners for multi-agent collaboration.

It can be injected as a constructor parameter in components.

The agent id, name, and description are defined with the Component annotation on the agent class. The agent role is defined with the AgentRole annotation on the agent class.

Note that agents can be called based on the id without knowing the exact agent class or lambda of the agent method by using the {dynamicCall} of the component client.


 var response =
   componentClient
     .forAgent().inSession(sessionId)
     .dynamicCall(agentId)
     .invoke(request);
 

Not for user extension, implementation provided by the SDK.

  • Method Details

    • allAgents

      Information about all agents. The agent id, name, and description are defined with the Component annotation on the agent class. The agent role is defined with the AgentRole annotation on the agent class.
    • agentsWithRole

      Set<AgentRegistry.AgentInfo> agentsWithRole(String role)
      Agent identifiers of agents with a certain role. The role is defined with AgentRole annotation on the agent class. The agent id, name, and description are defined with the Component annotation on the agent class.
    • agentInfo

      AgentRegistry.AgentInfo agentInfo(String agentId)
      Information about a given agent. The agent id, name, and description are defined with the Component annotation on the agent class. The agent role is defined with the AgentRole annotation on the agent class.