ayn.registry¶
Agent registry and search functionality.
Classes
|
Protocol for agent search implementations |
|
Search for agents in GitHub repositories |
|
Search for agents on Hugging Face |
Parse and search awesome lists for agents |
|
|
Unified registry for searching and managing agents |
- class ayn.registry.AgentRegistry(searchers=None, cache_dir=None)[source]¶
Bases:
MutableMapping[str,AgentMetadata]Unified registry for searching and managing agents
Aggregates results from multiple sources and provides a dict-like interface.
Pass
searchers=[]for a local-only registry, and acache_dirto keep the cache out of~/.ayn/registry.Example
>>> import tempfile >>> registry = AgentRegistry(searchers=[], cache_dir=tempfile.mkdtemp()) >>> # Add a local agent >>> from ayn.core import AgentMetadata, AgentFramework >>> meta = AgentMetadata(name="test", description="test", framework=AgentFramework.CUSTOM) >>> registry['test'] = meta >>> registry['test'].name 'test' >>> 'test' in registry True
- search(query, *, limit=20, source=None, **filters)[source]¶
Search across all sources
- Parameters:
- Return type:
- Returns:
List of agent metadata
Example
>>> import tempfile >>> registry = AgentRegistry(searchers=[], cache_dir=tempfile.mkdtemp()) >>> # Add some test data >>> from ayn.core import AgentMetadata, AgentFramework >>> registry['agent1'] = AgentMetadata( ... name="agent1", description="test agent", ... framework=AgentFramework.CREWAI, tags=['data'] ... ) >>> results = registry.search('agent') >>> len(results) >= 1 True
- class ayn.registry.AgentSearcher(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol for agent search implementations
- class ayn.registry.AwesomeListSearcher[source]¶
Bases:
objectParse and search awesome lists for agents
Example
>>> searcher = AwesomeListSearcher() >>> results = searcher.search('autogen')
- class ayn.registry.GitHubAgentSearcher(github_token=None)[source]¶
Bases:
objectSearch for agents in GitHub repositories
Example
>>> searcher = GitHubAgentSearcher() >>> results = searcher.search('crewai agent')
- class ayn.registry.HuggingFaceAgentSearcher(hf_token=None)[source]¶
Bases:
objectSearch for agents on Hugging Face
Uses the Hugging Face MCP tool if available.
Example
>>> searcher = HuggingFaceAgentSearcher() >>> results = searcher.search('code generation')
Modules