Interface AgentRegistry

All Known Implementing Classes:
InMemoryAgentRegistry

public interface AgentRegistry
SPI for tracking live agents the admin surface can inspect or act on.

AgentScope-Java exposes ReActAgent as a prototype-scoped bean by default, so a Spring Map<String, Agent> scan will only find singleton agents (or none). To make the inventory complete, application code should call register(Agent) after constructing a long-lived agent — typically in a @PostConstruct on a Service that owns it, or wrapped inside the agent factory.

The default InMemoryAgentRegistry is fine for single-node deployments; for cluster-aware deployments, swap in an implementation backed by Nacos, Redis, or another shared store.

  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<io.agentscope.core.agent.Agent>
    find(String agentId)
     
    List<io.agentscope.core.agent.Agent>
    All registered agents in insertion order.
    void
    register(io.agentscope.core.agent.Agent agent)
     
    int
     
    void
    unregister(String agentId)
     
  • Method Details

    • register

      void register(io.agentscope.core.agent.Agent agent)
    • unregister

      void unregister(String agentId)
    • find

      Optional<io.agentscope.core.agent.Agent> find(String agentId)
    • list

      List<io.agentscope.core.agent.Agent> list()
      All registered agents in insertion order.
    • size

      int size()