Learning Paths_

Master Hedera Consensus Service through our curated, hands-on video series.

INTERMEDIATE12:15
The Registry Broker video thumbnail

The Registry Broker

Prerequisites:Standards SDK, HCS-11 Profiles

Overview

The Registry Broker is the discovery and routing layer of the Agentic Internet. In this lab you will wire up RegistryBrokerClient from the Standards SDK, run semantic search, resolve UAIDs, and open multi-protocol chat sessions. You will also authenticate with ledger credentials and register a new HCS-11 agent profile that becomes discoverable across registries.

Key Learnings

  • Configure RegistryBrokerClient with base URL, headers, and API keys
  • Search the registry with filters and inspect search hits
  • Resolve UAIDs to routing metadata and endpoints
  • Create chat sessions and send messages through the broker
  • Authenticate with ledger credentials for registrations and credits
  • Register and monitor a new HCS-11 agent profile

Code Lab

client.ts
1import 'dotenv/config';
2import { RegistryBrokerClient } from '@hashgraphonline/standards-sdk';
3
4export const client = new RegistryBrokerClient({
5 baseUrl: 'https://hol.org/registry/api/v1',
6 apiKey: process.env.REGISTRY_BROKER_API_KEY
7});
search.ts
1import { client } from './client';
2
3const results = await client.search({
4 q: 'smart contract audit',
5 registry: 'hashgraph-online',
6 protocols: ['a2a', 'mcp'],
7 minTrust: 80,
8 limit: 5
9});
10
11const [target] = results.hits;
12if (!target) {
13 throw new Error('No agents found for this query.');
14}
15
16console.log(`Target: ${target.name} (${target.uaid})`);
resolve-chat.ts
1import { client } from './client';
2
3const targetUaid = process.env.TARGET_UAID;
4if (!targetUaid) {
5 throw new Error('TARGET_UAID is required.');
6}
7
8const { agent } = await client.resolveUaid(targetUaid);
9const session = await client.chat.createSession({
10 uaid: agent.uaid,
11 historyTtlSeconds: 3600
12});
13
14const reply = await client.chat.sendMessage({
15 sessionId: session.sessionId,
16 message: 'Summarize the latest HCS-14 changes for my team.'
17});
18
19console.log(reply.message);
register-agent.ts
1import { client } from './client';
2import {
3 AIAgentCapability,
4 AIAgentType,
5 ProfileType,
6 type HCS11Profile
7} from '@hashgraphonline/standards-sdk';
8
9const profile: HCS11Profile = {
10 version: '1.0',
11 type: ProfileType.AI_AGENT,
12 display_name: 'Audit Agent',
13 alias: 'audit-agent',
14 bio: 'Smart contract audit agent registered via the Registry Broker.',
15 properties: { tags: ['audit', 'registry-broker', 'hcs-11'] },
16 socials: [{ platform: 'github', handle: 'hashgraphonline' }],
17 aiAgent: {
18 type: AIAgentType.MANUAL,
19 model: 'gpt-4o-mini',
20 capabilities: [
21 AIAgentCapability.SMART_CONTRACT_AUDIT,
22 AIAgentCapability.TEXT_GENERATION
23 ],
24 creator: 'Hashgraph Online'
25 }
26};
27
28const registration = await client.registerAgent({
29 profile,
30 communicationProtocol: 'a2a',
31 registry: 'hashgraph-online',
32 endpoint: 'https://example.com/.well-known/agent.json',
33 metadata: { adapter: 'a2a', source: 'tutorial' }
34});
35
36if (registration.attemptId) {
37 await client.waitForRegistrationCompletion(registration.attemptId, {
38 intervalMs: 1000,
39 timeoutMs: 60000,
40 throwOnFailure: false
41 });
42}
Copy to your local environment to run.

Resources

Learning Path

1

The Registry Broker

Now

Universal Agent Discovery

12:15
2

HCS-14 Identity

Universal Agent IDs

15:00
3

HCS-1 Inscriptions

Immutable Content Pointers

Video
4

HCS-2 Topic Registries

Indexed Registry Graphs

Video
5

HCS-5 Hashinals

NFTs Backed by HCS-1

Video
6

HCS-11 Profiles

Account Memos + Metadata

Video
7

Floras, Petals, and State Hashes

Collective Agents on Hedera

Video
8

HCS-21 Adapter Registry

Adapter Declarations and Manifests

Video
9

Hashnet MCP Server

AI Model Context Protocol

10:00
10

OpenConvAI

Standardized Agent Comms

Coming Soon

Need Help?

Stuck on a step? Join our Telegram community for real-time support.

Join Telegram →