Skip to content

Configure Agents

Learn how to create, configure, and manage agents with all available fields and options.

Create a new agent in memory (not yet registered):

from agent0_sdk import SDK
# Initialize SDK
sdk = SDK(
chainId=11155111,
rpcUrl="https://sepolia.infura.io/v3/YOUR_PROJECT_ID",
signer=your_private_key,
ipfs="pinata",
pinataJwt=your_pinata_jwt
)
# Create an agent
agent = sdk.createAgent(
name="My AI Agent",
description="An intelligent assistant that helps with various tasks. Skills: data analysis, code generation, natural language processing. Pricing: $0.10 per request, free tier available.",
image="https://example.com/agent-image.png" # Optional
)
# Update basic information
agent.updateInfo(
name="Updated Agent Name",
description="Updated description",
image="https://example.com/new-image.png"
)
# Set agent as active/inactive
agent.setActive(True) # Active (visible in searches)
agent.setActive(False) # Inactive (hidden but not deleted)
# Enable/disable x402 payment support
agent.setX402Support(True)
# Set MCP endpoint
agent.setMCP(endpoint="https://mcp.example.com/")

When you set an MCP endpoint, the SDK automatically:

  • Fetches tools, prompts, and resources from the endpoint
  • Populates the agent’s capabilities
# Set A2A endpoint
agent.setA2A(agentcard="https://a2a.example.com/agent-card.json")

The SDK automatically:

  • Fetches skills from the A2A agent card
  • Indexes capabilities for search
# Set ENS name
agent.setENS(name="myagent.eth")

This stores the ENS name both:

  • In the registration file
  • As on-chain metadata
# Remove specific endpoint type
agent.removeEndpoint(type=EndpointType.MCP)
# Remove by value
agent.removeEndpoint(value="https://old-endpoint.com")
# Remove all endpoints
agent.removeEndpoints()

TypeScript Note: removeEndpoint and removeEndpoints methods are not available in the TypeScript SDK. Manually filter endpoints from the registration file instead.

# Set agent wallet address
agent.setAgentWallet(
addr="0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
chainId=11155111 # Optional: defaults to SDK's chain ID
)

The wallet address is stored as:

  • agentWallet endpoint in the registration file
  • agentWallet metadata on-chain
# Using convenience method
agent.setTrust(
reputation=True,
cryptoEconomic=True,
teeAttestation=False
)

Available trust models:

  • reputation - On-chain feedback system
  • crypto-economic - Economic stake and slashing
  • tee-attestation - Trusted execution environment proofs
# Set on-chain metadata (stored on blockchain)
agent.setMetadata({
"version": "1.0.0",
"category": "developer-tools",
"pricing": "free"
})
# Get metadata
metadata = agent.getMetadata()
print(metadata)

Metadata is stored as on-chain key-value pairs in the Identity Registry contract.

Load an agent that’s already registered for editing:

# Load by agent ID
# Format: "chainId:tokenId" (e.g., "11155111:123")
# where 11155111 is the Sepolia chain ID and 123 is the agent's token ID
agent = sdk.loadAgent("11155111:123")
# All fields are automatically loaded
print(f"Name: {agent.name}")
print(f"Description: {agent.description}")
print(f"MCP: {agent.mcpEndpoint}")

Difference between loadAgent() and getAgent():

  • sdk.loadAgent(agentId) - Returns an Agent object that can be modified and re-registered (loads registration file from IPFS/HTTP)
  • sdk.getAgent(agentId) - Returns an AgentSummary object with read-only data (queries subgraph for fast access)

All agent data can be accessed directly:

# Identity
agent.agentId # "11155111:123"
agent.agentURI # "ipfs://Qm..."
agent.name # "My Agent"
agent.description # "Description text"
agent.image # "https://..."
# Status
agent.active # True/False
agent.x402support # True/False
# Wallet
agent.walletAddress # "0x..."
agent.walletChainId # 11155111
# Endpoints (convenience properties)
agent.mcpEndpoint # "https://..."
agent.a2aEndpoint # "https://..."
agent.ensEndpoint # "myagent.eth"
# Capabilities (populated from endpoints)
agent.mcpTools # ["tool1", "tool2", ...]
agent.mcpPrompts # ["prompt1", "prompt2", ...]
agent.mcpResources # ["resource1", ...]
agent.a2aSkills # ["skill1", "skill2", ...]
# Lists (read-only)
agent.endpoints # List[Endpoint]
agent.trustModels # List[TrustModel]
agent.metadata # Dict[str, Any]
agent.owners # List[str]
agent.operators # List[str]
agent.updatedAt # Unix timestamp
# Create agent
agent = sdk.createAgent(
name="My AI Agent",
description="A powerful AI assistant",
image="https://example.com/agent.png"
)
# Set endpoints
agent.setMCP("https://mcp.example.com/")
agent.setA2A("https://a2a.example.com/agent.json")
agent.setENS("myagent.eth")
# Configure wallet
agent.setAgentWallet("0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", chainId=1)
# Set trust models
agent.setTrust(reputation=True, cryptoEconomic=True)
# Add metadata
agent.setMetadata({
"version": "1.0.0",
"language": "python",
"framework": "agent0"
})
# Set status flags
agent.setActive(True)
agent.setX402Support(False)
# Now ready to register!
print(f"Agent configured: {agent.name}")