agentconnect.core.registry package

Agent registry for the AgentConnect framework.

This module provides the AgentRegistry class for agent registration, discovery, and capability matching, as well as the AgentRegistration dataclass for storing agent registration information.

class AgentRegistry

Bases: object

Central registry for agent registration and discovery.

This class provides methods for registering agents, discovering agents by capability, and verifying agent identities.

async get_agent_type(agent_id)

Get the type of an agent.

Parameters:

agent_id (str) – ID of the agent

Return type:

AgentType

Returns:

Type of the agent

Raises:

KeyError – If the agent is not found

async get_all_agents()

Get a list of all agents registered in the system.

Return type:

List[AgentRegistration]

Returns:

List of all agent registrations

async get_all_capabilities()

Get a list of all unique capability names registered in the system.

Return type:

List[str]

Returns:

List of all capability names

async get_by_capability(capability_name)

Find agents by capability name (simple string matching).

Parameters:

capability_name (str) – Name of the capability to search for

Return type:

List[AgentRegistration]

Returns:

List of agent registrations with the specified capability

async get_by_capability_semantic(capability_description)

Find agents by capability description using semantic search.

Parameters:

capability_description (str) – Description of the capability to search for

Return type:

List[Tuple[AgentRegistration, float]]

Returns:

List of tuples containing agent registrations and similarity scores

async get_by_interaction_mode(mode)

Find agents by interaction mode.

Parameters:

mode (InteractionMode) – Interaction mode to search for

Return type:

List[AgentRegistration]

Returns:

List of agent registrations with the specified interaction mode

async get_by_organization(organization_id)

Find agents by organization.

Parameters:

organization_id (str) – ID of the organization

Return type:

List[AgentRegistration]

Returns:

List of agent registrations in the specified organization

async get_by_owner(owner_id)

Find agents by owner.

Parameters:

owner_id (str) – ID of the owner

Return type:

List[AgentRegistration]

Returns:

List of agent registrations owned by the specified owner

async get_registration(agent_id)

Get agent registration details.

Parameters:

agent_id (str) – ID of the agent

Return type:

Optional[AgentRegistration]

Returns:

Agent registration if found, None otherwise

async get_verified_agents()

Get all verified agents.

Return type:

List[AgentRegistration]

Returns:

List of verified agent registrations

async register(registration)

Register a new agent with verification.

Parameters:

registration (AgentRegistration) – Registration information for the agent

Return type:

bool

Returns:

True if registration was successful, False otherwise

async unregister(agent_id)

Remove agent from registry.

Parameters:

agent_id (str) – ID of the agent to unregister

Return type:

bool

Returns:

True if unregistration was successful, False otherwise

async update_registration(agent_id, updates)

Update agent registration details.

Parameters:
  • agent_id (str) – ID of the agent to update

  • updates (Dict) – Dictionary of updates to apply

Return type:

Optional[AgentRegistration]

Returns:

Updated agent registration if successful, None otherwise

async verify_agent(agent_id)

Verify an agent’s identity.

Parameters:

agent_id (str) – ID of the agent to verify

Return type:

bool

Returns:

True if verification was successful, False otherwise

async verify_owner(agent_id, owner_id)

Verify if a user owns an agent.

Parameters:
  • agent_id (str) – ID of the agent

  • owner_id (str) – ID of the owner

Return type:

bool

Returns:

True if the user owns the agent, False otherwise

class AgentRegistration(agent_id, organization_id, agent_type, interaction_modes, capabilities, identity, owner_id=None, metadata=<factory>)

Bases: object

Registration information for an agent.

This class stores the registration information for an agent, including its identity, capabilities, and interaction modes.

Parameters:
agent_id

Unique identifier for the agent

organization_id

ID of the organization the agent belongs to

agent_type

Type of agent (human, AI)

interaction_modes

Supported interaction modes

capabilities

List of agent capabilities

identity

Agent’s decentralized identity

owner_id

ID of the agent’s owner

metadata

Additional information about the agent

owner_id: Optional[str] = None
agent_id: str
organization_id: Optional[str]
agent_type: AgentType
interaction_modes: list[InteractionMode]
capabilities: list[Capability]
identity: AgentIdentity
metadata: Dict

Submodules