npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aletheia-labs/adapters-langgraph

v0.1.2

Published

LangGraph node helpers for Aletheia authority-governed memory.

Readme

@aletheia-labs/adapters-langgraph

LangGraph node helpers for Aletheia authority-governed memory.

Status

Experimental 0.1.x adapter. It is intentionally small: LangGraph owns graph state and branching; Aletheia owns source-bound memory authority. The default surface is helper-only, with optional recipe fragments for common gates.

Install

pnpm add @aletheia-labs/adapters-langgraph @aletheia-labs/core @langchain/langgraph

Quickstart

import {
  createExecutionRecheckNode,
  createGovernedRecallNode,
  createHumanApprovalInterruptNode,
  createHumanApprovalResumeNode,
  createTryActNode,
  actionFingerprint,
  decisionSnapshot,
  recalledMemoryIds,
  routeDecisionOutcome,
} from '@aletheia-labs/adapters-langgraph';

const governedRecall = createGovernedRecallNode({
  authority,
  buildQuery: (state) => ({
    agentId: state.agentId,
    scope: state.scope,
    limit: 5,
  }),
  toUpdate: (result) => ({
    recallDecision: decisionSnapshot(result.decision),
    recalledMemoryIds: recalledMemoryIds(result),
  }),
});

const executionRecheck = createExecutionRecheckNode({
  authority,
  buildAction: (state) => state.action,
  buildContext: (state) => ({
    agentId: state.agentId,
    citedMemoryIds: state.recalledMemoryIds,
    scope: state.scope,
  }),
  toUpdate: (result) => ({
    actionDecision: decisionSnapshot(result.decision),
    route: routeDecisionOutcome(result.decision.outcome),
  }),
});

Human Approval Resume

Sensitive actions still return ask_human. The adapter can validate a resumed human approval without turning the approval into memory authority:

const resumeAfterApproval = createHumanApprovalResumeNode({
  authority,
  getAction: (state) => state.action,
  getContext: (state) => state.context,
  getApproval: (state) => state.approval,
  toUpdate: (result) => ({
    approvalResume: result,
  }),
});

The resume helper checks:

  • the approval fingerprint matches the current action and context;
  • the approval is not denied or expired;
  • the cited memory still authorizes a local authority probe;
  • receiver-side tryAct() still returns the expected boundary.

With LangGraph checkpoints, wrap the interrupt packet in LangGraph's native interrupt API and resume with a human record:

import { Command, MemorySaver, interrupt } from '@langchain/langgraph';

const buildApprovalPacket = createHumanApprovalInterruptNode({
  getAction: (state) => state.action,
  getContext: (state) => state.context,
  getDecision: (state) => state.actionDecision,
  toUpdate: (approvalRequest) => ({ approvalRequest }),
});

const interruptForApproval = async (state) => {
  const { approvalRequest } = await buildApprovalPacket(state);
  const approval = interrupt(approvalRequest);
  return { approval, approvalRequest };
};

const graph = builder.compile({ checkpointer: new MemorySaver() });
await graph.invoke(input, { configurable: { thread_id: 'thread-1' } });
await graph.invoke(new Command({ resume: approvalRecord }), {
  configurable: { thread_id: 'thread-1' },
});

The checkpoint resumes graph control flow only. The next node should still call createHumanApprovalResumeNode() so Aletheia can recheck current memory before the host performs any effect. Durable checkpointers such as SQLite or Postgres belong to the host runtime; this adapter stays helper-only and does not store Aletheia authority in LangGraph state.

Experimental Recipes

Recipes package common gates without executing host effects:

import { createGovernedEffectGateFragment } from '@aletheia-labs/adapters-langgraph/recipes';

const effectGate = createGovernedEffectGateFragment({
  authority,
  buildAction: (state) => state.action,
  buildContext: (state) => state.context,
  routeNames: {
    allowLocalShadow: 'run_local_effect',
    askHuman: 'interrupt_for_approval',
    conflictBoundaryPacket: 'surface_conflict',
    noEffect: 'no_effect',
  },
  toTryActUpdate: (result) => ({
    actionDecision: decisionSnapshot(result.decision),
  }),
  toExecutionRecheckUpdate: (result, _action, _context, route) => ({
    executionDecision: decisionSnapshot(result.decision),
    route,
  }),
});

builder
  .addNode(effectGate.nodeNames.tryAct, effectGate.nodes.tryAct)
  .addNode(effectGate.nodeNames.executionRecheck, effectGate.nodes.executionRecheck)
  .addConditionalEdges('execution_recheck', (state) => state.route, effectGate.routes);

Recipes are available from the root export for convenience and from the explicit /recipes subpath for hosts that want to keep helper-only imports separate. createGovernedEffectGateFragment() and createHumanApprovalGateFragment() expose a LANGGRAPH_RECIPE_BOUNDARY_CONTRACT declaring that recipes do not execute tools, grant permission, own checkpointers, own provider clients, or store durable authority in graph state.

Boundary

  • No semantic retrieval, embeddings, or vector store.
  • No tool execution.
  • No provider credentials.
  • No durable authority in graph state.
  • Sensitive actions still route to human approval through Aletheia tryAct().
  • Approval packets are evidence for one exact effect, not reusable permission.

The adapter returns ordinary async node functions and recipe fragments. Use them inside a LangGraph StateGraph, then execute effects only after the execution-time recheck route reaches a host-owned effect node.