{"_id":"@aletheia-labs/adapters-langgraph","_rev":"2-3594271c3ef67a9d48d5013b6e50b6d4","name":"@aletheia-labs/adapters-langgraph","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.1":{"name":"@aletheia-labs/adapters-langgraph","version":"0.1.1","keywords":["aletheia","langgraph","llm","memory","agents"],"license":"Apache-2.0","_id":"@aletheia-labs/adapters-langgraph@0.1.1","maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"dist":{"shasum":"724462cc7ee8be27660cc0cb50deb7813bf4c0b9","tarball":"https://registry.npmjs.org/@aletheia-labs/adapters-langgraph/-/adapters-langgraph-0.1.1.tgz","fileCount":19,"integrity":"sha512-9KvF6pSsE0v/HD1XF3h5USRLZ+XavLQmL6hd2MTUzl8tJ5QyQ1FVco9Viq2sFBXCJUnamzfls3kncEywctsH5g==","signatures":[{"sig":"MEUCIFe4Bq9x4V2uk/pmE/nT7l+Bf0XOQNyAvmmv06zP3J7FAiEA6LC1Ea0CSjgKeCmHvQIKInWaGzxz1oOHhJEQm18Gkgo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76360},"main":"./dist/index.js","type":"module","_from":"file:aletheia-labs-adapters-langgraph-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./recipes":{"types":"./dist/recipes.d.ts","import":"./dist/recipes.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"penagabriel22","email":"penagabriel22@gmail.com"},"_resolved":"/private/var/folders/9c/lly_9vqs1gv40hnyxgytthg00000gn/T/1e6b12c3afdbb8f32680bde7f1aa1789/aletheia-labs-adapters-langgraph-0.1.1.tgz","_integrity":"sha512-9KvF6pSsE0v/HD1XF3h5USRLZ+XavLQmL6hd2MTUzl8tJ5QyQ1FVco9Viq2sFBXCJUnamzfls3kncEywctsH5g==","_npmVersion":"10.9.2","description":"LangGraph node helpers for Aletheia authority-governed memory.","directories":{},"_nodeVersion":"22.17.0","dependencies":{"@aletheia-labs/core":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.6.3","@types/node":"^22.10.0","@langchain/langgraph":"^1.3.0"},"peerDependencies":{"@langchain/langgraph":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/adapters-langgraph_0.1.1_1779143260405_0.6037207285230572","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aletheia-labs/adapters-langgraph","version":"0.1.2","description":"LangGraph node helpers for Aletheia authority-governed memory.","license":"Apache-2.0","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./recipes":{"types":"./dist/recipes.d.ts","import":"./dist/recipes.js"}},"dependencies":{"@aletheia-labs/core":"0.2.1"},"peerDependencies":{"@langchain/langgraph":">=1.0.0"},"devDependencies":{"@langchain/langgraph":"^1.3.0","@types/node":"^22.10.0","typescript":"^5.6.3","vitest":"^2.1.8"},"publishConfig":{"access":"public"},"keywords":["aletheia","langgraph","llm","memory","agents"],"repository":{"type":"git","url":"git+https://github.com/lechuit/synaptic-mesh.git","directory":"packages/adapters-langgraph"},"homepage":"https://github.com/lechuit/synaptic-mesh/tree/main/packages/adapters-langgraph#readme","bugs":{"url":"https://github.com/lechuit/synaptic-mesh/issues"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run","test:watch":"vitest"},"_id":"@aletheia-labs/adapters-langgraph@0.1.2","_integrity":"sha512-eb8s6L2Sm/pT+66aP+9Y63mMPtLcnpZ1J/ArZ+hh03Qv7kPTL5ShqBLeZvorH2Md/tfTMxfcJMpIx/t1C30h6g==","_resolved":"/private/var/folders/9c/lly_9vqs1gv40hnyxgytthg00000gn/T/429bba1b442951fa13b045668bd983d4/aletheia-labs-adapters-langgraph-0.1.2.tgz","_from":"file:aletheia-labs-adapters-langgraph-0.1.2.tgz","_nodeVersion":"25.4.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-eb8s6L2Sm/pT+66aP+9Y63mMPtLcnpZ1J/ArZ+hh03Qv7kPTL5ShqBLeZvorH2Md/tfTMxfcJMpIx/t1C30h6g==","shasum":"dd44438fac185109e6aa8f0118ef6362c961f537","tarball":"https://registry.npmjs.org/@aletheia-labs/adapters-langgraph/-/adapters-langgraph-0.1.2.tgz","fileCount":19,"unpackedSize":76693,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEOf4kPCMX/z1Ak07Hut7ONLh9g+GA2qgq+2Ey1bbn7sAiAfQ7bQkGN8N99ovNRXtrxKIRVYCCS6l9qNyHLC95VFrg=="}]},"_npmUser":{"name":"penagabriel22","email":"penagabriel22@gmail.com"},"directories":{},"maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adapters-langgraph_0.1.2_1779475324766_0.9419305943883012"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T22:27:40.282Z","modified":"2026-05-22T18:42:05.041Z","0.1.1":"2026-05-18T22:27:40.547Z","0.1.2":"2026-05-22T18:42:04.916Z"},"license":"Apache-2.0","keywords":["aletheia","langgraph","llm","memory","agents"],"description":"LangGraph node helpers for Aletheia authority-governed memory.","maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"readme":"# @aletheia-labs/adapters-langgraph\n\nLangGraph node helpers for Aletheia authority-governed memory.\n\n## Status\n\nExperimental `0.1.x` adapter. It is intentionally small: LangGraph owns graph\nstate and branching; Aletheia owns source-bound memory authority. The default\nsurface is helper-only, with optional recipe fragments for common gates.\n\n## Install\n\n```sh\npnpm add @aletheia-labs/adapters-langgraph @aletheia-labs/core @langchain/langgraph\n```\n\n## Quickstart\n\n```ts\nimport {\n  createExecutionRecheckNode,\n  createGovernedRecallNode,\n  createHumanApprovalInterruptNode,\n  createHumanApprovalResumeNode,\n  createTryActNode,\n  actionFingerprint,\n  decisionSnapshot,\n  recalledMemoryIds,\n  routeDecisionOutcome,\n} from '@aletheia-labs/adapters-langgraph';\n\nconst governedRecall = createGovernedRecallNode({\n  authority,\n  buildQuery: (state) => ({\n    agentId: state.agentId,\n    scope: state.scope,\n    limit: 5,\n  }),\n  toUpdate: (result) => ({\n    recallDecision: decisionSnapshot(result.decision),\n    recalledMemoryIds: recalledMemoryIds(result),\n  }),\n});\n\nconst executionRecheck = createExecutionRecheckNode({\n  authority,\n  buildAction: (state) => state.action,\n  buildContext: (state) => ({\n    agentId: state.agentId,\n    citedMemoryIds: state.recalledMemoryIds,\n    scope: state.scope,\n  }),\n  toUpdate: (result) => ({\n    actionDecision: decisionSnapshot(result.decision),\n    route: routeDecisionOutcome(result.decision.outcome),\n  }),\n});\n```\n\n## Human Approval Resume\n\nSensitive actions still return `ask_human`. The adapter can validate a resumed\nhuman approval without turning the approval into memory authority:\n\n```ts\nconst resumeAfterApproval = createHumanApprovalResumeNode({\n  authority,\n  getAction: (state) => state.action,\n  getContext: (state) => state.context,\n  getApproval: (state) => state.approval,\n  toUpdate: (result) => ({\n    approvalResume: result,\n  }),\n});\n```\n\nThe resume helper checks:\n\n- the approval fingerprint matches the current action and context;\n- the approval is not denied or expired;\n- the cited memory still authorizes a local authority probe;\n- receiver-side `tryAct()` still returns the expected boundary.\n\nWith LangGraph checkpoints, wrap the interrupt packet in LangGraph's native\ninterrupt API and resume with a human record:\n\n```ts\nimport { Command, MemorySaver, interrupt } from '@langchain/langgraph';\n\nconst buildApprovalPacket = createHumanApprovalInterruptNode({\n  getAction: (state) => state.action,\n  getContext: (state) => state.context,\n  getDecision: (state) => state.actionDecision,\n  toUpdate: (approvalRequest) => ({ approvalRequest }),\n});\n\nconst interruptForApproval = async (state) => {\n  const { approvalRequest } = await buildApprovalPacket(state);\n  const approval = interrupt(approvalRequest);\n  return { approval, approvalRequest };\n};\n\nconst graph = builder.compile({ checkpointer: new MemorySaver() });\nawait graph.invoke(input, { configurable: { thread_id: 'thread-1' } });\nawait graph.invoke(new Command({ resume: approvalRecord }), {\n  configurable: { thread_id: 'thread-1' },\n});\n```\n\nThe checkpoint resumes graph control flow only. The next node should still call\n`createHumanApprovalResumeNode()` so Aletheia can recheck current memory before\nthe host performs any effect. Durable checkpointers such as SQLite or Postgres\nbelong to the host runtime; this adapter stays helper-only and does not store\nAletheia authority in LangGraph state.\n\n## Experimental Recipes\n\nRecipes package common gates without executing host effects:\n\n```ts\nimport { createGovernedEffectGateFragment } from '@aletheia-labs/adapters-langgraph/recipes';\n\nconst effectGate = createGovernedEffectGateFragment({\n  authority,\n  buildAction: (state) => state.action,\n  buildContext: (state) => state.context,\n  routeNames: {\n    allowLocalShadow: 'run_local_effect',\n    askHuman: 'interrupt_for_approval',\n    conflictBoundaryPacket: 'surface_conflict',\n    noEffect: 'no_effect',\n  },\n  toTryActUpdate: (result) => ({\n    actionDecision: decisionSnapshot(result.decision),\n  }),\n  toExecutionRecheckUpdate: (result, _action, _context, route) => ({\n    executionDecision: decisionSnapshot(result.decision),\n    route,\n  }),\n});\n\nbuilder\n  .addNode(effectGate.nodeNames.tryAct, effectGate.nodes.tryAct)\n  .addNode(effectGate.nodeNames.executionRecheck, effectGate.nodes.executionRecheck)\n  .addConditionalEdges('execution_recheck', (state) => state.route, effectGate.routes);\n```\n\nRecipes are available from the root export for convenience and from the\nexplicit `/recipes` subpath for hosts that want to keep helper-only imports\nseparate. `createGovernedEffectGateFragment()` and\n`createHumanApprovalGateFragment()` expose a\n`LANGGRAPH_RECIPE_BOUNDARY_CONTRACT` declaring that recipes do not execute\ntools, grant permission, own checkpointers, own provider clients, or store\ndurable authority in graph state.\n\n## Boundary\n\n- No semantic retrieval, embeddings, or vector store.\n- No tool execution.\n- No provider credentials.\n- No durable authority in graph state.\n- Sensitive actions still route to human approval through Aletheia `tryAct()`.\n- Approval packets are evidence for one exact effect, not reusable permission.\n\nThe adapter returns ordinary async node functions and recipe fragments. Use them\ninside a LangGraph `StateGraph`, then execute effects only after the\nexecution-time recheck route reaches a host-owned effect node.\n","readmeFilename":"README.md","homepage":"https://github.com/lechuit/synaptic-mesh/tree/main/packages/adapters-langgraph#readme","repository":{"type":"git","url":"git+https://github.com/lechuit/synaptic-mesh.git","directory":"packages/adapters-langgraph"},"bugs":{"url":"https://github.com/lechuit/synaptic-mesh/issues"}}