Feedback
Complete guide to giving feedback, managing reputation, and using feedback data to evaluate agents.
Feedback ID Format
Section titled “Feedback ID Format”Feedback IDs follow the format "agentId:clientAddress:feedbackIndex":
- agentId: The agent’s ID in
"chainId:tokenId"format (e.g.,"11155111:123") - clientAddress: Ethereum address of the feedback giver (normalized to lowercase)
- feedbackIndex: Sequential index of feedback from this client to this agent (0-based)
- Example:
"11155111:123:0x742d35cc6634c0532925a3b844bc9e7595f0beb7:0"= First feedback from client0x742d...to agent11155111:123
See Models Reference for detailed ID format documentation.
Prepare Feedback
Section titled “Prepare Feedback”The prepareFeedback() method creates a feedback file. Only score is mandatory - all other fields are optional.
# Minimal feedback (only mandatory score)feedback_file = sdk.prepareFeedback( agentId="11155111:123", score=85 # 0-100 (MANDATORY))
# With optional categorizationfeedback_file = sdk.prepareFeedback( agentId="11155111:123", score=85, # 0-100 (MANDATORY) tags=["data_analyst", "finance"], # Optional capability="tools", # Optional skill="python" # Optional)// Minimal feedback (only mandatory score)const feedbackFile = sdk.prepareFeedback( '11155111:123', 85 // 0-100 (MANDATORY));
// With optional categorizationconst feedbackFileWithDetails = sdk.prepareFeedback( '11155111:123', 85, // 0-100 (MANDATORY) ['data_analyst', 'finance'], // Optional: tags undefined, // text 'tools', // Optional: capability undefined, // name 'python' // Optional: skill);Give Feedback
Section titled “Give Feedback”With Authorization
Section titled “With Authorization”Agents sign feedback authorization for clients:
# Agent signs feedback auth for clientfeedbackAuth = agent_sdk.signFeedbackAuth( agentId="11155111:123", clientAddress=client_address, expiryHours=24)
# Client prepares and submits feedbackfeedback = client_sdk.giveFeedback( agentId="11155111:123", feedbackFile=feedback_file, feedbackAuth=feedbackAuth)// Agent signs feedback auth for client (async in TypeScript)const feedbackAuth = await agentSdk.signFeedbackAuth( '11155111:123', clientAddress, undefined, // indexLimit 24 // expiryHours);
// Client prepares and submits feedback (async in TypeScript)const feedback = await clientSdk.giveFeedback( '11155111:123', feedbackFile, feedbackAuth);Feedback Parameters
Section titled “Feedback Parameters”Mandatory fields:
agentId- The agent’s IDscore- Rating from 0-100
Optional fields:
tags- List of categorization tags (e.g., [“data_analyst”, “finance”])capability- MCP capability type (“tools”, “prompts”, “resources”)name- MCP tool/resource/prompt nameskill- A2A skill identifiertask- A2A task identifiercontext- Dictionary with additional context informationproofOfPayment- Payment proof data for x402 payments
# Example with all optional fieldsfeedback_file = sdk.prepareFeedback( agentId="11155111:123", # Mandatory score=85, # Mandatory: 0-100 tags=["data_analyst", "finance"], # Optional: Categorization capability="tools", # Optional: MCP capability name="code_generation", # Optional: MCP tool name skill="python", # Optional: A2A skill task="debug_code", # Optional: A2A task context={"environment": "dev"} # Optional: Additional context)
# Minimal example (only mandatory fields)feedback_file = sdk.prepareFeedback( agentId="11155111:123", score=85)// Example with all optional fieldsconst feedbackFile = sdk.prepareFeedback( '11155111:123', // Mandatory: agentId 85, // Mandatory: score (0-100) ['data_analyst', 'finance'], // Optional: tags undefined, // Optional: text 'tools', // Optional: capability (MCP capability) 'code_generation', // Optional: name (MCP tool name) 'python', // Optional: skill (A2A skill) 'debug_code', // Optional: task (A2A task) { environment: 'dev' }, // Optional: context undefined, // Optional: proofOfPayment undefined // Optional: extra);
// Minimal example (only mandatory fields)const minimalFeedbackFile = sdk.prepareFeedback( '11155111:123', 85);Read Feedback
Section titled “Read Feedback”Get Single Feedback
Section titled “Get Single Feedback”# Read feedback by IDfeedback = sdk.getFeedback("11155111:123:0xClient:0")print(f"Score: {feedback.score}")print(f"Tags: {feedback.tags}")// Read feedback by ID// Note: In TypeScript, getFeedback requires separate paramsconst feedback = await sdk.getFeedback( '11155111:123', '0xClient', // clientAddress 0 // feedbackIndex);console.log(`Score: ${feedback.score}`);console.log(`Tags: ${feedback.tags}`);Search Feedback
Section titled “Search Feedback”# Search feedback with filtersresults = sdk.searchFeedback( agentId="11155111:123", capabilities=["tools"], skills=["python"], tags=["data_analyst"], minScore=80, maxScore=100)
for fb in results: print(f"{fb.score}/100: {fb.tags}")// Search feedback with filters (async in TypeScript)const results = await sdk.searchFeedback( '11155111:123', ['data_analyst'], // tags ['tools'], // capabilities ['python'], // skills 80, // minScore 100 // maxScore);
for (const fb of results) { console.log(`${fb.score}/100: ${fb.tags.join(', ')}`);}Reputation Summary
Section titled “Reputation Summary”# Get aggregated reputationsummary = sdk.getReputationSummary("11155111:123")
print(f"Average score: {summary['averageScore']}")print(f"Total feedback: {summary['totalFeedback']}")print(f"Score distribution: {summary['scoreDistribution']}")// Get aggregated reputation (async in TypeScript)// Note: TypeScript version returns count and averageScore onlyconst summary = await sdk.getReputationSummary('11155111:123');
console.log(`Average score: ${summary.averageScore}`);console.log(`Total feedback: ${summary.count}`);// Note: scoreDistribution is not available in TypeScript SDKAgent Reputation Search
Section titled “Agent Reputation Search”Find agents by reputation:
# Find highly-rated agentsresults = sdk.searchAgentsByReputation( minAverageScore=80, tags=["enterprise"], capabilities=["code_generation"])
for agent in results['items']: print(f"{agent.name}: {agent.extras['averageScore']}")// Find highly-rated agents (async in TypeScript)const results = await sdk.searchAgentsByReputation( 80, // minAverageScore ['enterprise'], // tags ['code_generation'], // capabilities undefined // skills);
for (const agent of results.items) { console.log(`${agent.name}: ${agent.extras.averageScore}`);}Manage Feedback
Section titled “Manage Feedback”Append Response
Section titled “Append Response”# Agent responds to feedback with refund acknowledgmentupdated_feedback = sdk.appendResponse( agentId="11155111:123", clientAddress=client_address, feedbackIndex=0, response={ "message": "We apologize for the poor service. A full refund has been processed.", "refundTxHash": "0x1234567890abcdef...", "refundAmount": "0.1 ETH", "timestamp": int(time.time()) })// Agent responds to feedback with refund acknowledgment (async in TypeScript)// Note: In TypeScript, response is provided as uri and hash separatelyconst responseUri = 'ipfs://QmExampleResponse'; // IPFS URI of response fileconst responseHash = '0x' + '00'.repeat(32); // Hash of response content
const txHash = await sdk.appendResponse( '11155111:123', clientAddress, 0, // feedbackIndex { uri: responseUri, hash: responseHash, });console.log(`Response appended. Transaction: ${txHash}`);Revoke Feedback
Section titled “Revoke Feedback”# Revoke feedbacksdk.revokeFeedback( agentId="11155111:123", clientAddress=client_address, feedbackIndex=0)// Revoke feedback (async in TypeScript)// Note: clientAddress is automatically determined from the signerconst txHash = await sdk.revokeFeedback( '11155111:123', 0 // feedbackIndex);console.log(`Feedback revoked. Transaction: ${txHash}`);Feedback Data Structure
Section titled “Feedback Data Structure”@dataclassclass Feedback: id: str # Unique feedback ID agentId: str # Agent identifier reviewer: str # Client address score: float # 0-100 rating (MANDATORY) tags: Optional[List[str]] # Categorization tags (optional) capability: Optional[str] # MCP capability type (optional) name: Optional[str] # MCP tool/resource/prompt name (optional) skill: Optional[str] # A2A skill (optional) task: Optional[str] # A2A task (optional) context: Optional[dict] # Additional context (optional) fileURI: Optional[str] # IPFS/HTTPS URI (if feedback file exists) createdAt: int # Timestamp answers: List[dict] # Responses isRevoked: bool # Revocation statusNote: Only score is mandatory when creating feedback. All other fields are optional and can be omitted for minimal on-chain-only feedback.