Skip to Content
Devnet Preview: data may reset, no production guarantees.
IntegrationsLangGraph

LangGraph Integration

Add verifiable identity to LangGraph agent workflows.

Setup

import { register, BeatAgent } from '@provenonce/sdk'; const coordCreds = await register('langgraph-coordinator', { registryUrl: 'https://provenonce.io', }); const coordBeat = new BeatAgent({ apiKey: coordCreds.api_key, registryUrl: 'https://provenonce.io', }); await coordBeat.init();

Acquire a SIGIL

await coordBeat.purchaseSigil({ identity_class: 'orchestrator', principal: 'langgraph-coordinator', tier: 'org', payment_tx: '5xYzAbCd...', // Solana transaction signature });

Heartbeat pattern for graph workflows

For batch/graph workflows that run periodically, use the heartbeat to prove liveness at each execution step:

// At the start of each graph execution const result = await coordBeat.heartbeat('5xYzAbCd...'); console.log(`Passport valid until: ${result.passport?.valid_until}`); // Run your graph nodes... // After graph completes const finalResult = await coordBeat.heartbeat('7bRsEfGh...');

Long-running graphs

For graphs that run continuously, use the automatic heartbeat loop:

coordBeat.startHeartbeat(() => getPaymentTxSignature()); // Run your graph... coordBeat.stopHeartbeat();

Spawning graph child agents

Use the 3-step spawn flow for any child worker in your graph:

// 1) Parent preflight const preflight = await fetch('https://provenonce.io/api/v1/agent/spawn', { method: 'POST', headers: { 'content-type': 'application/json', authorization: `Bearer ${coordCreds.api_key}`, }, body: JSON.stringify({ child_name: 'graph-worker' }), }).then(r => r.json()); // 2) Register child const child = await fetch('https://provenonce.io/api/v1/register', { method: 'POST', headers: { 'content-type': 'application/json', authorization: `Bearer ${coordCreds.api_key}`, }, body: JSON.stringify({ name: 'graph-worker', parent: coordCreds.hash, spawn_authorization: preflight.spawn_authorization, }), }).then(r => r.json()); // 3) Finalize spawn await fetch('https://provenonce.io/api/v1/agent/spawn', { method: 'POST', headers: { 'content-type': 'application/json', authorization: `Bearer ${coordCreds.api_key}`, }, body: JSON.stringify({ child_name: 'graph-worker', child_hash: child.hash }), });

Verifying passports offline

Third parties can verify an agent’s Passport without calling the registry:

import { BeatAgent } from '@provenonce/sdk'; const proof = coordBeat.getLatestPassport(); const authorityKey = '02ab3f...'; // From GET /api/v1/.well-known/authority-key const valid = BeatAgent.verifyPassportLocally(proof, authorityKey);
Last updated on