Intro
The Agent0 SDK uses a subgraph for fast agent discovery and search. The subgraph automatically indexes ERC-8004 data from the blockchain and IPFS, providing GraphQL queries for efficient agent search and filtering.
Automatic Subgraph Integration
Section titled “Automatic Subgraph Integration”The SDK automatically uses the Agent0 subgraph - no configuration needed:
# SDK automatically uses the default subgraphsdk = SDK( chainId=11155111, rpcUrl="https://sepolia.infura.io/v3/YOUR_PROJECT_ID", signer=your_private_key)
# All search operations use the subgraph automaticallyresults = sdk.searchAgents(name="AI")// SDK automatically uses the default subgraphconst sdk = new SDK({ chainId: 11155111, rpcUrl: 'https://sepolia.infura.io/v3/YOUR_PROJECT_ID', signer: yourPrivateKey,});
// All search operations use the subgraph automatically (async in TypeScript)const results = await sdk.searchAgents({ name: 'AI' });Override Subgraph URL
Section titled “Override Subgraph URL”You can override the default subgraph URL using subgraphOverrides if needed:
# Use a custom subgraph endpoint for specific chainssdk = SDK( chainId=11155111, rpcUrl=RPC_URL, signer=PRIVATE_KEY, subgraphOverrides={ 11155111: "https://gateway.thegraph.com/api/00a452ad3cd1900273ea62c1bf283f93/subgraphs/id/6wQRC7geo9XYAhckfmfo8kbMRLeWU8KQd3XsJqFKmZLT" })// Use a custom subgraph endpoint for specific chainsconst sdk = new SDK({ chainId: 11155111, rpcUrl: RPC_URL, signer: PRIVATE_KEY, subgraphOverrides: { 11155111: 'https://gateway.thegraph.com/api/00a452ad3cd1900273ea62c1bf283f93/subgraphs/id/6wQRC7geo9XYAhckfmfo8kbMRLeWU8KQd3XsJqFKmZLT', },});Supported Networks
Section titled “Supported Networks”Currently supported:
- Ethereum Sepolia:
https://gateway.thegraph.com/api/00a452ad3cd1900273ea62c1bf283f93/subgraphs/id/6wQRC7geo9XYAhckfmfo8kbMRLeWU8KQd3XsJqFKmZLT
Coming soon:
- Base Sepolia
- Ethereum Mainnet
- Base Mainnet
- Additional networks
What the Subgraph Provides
Section titled “What the Subgraph Provides”The subgraph indexes:
- Agent registrations - Identity, metadata, endpoints
- Agent capabilities - MCP tools/prompts/resources, A2A skills/tasks
- Feedback data - Scores, tags, reputation signals
- Real-time updates - Automatic indexing of new registrations and feedback
Benefits
Section titled “Benefits”- Fast search - Query thousands of agents in milliseconds
- Rich filtering - Search by capabilities, reputation, trust models
- Real-time data - Always up-to-date with blockchain events
- No RPC limits - Avoid rate limits on blockchain queries
Next Steps
Section titled “Next Steps”- Explore Data Structures
- See Example Queries