@mubit-ai/langgraph
v0.8.0
Published
LangGraph.js BaseStore backed by MuBit memory engine
Readme
@mubit-ai/langgraph
LangGraph.js BaseStore backed by MuBit.
MubitStore extends BaseStore (imported from @langchain/langgraph, which
re-exports it from @langchain/langgraph-checkpoint) and calls only the public
@mubit-ai/sdk Client methods — no private transport or operation tables. On
top of the standard store surface it threads the MuBit attribution loop for
long-running MAS and coding-agent runs.
Install
npm install @mubit-ai/langgraph @langchain/langgraph @mubit-ai/sdkBasic usage
import { MubitStore } from "@mubit-ai/langgraph";
const store = new MubitStore({
endpoint: "http://127.0.0.1:3000",
apiKey: process.env.MUBIT_API_KEY,
});
await store.put(["memories", "user-1", "session-1"], "deploy-note", {
text: "Canary before rollout.",
intent: "lesson",
source: "human",
});
const results = await store.search(["memories", "user-1"], {
query: "What rollout lesson do we have?",
limit: 5,
});Namespace mapping
| Namespace | MuBit scope |
| --- | --- |
| ["memories"] | global |
| ["memories", userId] | user-scoped |
| ["memories", userId, sessionId] | user + session scoped |
Store behavior
put()writes throughclient.rememberwithupsert_keyand threads anidempotency_key(defaults to the key, or passvalue.idempotency_key) so a re-run graph node does not double-writeget()andsearch()useclient.recall; each returned item exposesvalue.reference_idso callers can credit recalled evidence back throughrecordOutcome({ entryIds: [...] })- evidence metadata is normalized from current MuBit response fields
listNamespaces()remains local cache baseddelete()remains a no-op because MuBit deletion is explicit and scope-based
Attribution loop (v0.7.0)
Thread credit assignment through a run:
recordOutcome(namespace, referenceId, outcome, options)—options.entryIdscredits the recalled evidencereference_ids;options.verifiedInProductiongates reinforcement to production-confirmed outcomesrecordStepOutcome(namespace, stepId, options)— per-step process reward withstepName,outcome,signal,rationale, anddirectiveHint
const results = await store.search(["memories", "user-1"], { query: "rollout" });
const entryIds = results.map((r) => r.value.reference_id).filter(Boolean);
await store.recordStepOutcome(["memories", "user-1", "session-1"], "canary", {
outcome: "success",
signal: 1,
directiveHint: "Keep the canary soak before promoting.",
});
await store.recordOutcome(["memories", "user-1", "session-1"], "global", "success", {
signal: 1,
entryIds,
verifiedInProduction: true,
});A runnable end-to-end walkthrough lives in
examples/attribution_loop.
MuBit extension methods
Existing MAS helpers:
checkpoint(namespace, snapshot, options)surfaceStrategies(namespace, options)
Current observability and coordination helpers:
getContext(namespace, options)memoryHealth(namespace, options)diagnose(namespace, options)archive(namespace, options)dereference(namespace, options)registerAgent(namespace, options)listAgents(namespace)handoff(namespace, options)feedback(namespace, options)
Config
| Option | Default | Purpose |
| --- | --- | --- |
| endpoint | http://127.0.0.1:3000 | MuBit HTTP endpoint |
| apiKey / api_key | "" | MuBit API key |
For tests or advanced embedding, you can inject mubitClient directly.
Development
cd integrations/javascript/mubit-langgraph
npm install
npm testLicense
Apache-2.0
