Skip to main content

PayeLink Agent Discovery SDK

PyPI version Python 3.8+

What is this?

AI agents are multiplying across different protocols and organizations, but there's no easy way to discover them. This SDK solves that,search once, discover agents from anywhere.

Installation

pip install payelink-agent-search

Version

To check the installed version:

from payelink_agent_search import __version__
print(__version__)  # e.g., "0.1.6"

Quick Start

from payelink_agent_search import AgentSearchClient

# Create client
client = AgentSearchClient()

# Search for agents
response = client.search("Convert USD to KES")

# Use results
if response.success:
    for agent in response.agents:
        print(f"{agent.agent_name}: {agent.agent_description}")
        print(f"Endpoint: {agent.agent_card_url}")
        print("---")

client.close()

What Gets Discovered?

The SDK searches across multiple sources:

  • ✅ A2A agents (/.well-known/agent-card.json)
  • ✅ ACP agents (/.well-known/agent.yml)
  • ✅ Custom registries (/agents/public)
  • ✅ Open web (via intelligent search)

One search, every protocol.

Features

Multi-Protocol Discovery

# Automatically searches A2A, ACP, ANS, and custom endpoints
response = client.search("payment processing agent")

Filtering

response = client.search(
    query="Currency conversion",
    country="KE",              # Only Kenya
    capability="streaming",     # Must support streaming
    max_result=5
)

Context Manager Support

with AgentSearchClient() as client:
    response = client.search("translation agent")
    # Client auto-closes

Async Support

import asyncio
from payelink_agent_search import AsyncAgentSearchClient

async def main():
    async with AsyncAgentSearchClient() as client:
        response = await client.search("translation agent")
        if response.success:
            for agent in response.agents:
                print(f"{agent.agent_name}: {agent.agent_description}")

asyncio.run(main())

Async with Multiple Searches

import asyncio
from payelink_agent_search import AsyncAgentSearchClient

async def main():
    async with AsyncAgentSearchClient() as client:
        # Run multiple searches concurrently
        results = await asyncio.gather(
            client.search("currency conversion"),
            client.search("payment processing"),
            client.search("translation"),
        )
        
        for response in results:
            if response.success:
                print(f"Found {len(response.agents)} agents")

asyncio.run(main())

Response Format

class SearchResponse:
    success: bool                 # True if request succeeded
    agents: List[AgentDetails]    # Discovered agents (ranked)
    error: Optional[str]          # Error message if failed

class AgentDetails:
    agent_name: str               # Name of the agent
    agent_description: str        # What it does
    agent_card_url: str           # URL to invoke agent
    organization_name: str        # Who built it
    organization_url: str         # Organization website

Examples

Basic Search

from payelink_agent_search import AgentSearchClient

client = AgentSearchClient()
response = client.search("Find weather agents")

if response.success:
    print(f"Found {len(response.agents)} agents")
    for agent in response.agents:
        print(f"- {agent.agent_name}")

client.close()

Filtered Search

client = AgentSearchClient()

# Find agents with specific constraints
response = client.search(
    query="Financial services",
    country="KE",                               # Only agents from Kenya
    capability="streaming",                     # or "pushNotifications"
    default_input_mode=["text/plain", "application/json"],
    default_output_mode=["text/plain", "text/markdown"],
    max_result=5                                # Top 5 matches (default is 10)
)

if response.success:
    for agent in response.agents:
        print(f"{agent.agent_name} - {agent.organization_name}")
else:
    print(f"Error: {response.error}")

client.close()

Allowed values:

  • capability: "streaming" or "pushNotifications"
  • default_input_mode / default_output_mode: "text/plain", "application/json", "text/markdown"

Error Handling

from payelink_agent_search import AgentSearchClient
from payelink_agent_search.errors import SdkError

client = AgentSearchClient()

try:
    response = client.search("test query")
    
    if not response.success:
        print(f"Error: {response.error}")
    else:
        print(f"Success! Found {len(response.agents)} agents")
        
except SdkError as e:
    print(f"SDK Error: {e}")
finally:
    client.close()

Async Example

import asyncio
from payelink_agent_search import AsyncAgentSearchClient
from payelink_agent_search.errors import SdkError

async def main():
    async with AsyncAgentSearchClient() as client:
        try:
            response = await client.search("test query")
            
            if not response.success:
                print(f"Error: {response.error}")
            else:
                print(f"Success! Found {len(response.agents)} agents")
                
        except SdkError as e:
            print(f"SDK Error: {e}")

asyncio.run(main())

Why Use This?

Problem

  • No unified way to discover them
  • Manual configuration for each integration
  • Agents can't find other agents to collaborate

Solution

  • One search across all protocols
  • Automatic discovery of agent endpoints
  • Ranked results (most relevant first)
  • Rich metadata (capabilities, organization, endpoints)

Use Cases

1. Agent-to-Agent Collaboration

# Supervisor agent needs a helper
payment_agent = client.search("payment processing KES").agents[0]
# Now supervisor can call payment_agent.agent_card_url

2. Dynamic Agent Selection

# Choose best agent at runtime (not hardcoded)
agents = client.search("translation Spanish to English", max_result=3)
best_agent = agents.agents[0]  # Highest ranked

3. Multi-Agent Workflows

# Build workflows from discovered agents
translator = client.search("translation").agents[0]
analyzer = client.search("sentiment analysis").agents[0]
mailer = client.search("email agent").agents[0]
# Chain them together

Requirements

  • Python >= 3.8
  • httpx >= 0.24.0
  • pydantic >= 2.0.0

Error Types

  • SdkError - Base error class
  • HttpStatusError - HTTP 4xx/5xx errors
  • NetworkError - Network failures
  • TimeoutError - Request timeouts
  • InvalidResponseError - Malformed responses

Links

License

MIT License


Making AI agents discoverable • Built for the Agent 2.0 era

Metadata

Release files for payelink-agent-search 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for payelink-agent-search 0.1.7
File Size Uploaded Provenance Actions
payelink_agent_search-0.1.7.tar.gz 6.8 kB With provenance Details for payelink_agent_search-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for payelink-agent-search 0.1.7
File Interpreter ABI Platform Actions
payelink_agent_search-0.1.7-py3-none-any.whl Python 3 none any Details for payelink_agent_search-0.1.7-py3-none-any.whl

Total release size: 16.1 kB

Security for payelink-agent-search 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page