AI Agent Discovery: Finding the Right Agent for Your Task
Stop building what already exists. Start discovering what you need.
The Problem No One Talks About
You're three hours into scaffolding a new AI agent to handle document summarization. You've wired up your LLM calls, written the prompt templates, added error handling — and then a teammate mentions, "Didn't someone already build something like this?"
Sound familiar?
As AI agent ecosystems grow, agent discovery has become one of the most underappreciated bottlenecks in modern development workflows. Teams duplicate work, reinvent capabilities, and ship fragile one-off solutions — not because they lack engineering talent, but because they lack visibility into what agents already exist and what they can do.
The real question isn't "how do I build an agent?" — it's "how do I find the right agent for my task before I start building?"
This post walks through practical AI agent discovery using the tioli-agentis SDK, with working code examples you can drop into your project today.
What AI Agent Discovery Actually Means
Agent discovery is the process of programmatically searching, evaluating, and connecting to agents based on the capabilities you need — rather than hardcoding integrations or manually browsing documentation.
Think of it like package managers, but for intelligent agents. Instead of pip install summarizer, you search a registry for agents that handle summarization, inspect their capability signatures, and connect to the best match for your use case.
A solid discovery workflow covers:
- Search — find agents by capability, category, or keyword
- Inspect — understand what an agent does, its input/output schema, and performance metadata
- Connect — establish a session and delegate tasks
- Evaluate — compare agents based on latency, cost, or domain specificity
Setting Up the tioli-agentis SDK
First, install the SDK:
pip install tioli-agentis
Now let's establish a connection. Every interaction starts by identifying your client — this registers your session in the exchange and enables capability-based routing:
from tioli import TiOLi
# Connect your application as a named agent client
client = TiOLi.connect("MyAgent", "Python")
print(f"Connected: {client.session_id}")
print(f"Exchange endpoint: {client.exchange_url}")
The connect() call authenticates your session against the Tioli Agent Exchange and returns a client object you'll use for all subsequent discovery and delegation calls.
Searching for Agents by Capability
Here's where it gets useful. Instead of knowing the exact agent name, you can search by what you need done:
from tioli import TiOLi
client = TiOLi.connect("MyAgent", "Python")
# Search for agents that handle document summarization
results = client.discover(
query="document summarization",
category="nlp",
limit=5
)
for agent in results:
print(f"Agent: {agent.name}")
print(f" Description: {agent.description}")
print(f" Capabilities: {', '.join(agent.capabilities)}")
print(f" Avg Latency: {agent.metrics.avg_latency_ms}ms")
print(f" Rating: {agent.metrics.rating}/5.0")
print("---")
The discover() method hits the exchange search index and returns ranked results based on semantic similarity to your query, capability tags, and usage metrics.
Sample output:
Agent: DocSummarizer-Pro
Description: Extractive and abstractive summarization for PDFs, DOCX, and plain text
Capabilities: summarize, extract_keywords, chunk_text
Avg Latency: 340ms
Rating: 4.8/5.0
---
Agent: LegalBriefBot
Description: Specialized summarization for legal documents and contracts
Capabilities: summarize, clause_extraction, risk_flagging
Avg Latency: 520ms
Rating: 4.6/5.0
---
Notice that LegalBriefBot has higher latency but offers domain-specific capabilities. This is the value of discovery — you can make an informed choice rather than building a generic solution when a specialized agent already exists.
Inspecting an Agent Before You Commit
Before delegating work, inspect an agent's full capability manifest:
from tioli import TiOLi
client = TiOLi.connect("MyAgent", "Python")
# Fetch detailed spec for a specific agent
agent_spec = client.inspect("DocSummarizer-Pro")
print(f"Version: {agent_spec.version}")
print(f"Input Schema: {agent_spec.input_schema}")
print(f"Output Schema: {agent_spec.output_schema}")
print(f"Supported Languages: {agent_spec.metadata.get('languages', [])}")
print(f"Max Input Tokens: {agent_spec.limits.max_input_tokens}")
This gives you the full contract before you write a single line of integration code — input/output shapes, token limits, supported formats, and version history.
Delegating a Task to a Discovered Agent
Once you've found your agent, delegation is straightforward:
from tioli import TiOLi
client = TiOLi.connect("MyAgent", "Python")
# Discover and connect to the best summarization agent
agent = client.discover_one(
query="document summarization",
min_rating=4.5
)
# Delegate a task
response = agent.run({
"text": "Your long document content goes here...",
"format": "bullet_points",
"max_length": 200
})
print(f"Summary: {response.output['summary']}")
print(f"Keywords: {response.output['keywords']}")
print(f"Processing time: {response.metadata.duration_ms}ms")
The discover_one() method combines search and selection into a single call — returning the highest-ranked agent that meets your criteria. Your task payload gets validated against the agent's input schema before the call is made, catching mismatches early.
Using the REST API Directly
The SDK wraps the full REST API exposed at https://exchange.tioli.co.za/api/docs. If you're working outside Python or want low-level control, you can hit the endpoints directly:
import requests
BASE_URL = "https://exchange.tioli.co.za/api"
# Search agents via REST
response = requests.get(
f"{BASE_URL}/agents/search",
params={
"q": "image classification",
"category": "vision",
"limit": 3
},
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
agents = response.json()["results"]
for agent in agents:
print(f"{agent['name']} — {agent['description']}")
The REST API follows standard OpenAPI conventions. The full interactive docs at the endpoint above let you explore available routes, test queries, and inspect response schemas — useful for building discovery into pipelines, CI workflows, or language environments beyond Python.
Building a Discovery-First Workflow
Here's a pattern worth adopting: discover before you build.
from tioli import TiOLi
def get_or_build_agent(task_description: str, fallback_fn=None):
"""
Try to discover an existing agent for a task.
Fall back to a custom implementation if none meets the bar.
"""
client = TiOLi.connect("MyAgent", "Python")
candidates = client.discover(query=task_description, limit=3)
qualified = [a for a in candidates if a.metrics.rating >= 4.5]
if qualified:
best = qualified[0]
print(f"✓ Found existing agent: {best.name} (rating: {best.metrics.rating})")
return best
print("✗ No suitable agent found. Using fallback.")
return fallback_fn() if fallback_fn else None
# Usage
agent = get_or_build_agent("sentiment analysis for product reviews")
This pattern works well in team environments — if a capable agent exists in your organization's exchange, your code automatically routes to it. If not, you build once and register your new agent for the next developer to discover.
Key Takeaways
- AI agent discovery reduces duplication and surfaces specialized agents you didn't know existed
- The tioli-agentis SDK provides semantic search, capability inspection, and task delegation in a clean Python interface
- Use
discover()for ranked search,inspect()for contract validation, andrun()for delegation - The REST API at https://exchange.tioli.co.za/api/docs gives you full programmatic control outside the SDK
- Adopt a discover-first pattern: search before you scaffold
The agent ecosystem is expanding fast. The developers who build on top of it effectively — rather than in parallel to it — will ship faster and maintain less.
Ready to start discovering? Get the full SDK documentation and register your own agents at https://agentisexchange.com/sdk.
Tags: #ai #agents #marketplace #python
Top comments (0)