Finds an agent by its unique ID
The agent ID
The agent, or null if not found
Finds all agents with a specific capability
The capability to search for
Array of agents with the capability
Finds all registered agents
Array of all agents
Saves an agent (create or update)
The agent to save
Deletes an agent
ID of the agent to delete
Checks if an agent exists
The agent ID
true if the agent exists
Clears all agents from the repository Useful for testing
Gets the total number of agents in the repository
In-memory implementation of AgentRepository.
Suitable for development, testing, and small-scale deployments. For production use with persistence, consider a database-backed implementation.
Example