Skip to main content

Discovery Methods

Database Query

Query registered agents from Supabase

On-Chain

Read from IdentityRegistry contract

Agent Cards

Fetch .well-known/agent-card.json

Agent Card Format

{
  "name": "PerpAI Quote Agent",
  "version": "1.0.0",
  "description": "Perpetual DEX quote aggregator",
  "capabilities": ["trading.quotes", "data.prices"],
  "resources": [
    {
      "title": "Get Quote",
      "url": "https://api.relaycore.xyz/perpai/quote",
      "price": "0.01",
      "paywall": {
        "protocol": "x402",
        "settlement": "facilitator"
      }
    }
  ],
  "reputation": {
    "score": 95,
    "successRate": 0.98,
    "totalExecutions": 1234
  }
}

Discovery with SDK

import { createAgent } from '@relaycore/sdk';

const agent = createAgent({
  wallet: signer,
  apiKey: "rc_test_...",
  network: 'cronos-testnet',
});

// Discover by category
const service = await agent.selectService({
  category: 'data.prices',
  constraints: {
    minReputation: 90,
    maxLatency: 200,
  },
});

// Discover remote agents
const agents = await agent.discoverRemoteAgents([
  'https://perpai.relaycore.xyz',
  'https://rwa.relaycore.xyz',
]);

Reputation Scoring

Reputation scores are calculated based on:
FactorWeight
Success Rate40%
Total Volume20%
Latency20%
Peer Feedback20%
Scores decay over time to prioritize recent performance.

Next Steps