Python client for the Payelink Agent Search API.
Project description
PayeLink Agent Discovery SDK
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 classHttpStatusError- HTTP 4xx/5xx errorsNetworkError- Network failuresTimeoutError- Request timeoutsInvalidResponseError- Malformed responses
Links
- Documentation: Full docs
- Issues: GitHub Issues
- Source: GitHub
License
MIT License
Making AI agents discoverable • Built for the Agent 2.0 era
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file payelink_agent_search-0.1.7.tar.gz.
File metadata
- Download URL: payelink_agent_search-0.1.7.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8abf544cd73c6c153795f66399572e4f779cf2f86b29893aacaedd361d8bae37
|
|
| MD5 |
c22600ba020ff0f6fd871fa0166e6c8c
|
|
| BLAKE2b-256 |
9940c627fb68b9ecfda01f2ed7fc67071f8d8c0f6fe8cafd648927251a648f9f
|
Provenance
The following attestation bundles were made for payelink_agent_search-0.1.7.tar.gz:
Publisher:
publish-pypi.yml on payelink/payelink-agent-search-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
payelink_agent_search-0.1.7.tar.gz -
Subject digest:
8abf544cd73c6c153795f66399572e4f779cf2f86b29893aacaedd361d8bae37 - Sigstore transparency entry: 859384701
- Sigstore integration time:
-
Permalink:
payelink/payelink-agent-search-sdk@b2dd3fa66b1bf305d76d637e39485e9675e046da -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/payelink
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b2dd3fa66b1bf305d76d637e39485e9675e046da -
Trigger Event:
push
-
Statement type:
File details
Details for the file payelink_agent_search-0.1.7-py3-none-any.whl.
File metadata
- Download URL: payelink_agent_search-0.1.7-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36ba6ba9300eee385072b0564aa07b0c8e1397c0d489bc704351b02778220dd9
|
|
| MD5 |
17df4a372a778f6a41d34d4806362531
|
|
| BLAKE2b-256 |
dc959fc14840c75368bf7ffcb677e3a74387c608dbdb7723b95566ab52ef8613
|
Provenance
The following attestation bundles were made for payelink_agent_search-0.1.7-py3-none-any.whl:
Publisher:
publish-pypi.yml on payelink/payelink-agent-search-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
payelink_agent_search-0.1.7-py3-none-any.whl -
Subject digest:
36ba6ba9300eee385072b0564aa07b0c8e1397c0d489bc704351b02778220dd9 - Sigstore transparency entry: 859384760
- Sigstore integration time:
-
Permalink:
payelink/payelink-agent-search-sdk@b2dd3fa66b1bf305d76d637e39485e9675e046da -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/payelink
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b2dd3fa66b1bf305d76d637e39485e9675e046da -
Trigger Event:
push
-
Statement type: