Store what changed.
Active context compaction for AI agents. Typed deltas replace transcript sprawl with structured, queryable state that stays compact as conversations grow.
Session
const session = createSession();
session.ingestBatch(turns);
await session.process();
Query
session.stats();
// { items: 7, decisions: 2,
// constraints: 3, openTasks: 1 }
Export
session.exportContext({ maxChars: 2000 });
// Budgeted working set for injection
Why DeltaMind
Transcripts grow linearly. State grows sublinearly.
Typed Deltas
11 delta types capture decisions, constraints, tasks, goals, hypotheses, and revisions. No freeform summaries that smear meaning.
Hybrid Extraction
Rule-based precision meets LLM semantic recall. Both compute stable semantic IDs — equivalent meaning converges regardless of path.
Safety First
Zero canonization of speculation. Rejections over corruption. Advisory-only memory promotion. The system would rather abstain than poison the ledger.
Architecture
Four-pass pipeline, three representations, single source of truth.
Event Gate
Cheap heuristics filter turns worth analyzing. High recall, tolerant of false positives. Saves extraction cost on chatter.
Extract + Reconcile
Extractors emit candidates. The reconciler decides truth. Duplicates are merged, superseded items are marked, provenance is preserved.
Persistence
Event log (what happened), snapshot (current truth), markdown (human inspection). Three formats, each with one job.
Scaling Results
The longer the session, the more DeltaMind earns its keep.
Usage
Install
npm install @deltamind/core @deltamind/cli Create a session
import { createSession } from "@deltamind/core";
const session = createSession({ forceRuleOnly: true });
session.ingestBatch([
{ turnId: "t-1", role: "user",
content: "Build a REST API with TypeScript." },
{ turnId: "t-2", role: "assistant",
content: "Setting up Express with TypeScript." },
{ turnId: "t-3", role: "user",
content: "Switch to Fastify instead." },
]);
await session.process(); Query and export
// What's in state?
const stats = session.stats();
// { totalItems: 5, activeDecisions: 1, ... }
// Budgeted context for injection
const ctx = session.exportContext({ maxChars: 2000 });
// Save for later
const snapshot = session.save(); CLI operations
deltamind inspect # State by kind
deltamind changed --since 5 # What changed
deltamind explain item-3 # Deep-dive
deltamind export --for ai-loadout
deltamind suggest-memory # Advisory updates
deltamind save && deltamind resume Delta Types
11 typed state changes — not summaries.
Decisions & Goals
goal_set, decision_made, decision_revised. Settled choices with provenance. Revisions supersede prior decisions while preserving history.
Constraints & Tasks
constraint_added, constraint_revised (relaxed/tightened/amended), task_opened, task_closed. Boundaries and work items with lifecycle tracking.
Knowledge & Uncertainty
fact_learned, hypothesis_introduced, branch_created, item_superseded. Facts are stable. Hypotheses stay tentative until explicitly promoted.