praval.core.registry
Agent and Tool Registry for Praval Framework.
Provides a global registry for tracking agents and tools across the system, enabling better coordination and discovery in multi-agent applications.
Thread-safe for concurrent agent registration and lookup.
Functions
Get the global registry instance. |
|
|
Register an agent in the global registry. |
Reset the global registry to a clean state. |
Classes
Global registry for agents and tools in Praval applications. |
- class praval.core.registry.PravalRegistry[source]
Bases:
objectGlobal registry for agents and tools in Praval applications.
Thread-safe for concurrent agent registration and lookup. Uses RLock to allow reentrant locking (same thread can acquire multiple times).
- get_agent(name)[source]
Get an agent by name from the registry (thread-safe).
- Return type:
Optional[Agent]- Parameters:
name (str)
- get_all_agents()[source]
Get all registered agents (thread-safe, returns copy).
- Return type:
Dict[str,Agent]
- get_tool(tool_name)[source]
Get a tool by name from the registry (thread-safe).
- Return type:
Optional[Dict[str,Any]]- Parameters:
tool_name (str)