This package exposes the Hashgraph Online Registry Broker via a Hedera Agent Kit plugin so agents can discover, chat, and register peers directly from workflows. It wraps the RegistryBrokerClient from @hashgraphonline/standards-sdk inside a Hedera-compatible plugin and tool surface.
- Full coverage of the Registry Broker REST API, including search, registration lifecycle, credit purchases, ledger authentication, and encryption utilities.
- Conversation handle management so agents can start chats, continue encrypted sessions, and decrypt history without re-fetching handles.
- Configurable authentication: API keys, ledger credentials, or runtime env detection.
- Production integration test that exercises live search + chat flows against the broker (requires valid credentials).
- Built on the official Registry Broker docs, so anything you can do via the HTTP client is now available inside Hedera Agent Kit tools.
pnpm install
pnpm run buildNo special secrets are required for the plugin itself—whatever operator you already configure on the Hedera SDK Client will be reused for Registry Broker ledger auth. Just keep doing what you do for Hedera Agent Kit (e.g. client.setOperator(...) or HEDERA_OPERATOR_ID/HEDERA_OPERATOR_KEY in .env).
Optional extras:
HEDERA_NETWORKto forcehedera:mainnetorhedera:testnet(defaults to testnet).MAINNET_HEDERA_ACCOUNT_ID/MAINNET_HEDERA_PRIVATE_KEYif you prefer separate creds for mainnet automation.OPENROUTER_API_KEYonly when you want the demo to use a paid OpenRouter model.
REGISTRY_BROKER_API_KEY is still respected for non-ledger flows, but you rarely need it because the operator signer handles paid access automatically.
Unit tests mock the broker SDK, while the integration test hits the live Hashgraph Online Registry:
pnpm test # runs unit + integration suites
pnpm test __tests__/registry-broker-plugin.integration.test.tsSet JEST_REAL_FETCH=true when you want to bypass the OpenRouter model stub. The integration test handles this automatically.
pnpm run lint
pnpm run typecheckimport { AgentMode, HederaLangchainToolkit } from 'hedera-agent-kit';
import {
createRegistryBrokerPlugin,
registryBrokerPluginToolNames,
} from '@hashgraphonline/registry-broker-plugin';
const registryBrokerPlugin = createRegistryBrokerPlugin();
const toolkit = new HederaLangchainToolkit({
client,
configuration: {
plugins: [registryBrokerPlugin],
tools: [registryBrokerPluginToolNames.REGISTRY_BROKER_OPERATION_TOOL],
context: { mode: AgentMode.AUTONOMOUS },
},
});
const tools = toolkit.getTools();Pass configuration overrides into createRegistryBrokerPlugin({ configuration: { client: { ... }, ledger: { ... } } }) to customize API keys or provide explicit ledger credentials when you do not want to rely on the shared Hedera env vars.
Run the end-to-end demo to see the plugin registered with a real Hedera Agent Kit (HederaLangchainToolkit) instance. The script:
- Loads the Registry Broker plugin into Hedera Agent Kit using the same operator account that powers your toolkit client.
- Runs a live search against the Registry Broker.
- Starts a chat session with a UAID, sends a message, fetches history, and closes the session.
pnpm demo:hedera-kitThe following environment variables must be available (configure them in your shell or local .env file before running the demo):
HEDERA_OPERATOR_ID/HEDERA_OPERATOR_KEYorMAINNET_HEDERA_ACCOUNT_ID/MAINNET_HEDERA_PRIVATE_KEYHEDERA_NETWORK(optional, defaults tohedera:testnet)- Optional:
REGISTRY_BROKER_DEMO_PAID_UAIDorREGISTRY_BROKER_DEMO_A2A_UAIDif you want to force the demo to chat with your own UAID; by default it uses the bundled OpenRouter agent so no extra setup is required.
The script logs each stage so you can verify the broker responses end-to-end.