Clarit.ai logoClarit.ai Home
    How Engram Works

    The cure for
    Agent Amnesia.

    Real memory, built inside the AI itself — not a database pretending to be memory, not a cache trick, not a training workaround. Your AI picks up where it left off, instantly, every time.

    Get the code
    SESSION 1session gapSESSION 2SNAPSHOT56 MB · constant size · what's this?Restore in ~2 msstate preserved across session gaps
    What's broken today

    AI keeps starting from scratch.

    When you send a message, the AI re-reads your entire conversation from the beginning before it can reply. Every time. A 50-turn thread means 50 full re-reads. At scale, this is most of your AI bill.

    • Compute burned re-reading what the AI already saw
    • Responses that get slower as conversations get longer
    • Bills that grow every message, forever
    • Multi-step AI agents that lose the thread mid-task
    How Engram fixes it

    What if the model could just remember?

    The newest generation of AI models already compress the entire conversation into a small, fixed-size internal state. It's the same size whether the chat is 100 words or 100,000 words. Engram saves that state and restores it instantly — so the AI picks up exactly where it left off, without rereading anything.

    Core concept

    What's a snapshot?

    Think of a context window as what the model reads. A snapshot is what the model is after reading it — a small file that captures the AI's current understanding, frozen in place. It stays the same size whether the conversation is five minutes or five months old. Save it, move it, restore it, and the AI picks up right where it left off without reading anything over again.

    Not a transcript

    Not a copy of your conversation text. Not a screenshot. Not a log file. Saving the transcript just saves words — restoring one means the model still has to re-read them all.

    Not a retrain

    Not a modified model. Not fine-tuning. Not new weights. The base model never changes — a snapshot is inference-time state, persisted between requests.

    The model's inner state

    The compressed internal representation after the model processes the conversation — frozen and filed. Same fixed size at turn 1 or turn 1,000,000. Restore it and the model resumes exactly where it left off.

    Measured on IBM Granite 4.0-H-Tiny (4B) · H200

    Side effects may include:

    0.0%
    fewer tokens processed
    271 requests, zero failures
    ~0 ms
    warm restore
    vs. 6.5 s full prefill at 128K
    0×
    speedup at 128K context
    constant-size snapshot · any length

    See benchmarks in the repo README

    Validation

    Across architectures, not just one.

    Seven models across four vendors — IBM, NVIDIA, Alibaba, Mistral. Dense Mamba2 hybrids, MoE hybrids, LatentMoE, Gated Linear Attention, and pure Mamba2. Two generations of Qwen3 six months apart. All pass Engram's integration tests end-to-end.

    ModelVendorArchitectureSnapshotStatus
    Granite 4.0-H-Tiny (4B)IBMDense Mamba2 hybrid~56 MBPASS
    Granite 4.0-H-Small (32B)IBMDense Mamba2 hybrid~146 MBPASS
    Nemotron-Cascade-2 (30B)NVIDIAMoE Mamba2 hybrid~47 MBPASS
    Nemotron-3-Super (120B FP8)NVIDIALatentMoE hybrid~5.3 GBPASS
    Qwen3-Next (80B)AlibabaGLA + MoE · earlier generation—PASS
    Qwen3-Coder-Next (80B)AlibabaGLA + MoE · evolved architecture~23.7 GBPASS
    Codestral Mamba (7B)MistralPure Mamba2—PASS

    All snapshot sizes stay constant regardless of conversation length — a 1M-token conversation saves the same bytes as a 1K-token one. Codestral Mamba passes on Engram today; its snapshot figure publishes once SGLang merges the pure-Mamba2 loading fix Clarit contributed upstream (PR #22327).

    Under the hood

    How Engram works.

    Snapshot persistence

    Save and restore complete Mamba hidden state (conv_state + ssm_state tensors) via REST API. Constant-size snapshots regardless of context length.

    3-tier memory hierarchy

    VRAM → host RAM → disk with automatic promotion and eviction. Hot sessions restore in ~2 ms, warm in ~10 ms, cold in ~50 ms.

    Pre-free snapshot hook

    Capture state immediately after request completion but before memory is released. Previous approaches lost the state at cleanup.

    Agent tool framework

    REST and WebSocket APIs for checkpoint, branch, and restore. Integrates with OpenAI-compatible tooling and Vercel AI SDK.

    Concurrent safety

    Per-request correlation with futures-based system. 271 concurrent requests, zero cross-contamination, copy-on-write semantics.

    Cross-architecture support

    Validated across dense Mamba2, MoE hybrids, LatentMoE, GLA, and pure Mamba2 — seven models across four vendors, including two Qwen3 generations six months apart.

    Get in touch

    Working together

    Engram is open source. We work with teams and partners who care about AI that actually remembers — and we'd love to hear what you're building.

    • Integrating Engram into your product or platform
    • Pilot deployments for persistent-memory agents
    • Research collaborations on stateful inference