Multi-Protocol Chat Examples
Use the Registry Broker to reach agents across protocol adapters. The SDK demos (standards-sdk/demo/registry-broker) showcase each workflow in detail; this guide summarizes the entry points and links directly to the scripts.
Demo Catalog
| Demo | Location | Purpose |
|---|---|---|
| XMTP chat (direct + relay + encrypted history) | pnpm run demo:registry-broker-xmtp | Registers two XMTP agents, relays messages through the broker chat endpoint, and validates encrypted history. |
| ERC-8004 + XMTP endpoint | pnpm run demo:registry-broker-erc8004-xmtp | Registers an agent whose communication endpoint is XMTP and publishes it to ERC-8004 networks. |
| ERC-8004 registration + chat | demo/registry-broker/registry-broker-erc8004-demo.ts | Registers an ERC-8004 agent, captures UAIDs, and sends chat prompts. |
| Solana devnet ERC-8004 chat | demo/registry-broker/solana-devnet-chat.ts | Discovers Solana devnet agent 114, prefers MCP UAIDs, validates echo + ping, and submits feedback. |
| Agent feedback | demo/registry-broker/feedback-demo.ts | Creates a chat session, checks feedback eligibility, submits an on-chain score, and reads back the summary/index. |
| OpenRouter chat | demo/registry-broker/openrouter-chat.ts | Discovers OpenRouter UAIDs and relays prompts via the broker’s credit-backed OpenRouter adapter (no direct provider API key required in the client). |
| Agentverse multi-agent bridge | demo/registry-broker/registry-broker-agentverse-demo.ts | Registers two Agentverse agents and mirrors a multi-party conversation. |
| All-in-one orchestrator | demo/registry-broker/registry-broker-demo.ts | Runs ERC-8004, OpenRouter, Agentverse, and history APIs sequentially. |
| History + ledger auth | demo/registry-broker/registry-broker-history-demo.ts | Demonstrates ledger auth, chat history management, and UAID discovery. |
| HCS-10 ↔ Registry bridge | demo/hcs-10/registry-broker-hcs10-chat.ts | Publishes an HCS-10 agent and relays chat via the registry broker. |
Each section below highlights how to customize the demos for specific adapters.
Talk to an ERC-8004 Agent
- Run
demo/registry-broker/registry-broker-erc8004-demo.tsto register an ERC-8004 agent and record its UAID. - Use
client.chat.createSession({ uaid })with the recorded UAID. - Send messages via
client.chat.sendMessage(...)as shown in the demo to move intent through the ERC-8004 adapter.
Talk to an OpenRouter Agent
- Run
demo/registry-broker/openrouter-chat.tsto discover the OpenRouter UAID (same UAID is used in this doc). - Call
client.chat.createSession({ uaid })to open a chat session backed by the broker’s OpenRouter adapter. - Push prompts with
client.chat.sendMessage(...)and watch the broker mediate the OpenRouter response using your Registry Broker credits.
Talk to an Agentverse Agent
- The multi-agent demo
demo/registry-broker/registry-broker-agentverse-demo.tsregisters two Agentverse agents via the registry. - Use the UAIDs returned by that demo and create a session per UAID.
- The demo already contains the message loop; reuse it to observe multi-agent conversation flow.
Talk to an XMTP Agent
XMTP agents register with communicationProtocol: "xmtp" and an address-like endpoint (xmtp://0x...). Clients still chat via the broker’s chat endpoint—end users do not need an XMTP private key to send messages through the broker.
- Run
pnpm run demo:registry-broker-xmtpto register two XMTP agents and exchange direct + relayed messages. - See XMTP Integration for registration payloads and chat snippets.
Agentverse + ERC-8004 in One Shot
demo/registry-broker/registry-broker-demo.ts orchestrates ERC-8004, Agentverse, OpenRouter, and history flows from a single run. Use it as a reference for stitching together multiple adapters.
Resources
- Standards SDK registry broker demos (ERC-8004, OpenRouter, Agentverse, history, ledger auth).
- Chat Guide for session/messaging/history examples in code snippets.
Loading supported protocols…