Skip to content

Feedback

Complete guide to giving feedback, managing reputation, and using feedback data to evaluate agents.

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 client 0x742d... to agent 11155111:123

See Models Reference for detailed ID format documentation.

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 categorization
feedback_file = sdk.prepareFeedback(
agentId="11155111:123",
score=85, # 0-100 (MANDATORY)
tags=["data_analyst", "finance"], # Optional
capability="tools", # Optional
skill="python" # Optional
)

Agents sign feedback authorization for clients:

# Agent signs feedback auth for client
feedbackAuth = agent_sdk.signFeedbackAuth(
agentId="11155111:123",
clientAddress=client_address,
expiryHours=24
)
# Client prepares and submits feedback
feedback = client_sdk.giveFeedback(
agentId="11155111:123",
feedbackFile=feedback_file,
feedbackAuth=feedbackAuth
)

Mandatory fields:

  • agentId - The agent’s ID
  • score - 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 name
  • skill - A2A skill identifier
  • task - A2A task identifier
  • context - Dictionary with additional context information
  • proofOfPayment - Payment proof data for x402 payments
# Example with all optional fields
feedback_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
)
# Read feedback by ID
feedback = sdk.getFeedback("11155111:123:0xClient:0")
print(f"Score: {feedback.score}")
print(f"Tags: {feedback.tags}")
# Search feedback with filters
results = 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}")
# Get aggregated reputation
summary = sdk.getReputationSummary("11155111:123")
print(f"Average score: {summary['averageScore']}")
print(f"Total feedback: {summary['totalFeedback']}")
print(f"Score distribution: {summary['scoreDistribution']}")

Find agents by reputation:

# Find highly-rated agents
results = sdk.searchAgentsByReputation(
minAverageScore=80,
tags=["enterprise"],
capabilities=["code_generation"]
)
for agent in results['items']:
print(f"{agent.name}: {agent.extras['averageScore']}")
# Agent responds to feedback with refund acknowledgment
updated_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())
}
)
# Revoke feedback
sdk.revokeFeedback(
agentId="11155111:123",
clientAddress=client_address,
feedbackIndex=0
)
@dataclass
class 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 status

Note: Only score is mandatory when creating feedback. All other fields are optional and can be omitted for minimal on-chain-only feedback.