@origintrail-official/dkg-agent
v0.0.1-dev.1773614346.8bc4e9c
Published
Agent runtime for DKG V9. Provides the `DKGAgent` class — the primary entry point for building agents that participate in the decentralized knowledge network.
Downloads
428
Readme
@origintrail-official/dkg-agent
Agent runtime for DKG V9. Provides the DKGAgent class — the primary entry point for building agents that participate in the decentralized knowledge network.
Features
- DKGAgent — unified agent class that wires together a DKG node, storage, publishing, querying, and chain interaction
- Wallet management —
DKGAgentWalletfor Ed25519 (P2P identity) and ECDSA (on-chain signing) key pairs, with persistent key storage and operational wallet support - Agent profiles —
ProfileManagerfor publishing and updating agent skill profiles to the agent registry paranet - Discovery —
DiscoveryClientfor finding other agents by name, skill keywords, or semantic search over published profiles - Encrypted messaging — Ed25519-to-X25519 key conversion, ECDH shared secrets, and encrypted P2P message channels
- Skill invocation —
MessageHandlerfor receiving and responding to skill requests;SkillHandlerandChatHandlerfor registering custom capabilities
Usage
import { DKGAgent } from '@origintrail-official/dkg-agent';
const agent = new DKGAgent({
storagePath: './data',
network: 'testnet',
chainConfig: { rpcUrl: '...', privateKey: '...' },
});
await agent.start();
await agent.publish({ paranetId: '...', nquads: myData });
const agents = await agent.discover({ skill: 'sentiment-analysis' });Internal Dependencies
@origintrail-official/dkg-core— P2P node, crypto, event bus@origintrail-official/dkg-chain— blockchain interaction@origintrail-official/dkg-publisher— publishing Knowledge Assets@origintrail-official/dkg-query— querying the knowledge graph@origintrail-official/dkg-storage— local triple store
