Agent discovery registry backed by ETS.
Stores {module, card} entries where card is the plain map returned by
module.agent_card/0. The GenServer owns the ETS table and handles writes;
reads go directly to ETS for concurrent access.
Usage
{:ok, _pid} = A2A.Registry.start_link(name: A2A.Registry)
:ok = A2A.Registry.register(A2A.Registry, MyAgent, MyAgent.agent_card())
{:ok, card} = A2A.Registry.get(A2A.Registry, MyAgent)Pre-populating on Start
A2A.Registry.start_link(
name: A2A.Registry,
agents: [MyApp.PricingAgent, MyApp.RiskAgent]
)Each module's agent_card/0 is called during init/1 and the result is
inserted into the table.
Summary
Functions
Returns all registered {module, card} entries.
Returns a specification to start this module under a supervisor.
Returns all agent modules whose card contains a skill with the given tag.
Looks up a single agent by module name.
Registers an agent module with its card.
Starts the registry process and creates the underlying ETS table.
Removes an agent module from the registry.
Functions
@spec all(GenServer.server()) :: [{module(), A2A.Agent.card()}]
Returns all registered {module, card} entries.
Reads ETS directly — no message passing.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec find_by_skill(GenServer.server(), String.t()) :: [module()]
Returns all agent modules whose card contains a skill with the given tag.
Reads ETS directly — no message passing.
@spec get(GenServer.server(), module()) :: {:ok, A2A.Agent.card()} | {:error, :not_found}
Looks up a single agent by module name.
Reads ETS directly — no message passing.
@spec register(GenServer.server(), module(), A2A.Agent.card()) :: :ok
Registers an agent module with its card.
Overwrites any existing entry for the same module.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the registry process and creates the underlying ETS table.
Options
:name— process/table name (required):agents— list of agent modules to pre-populate (default:[])
@spec unregister(GenServer.server(), module()) :: :ok
Removes an agent module from the registry.