ayn.registry

Agent registry and search functionality.

Classes

AgentSearcher(*args, **kwargs)

Protocol for agent search implementations

GitHubAgentSearcher([github_token])

Search for agents in GitHub repositories

HuggingFaceAgentSearcher([hf_token])

Search for agents on Hugging Face

AwesomeListSearcher()

Parse and search awesome lists for agents

AgentRegistry([searchers, cache_dir])

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 a cache_dir to 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:
  • query (str) – Search query

  • limit (int) – Max results

  • source (Optional[str]) – Specific source to search (github, huggingface, awesome)

  • **filters – Additional filters

Return type:

List[AgentMetadata]

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: Protocol

Protocol for agent search implementations

search(query, *, limit=20, **filters)[source]

Search for agents

Parameters:
  • query (str) – Search query string

  • limit (int) – Maximum results to return

  • **filters – Additional filters (framework, tags, etc.)

Return type:

Iterable[AgentMetadata]

Returns:

Iterable of agent metadata

class ayn.registry.AwesomeListSearcher[source]

Bases: object

Parse and search awesome lists for agents

Example

>>> searcher = AwesomeListSearcher()
>>> results = searcher.search('autogen')
search(query, *, limit=20, **filters)[source]

Search awesome lists

Return type:

Iterable[AgentMetadata]

class ayn.registry.GitHubAgentSearcher(github_token=None)[source]

Bases: object

Search for agents in GitHub repositories

Example

>>> searcher = GitHubAgentSearcher()
>>> results = searcher.search('crewai agent')
search(query, *, limit=20, **filters)[source]

Search GitHub for agent repos (not implemented: raises NotImplementedError)

Return type:

Iterable[AgentMetadata]

class ayn.registry.HuggingFaceAgentSearcher(hf_token=None)[source]

Bases: object

Search for agents on Hugging Face

Uses the Hugging Face MCP tool if available.

Example

>>> searcher = HuggingFaceAgentSearcher()
>>> results = searcher.search('code generation')
search(query, *, limit=20, **filters)[source]

Search Hugging Face for agents

Return type:

Iterable[AgentMetadata]

Modules

base

Agent registry implementation.

searchers

Agent searcher implementations.