Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • Subgraphs
    • Substreams
      • The Graph’s AI
      • Indexing
        • Graph Horizon
          • Resources
            Subgraphs > How-to Guides

            4 minutes

            Agent0 Subgraphs (ERC-8004)

            The Agent0 Subgraphs index the ERC-8004 Trustless Agents⁠ registries — Identity, Reputation, and Validation — across five major networks. They give developers a single GraphQL interface to discover agents, filter by capability, query reputation, and track validation outcomes in real time.

            Built and maintained by Agent0⁠ in partnership with The Graph.

            Note: Agent0 Subgraphs are a public good. The schema, mappings, and deployment configs are open-source and available at github.com/agent0lab/subgraph⁠.

            Supported networks

            NetworkChain IDStatusEndpointExplorer
            Ethereum Mainnet1✅ DeployedEndpoint⁠Explorer
            Base Mainnet8453✅ DeployedEndpoint⁠Explorer
            BSC Mainnet56✅ DeployedEndpoint⁠Explorer
            Polygon Mainnet137✅ DeployedEndpoint⁠Explorer
            Monad143✅ DeployedEndpointExplorer
            Ethereum Sepolia11155111✅ DeployedEndpoint⁠Explorer
            Base Sepolia84532✅ DeployedEndpoint⁠Explorer
            BSC Chapel97✅ DeployedEndpoint⁠Explorer
            Monad Testnet10143✅ DeployedEndpoint⁠Explorer
            Polygon Amoy80002⛔️ Subgraphs not deployed--
            Linea Sepolia59141⛔️ Subgraphs not deployed--
            Hedera Testnet296⛔️ Subgraphs not deployed--
            HyperEVM Testnet998⛔️ Subgraphs not deployed--
            SKALE Base Sepolia1351057110⛔️ Subgraphs not deployed--

            A single GraphQL schema is shared across all available deployments, so the same query works on every chain — only the endpoint URL changes.

            What’s indexed

            DomainData
            Agent registrationsIdentity (ERC-721 token), owner, operators, registration URI, ENS, DID, agent wallet, x402 support, supported trust models, name, description, image
            CapabilitiesMCP endpoint, version, tools, prompts, resources. A2A endpoint, version, skills. OASF taxonomy tags
            FeedbackScore (0–100), tags, client address, off-chain feedback file (text, capability, skill, task, proof of payment), revocation status, responses
            ValidationValidator address, request/response URIs, score, tag, status (pending, completed, expired)
            AggregatesPer-agent stats (avg score, score distribution, totals), per-chain protocol entity, global cross-chain rollup

            Off-chain registration and feedback files (IPFS or HTTPS) are fetched and parsed via File Data Sources, so JSON metadata is queryable alongside on-chain events — no separate IPFS round trip required from the client.

            Why use the Subgraph

            • Fast search: Query thousands of agents in milliseconds. Filter by capability, score, trust model, or chain.
            • Rich filtering: Combine on-chain and off-chain fields in a single GraphQL query.
            • Real-time data: New registrations, feedback, and validation events are indexed automatically as they’re emitted.
            • No RPC limits: Skip rate-limited RPC scans and IPFS round-trips. One query, one response.

            Quick start

            1. Get an API key

            Create a free account on Subgraph Studio and generate an API key.

            2. Find your endpoint

            Search agent0 on Graph Explorer and copy the Subgraph ID for the network you want. Endpoints follow this pattern:

            1https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>

            3. Run a query

            cURL

            1curl -X POST \2  -H "Content-Type: application/json" \3  -d '{"query": "{ agents(first: 5) { id registrationFile { name description mcpEndpoint } } }"}' \4  https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>

            TypeScript

            1const res = await fetch(`https://gateway.thegraph.com/api/${API_KEY}/subgraphs/id/${SUBGRAPH_ID}`, {2  method: 'POST',3  headers: { 'Content-Type': 'application/json' },4  body: JSON.stringify({5    query: `{6        agents(first: 5) {7          id8          registrationFile { name description mcpEndpoint }9        }10      }`,11  }),12})13const { data } = await res.json()

            Python

            1import requests23url = f"https://gateway.thegraph.com/api/{API_KEY}/subgraphs/id/{SUBGRAPH_ID}"4query = """{5  agents(first: 5) {6    id7    registrationFile { name description mcpEndpoint }8  }9}"""10res = requests.post(url, json={"query": query}).json()

            Tip: Using the Agent0 SDK⁠? Subgraph endpoints are wired up by default — you can call sdk.searchAgents(...) and sdk.searchFeedback(...) without writing GraphQL by hand.

            Common queries

            Find MCP-compatible agents

            1query GetMCPAgents {2  agentRegistrationFiles(where: { mcpEndpoint_not: null, active: true }, first: 100) {3    agentId4    name5    description6    mcpEndpoint7    mcpVersion8    mcpTools9    supportedTrusts10  }11}

            Get a complete agent profile

            1query GetAgent {2  agent(id: $id) {3    # example: "8453:0"4    id5    chainId6    agentId7    owner8    createdAt9    totalFeedback10    registrationFile {11      name12      description13      image14      mcpEndpoint15      mcpTools16      a2aEndpoint17      a2aSkills18      supportedTrusts19      x402Support20      ens21      did22    }23    feedback(where: { isRevoked: false }, first: 10, orderBy: createdAt, orderDirection: desc) {24      tag125      tag226      clientAddress27      feedbackFile {28        text29      }30    }31    validations(orderBy: createdAt, orderDirection: desc) {32      validatorAddress33      response34      status35      tag36    }37  }38}

            The agent id is formatted as chainId:agentId (e.g. 8453:1247 for agent 1247 on Base).

            Filter agents by trust model

            1query AgentsByTrust($trustModel: String!) {2  agentRegistrationFiles(where: { supportedTrusts_contains: [$trustModel], active: true }, first: 50) {3    agentId4    name5    description6    supportedTrusts7  }8}

            Common values: "reputation", "cryptoeconomic", "tee-attestation".

            Top-rated feedback across the network

            1query TopFeedback {2  feedbacks(where: { isRevoked: false, value_gte: 1000 }, first: 50, orderBy: value, orderDirection: desc) {3    value4    tag15    tag26    agent {7      id8      registrationFile {9        name10      }11    }12    feedbackFile {13      text14    }15  }16}

            Schema reference

            Core entities:

            • Agent: Onchain identity, mutable. Linked to AgentRegistrationFile, Feedback[], Validation[], AgentStats.
            • AgentRegistrationFile: Immutable, parsed from the IPFS/HTTPS registration URI. Contains all advertised capabilities.
            • Feedback: Onchain feedback entry. Linked to optional FeedbackFile for off-chain text and proof of payment.
            • FeedbackFile: Immutable, parsed from the feedback URI.
            • Validation: Validation request and response lifecycle. Status: PENDING, COMPLETED, EXPIRED.
            • protocolAgentStats: Per-agent rollup (total feedback, average score, score distribution).
            • Protocol: Per-chain rollup.

            Full schema: schema.graphql⁠.

            Resources

            • Agent0 SDK: TypeScript and Python SDK for ERC-8004 registration, discovery, and reputation: sdk.ag0.xyz/docs⁠
            • Subgraph repo: Open-source mappings, schema, and multi-chain deployment config: github.com/agent0lab/subgraph⁠
            • ERC-8004 spec: The Trustless Agents standard: eips.ethereum.org/EIPS/eip-8004⁠
            • Graph Explorer: Browse all Agent0 Subgraphs: thegraph.com/explorer?search=agent0
            ⁠Edit on GitHub⁠

            Query Polymarket Datax402 Subgraph Payments
            On this page
            • Supported networks
            • What’s indexed
            • Why use the Subgraph
            • Quick start
            • 1. Get an API key
            • 2. Find your endpoint
            • 3. Run a query
            • Common queries
            • Find MCP-compatible agents
            • Get a complete agent profile
            • Filter agents by trust model
            • Top-rated feedback across the network
            • Schema reference
            • Resources
            The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service