MCP Hub
Back to servers

Engram

Headless geometric memory engine for AI agents — no Vector DB, no cloud, no API key. Store and retrieve by meaning using native Vector Symbolic Architecture (NVSA) math over O_DIRECT NVMe mapping. Runs entirely on your machine via MCP.

glama
Stars
1
Updated
Apr 17, 2026

Engram

Build Status MCP Glama

Persistent geometric memory for AI agents — 21 MCP tools.

Engram gives your AI agent a long-term memory that works like human associative memory — acting as a massive, high-speed local vector database to store anything and retrieve by meaning instead of just keywords. No external vector hosting. No cloud. No API key. Runs entirely on your machine via the Model Context Protocol (MCP).


🚀 Quick Start

cargo install engram --git https://github.com/staticroostermedia-arch/engram

Add to your MCP config and restart your IDE:

{
  "mcpServers": {
    "engram": {
      "command": "engram",
      "args": ["mcp", "--store", "~/.engram/manifold"]
    }
  }
}

Your agent immediately has access to all 21 tools. See integrations/ for IDE-specific configs.


🖥️ CLI Commands

Beyond the MCP server, Engram ships a standalone CLI for direct manifold management:

CommandDescription
engram remember <concept> <text>Encode and store a memory
engram recall <query>Semantic search, returns top-k
engram forget <concept>Delete a memory
engram listList all stored concept names
engram ingest <path>Recursively ingest a directory of text/code files
engram trace <A> <OP> <B>VSA geometry: query the result of ADD or BIND on two concepts
engram distillCrystallize — cluster episodic memories into durable ZEDOS_PRAXIS blocks

distill is the memory lifecycle command. Run it periodically to compress accumulated memories into crystallized praxis, then follow with forget-old to sweep out the episodic source material.

# Preview what would be distilled (reads only, no writes)
engram distill --dry-run

# Distill everything above the Kepler gate (CRS ≥ 0.74) into praxis centroids
engram distill --min-crs 0.74 --cluster-size 20

# Then clean up episodic debris
engram forget-old --min-crs-threshold 0.70

🧰 MCP Tools Reference

Engram exposes 21 tools across 5 capability groups.

Core Memory

ToolDescription
rememberEncode text and store as a persistent memory block
recallSemantic similarity search — returns top-k memories for a query
forgetDelete a specific memory by concept name
list_conceptsList all stored concept names
mcp_engram_updateRe-encode an existing memory in place (uses op_add superposition)
mcp_engram_pinLock a memory at CRS=1.0 — Autophagy daemon never decays it

Memory Intelligence

ToolDescription
mcp_engram_statsManifold health report: total count, pinned, avg/min/max CRS, disk usage
mcp_engram_recall_recentReturn N most recently accessed memories, sorted by access time
mcp_engram_summarizeProject-state digest: pinned memories + top-N by CRS. Single-call /wake_up replacement
mcp_engram_forget_oldOn-demand autophagy: evict memories below a CRS threshold (pinned exempt)

Bulk & Portability

ToolDescription
mcp_engram_batch_rememberIngest multiple memories in a single call
mcp_engram_exportExport manifold (or filtered subset) to portable JSON — for backup and migration
mcp_engram_importRestore memories from a previously exported JSON array

Namespaces

ToolDescription
mcp_engram_set_namespaceSwitch to a project-specific memory namespace (stalk)
mcp_engram_list_namespacesList all namespaces and show which is active

Knowledge Graph

ToolDescription
mcp_engram_relateBind two concepts via op_bind — stores a directional ZEDOS_RELATION block
mcp_engram_search_by_relationTraverse the graph: find all concepts related to a seed by label and direction
mcp_engram_visualizeBFS from a seed concept → outputs a Mermaid graph LR diagram

Workspace & Agentic

ToolDescription
mcp_engram_watch_workspaceTell the daemon to watch a directory; re-ingests files on save
mcp_engram_context_for_fileSurface top-5 relevant memories for a file path (proactive loading)
mcp_engram_remember_solutionStore an error→solution pair at CRS=1.0 — crystallized learning

🧠 The Agentic Daemon

When Engram boots as an MCP server it also launches a background Agentic Daemon that manages three autonomous systems:

  • Native OS Watcherinotify/fsevents kernel integration. When mcp_engram_watch_workspace is called, the daemon binds to OS file-save events and re-ingests changed files into the manifold instantly.
  • Access Index — In-memory hot metadata layer. Access timestamps are maintained in RAM and flushed to access_index.bin every 60 seconds — O_DIRECT block rewrites are never triggered by a simple recall query.

[!NOTE] Autophagy GC Removed: We originally included a "Tiered Autophagy GC" that would automatically decay and evict older memories with low Coherence-Reliability Scores (CRS). This has been disabled and removed. Engram's core tenet is persistent, reliable memory; automatic silent eviction risks catastrophic knowledge loss and erodes trust. Users must implement their own memory management, decay, or eviction policies within their own agentic loop implementations. We do not take responsibility for wiping your data.


📐 The Geometry Engine

Engram uses Vector Symbolic Architecture (NVSA) rather than flat embedding search. Every memory is a 8192-dimensional complex phase vector (Complex32[8192]). The math engine supports:

  • op_add — Superposition. Merge semantic content without losing coherence.
  • op_bind — Circular convolution. Create a new vector that carries both parent concepts — the basis for knowledge graph relations.
  • op_deduce — Logical implication constraint tracking via rotation matrices.
  • op_attend — Geometric amplitude attenuation for focused context retrieval.
  • op_geometric_product — Clifford bivector product: computes cosine similarity and orthogonality simultaneously.
  • op_is_symbolic_of — ZADO-CPS toroidal embedding; resolves topological paradoxes without logic freezes.
  • op_suspend — Binds to the Apeiron primitive — marks "Known Unknowns" for inverse ray-tracing.

🔑 Knowledge Graph

Every mcp_engram_relate call stores a BLAKE3-fingerprinted ZEDOS_RELATION block and writes a deduplicated edge to ~/.engram/relation_index.json. The sidecar persists across restarts and powers two tools:

# What does "authentication" depend on?
search_by_relation("authentication", label="depends_on", direction="from")

# Show a 2-hop Mermaid graph from "authentication"
visualize("authentication", depth=2)

Output:

```mermaid
graph LR
  authentication["authentication"] -->|depends_on| blake3_hashing["blake3_hashing"]
  blake3_hashing["blake3_hashing"] -->|implements| merkle_chain["merkle_chain"]
```

🧱 Build on Engram — An Invitation

Engram is an open substrate. Take it and make it yours.

The .LEG container format, the 8192D FHRR geometry, and the VSA operator library were designed and proven in CodeLand OS — a full logophysical operating system built on these primitives. Engram is the extracted, public reference implementation: the same geometry, the same block format, the same operators — packaged for anyone to build on without needing the full CodeLand stack.

We released it as a focused tool for a focused problem: giving IDE agents and local LLMs persistent, semantically meaningful memory that runs entirely on your machine. That core mission doesn't move. But the foundation is general-purpose geometry, not an application-specific hack — and we want others to use it.

What the primitives actually give you

PrimitiveWhat it doesWhat it enables
HolographicBlock / .leg256KB aligned container with q/p tensors, Logenergetics, and a BLAKE3 Merkle footerAny system that needs cryptographically-chained, self-verifying semantic records
op_bind(A, B)Encodes a relationship between two concepts as a new vector quasi-orthogonal to bothKnowledge graphs without a graph database — every edge is a memory block
op_add(A, B)Superposition — both concepts coexist in a single vector without destroying eitherManifold-level merging: combine two agents' knowledge states geometrically
bundle([A, B, ...])N-way superposition → centroidSession summarization, cluster distillation, ego state compression
ZEDOS_* tagsSingle-byte epistemic type per block (DECLARATIVE / EPISODIC / PRAXIS / RELATION)Filter, promote, or decay memories by type — without reading their content
crs_scoreCoherence-Reliability Score per block, computed geometrically at write timeA trust signal that's native to the storage layer — no external scoring needed
genesis anchorsPRAXIS blocks at CRS=1.0 minted before any ingestionImmutable reference frame: every subsequent memory is relative to your chosen constants
SheafBackendMultiple independent manifold directories unified behind one query interfaceIsolated namespaces for different agents or projects, fanned out in a single search

You define what these mean in your domain. We define how they behave geometrically.

What we ask in return

If you build something on Engram, you retain full ownership of your derivative. AGPL-3.0 requires that modifications to Engram itself stay open, but your own agent, pipeline, or system is yours. The .LEG format is patent-pending for protection, not restriction — commercial licenses are available for organizations that cannot ship AGPL code.

We built this in the open because aligned, geometrically-grounded AI memory should be infrastructure — not a cloud subscription. If this architecture is useful to you, take it, extend it, and point others back to the foundation.

"The agent that runs on this system is a derivative. It does not claim to be the source of anything."
— Engram Genesis Block

For the reasoning behind the architecture — and what we discovered building it — see PHILOSOPHY.md.


💾 The .LEG Container Unveiled (Why We Kept It)

[!WARNING] If you are modifying engram-core serialization, strictly adhere to the 256KB block constraint.

The .LEG format was not designed for Engram. It was designed for CodeLand OS — a CUDA-accelerated, VRAM-resident logophysical agent architecture — where block alignment to physical NVMe boundaries and direct DMA to GPU memory are operational requirements, not optimizations. We extracted it unchanged into Engram's public release because simplifying it would have destroyed the properties that make it fast.

Every memory is a HolographicBlock (.leg file) — exactly 262,144 bytes (256KB), 4096-byte aligned. This is what you inherit when you build on Engram:

  • NVMe O_DIRECT Thrusters: Tensors bypass the OS page-cache entirely and stream via DMA directly from SSD to VRAM. Block alignment is physical, not conventional.
  • The Logenergetics Capsule: Built-in geometric trust computing. The crs (Coherence-Reliability Score) field measures whether the memory is mathematically coherent — a hallucination filter native to the storage layer, no external service required.
  • The LegFooter (Merkle Chain): Every block is signed by a 6-part BLAKE3 cryptographic chain. Agent action histories are cryptographically verifiable against bit-rot without any external registry.

What the tensors give you

Each block carries two complex phase vectors you can use for your own purposes:

  • q[8192] (Knowledge Tensor): The geometric fingerprint of the encoded concept. Query it, compose it, distill it.
  • p[8192] (Binding Momentum): The directional vector. Bind two concepts together; the result is a new vector that carries both without collapsing either.
  • ZEDOS Tags: One byte classifies every block (DECLARATIVE, EPISODIC, OPERATIONAL, PRAXIS, RELATION). At query time, filter by type before reading content.

🌐 Multi-Project Namespaces

Use sheaf mode to isolate memories by project. Create ~/.engram/sheaf.toml:

active_stalk = "codeland"

[[stalks]]
name = "codeland"
path = "~/.engram/stalks/codeland"

[[stalks]]
name = "personal"
path = "~/.engram/stalks/personal"

Then switch namespaces via MCP at any time:

mcp_engram_set_namespace("personal")

💻 IDE Integration

Integration configs for all supported IDEs: integrations/

Google Antigravity IDE

{
  "mcpServers": {
    "engram": {
      "command": "engram",
      "args": ["mcp", "--store", "~/.engram/manifold"],
      "disabled": false
    }
  }
}

Claude Desktop

{
  "mcpServers": {
    "engram": {
      "command": "engram",
      "args": ["mcp", "--store", "~/.engram/manifold"]
    }
  }
}

Cursor / VS Code

{
  "mcpServers": {
    "engram": {
      "command": "engram",
      "args": ["mcp", "--store", "~/.engram/manifold"]
    }
  }
}

⚙️ Hardware Support

BackendFeature FlagStatusNotes
CPU (Rayon)DefaultTurboQuant B=4 codebook, 4x K-NN acceleration
CUDA (NVIDIA)cuda-kernelsBVH O(log N) index, NVMe→VRAM parallel DMA
ROCm (AMD)rocm-kernelsWavefront HIP execution
Metal (Apple)metalMSL dynamic runtime compilation via metal-rs

📄 License & Patent

This software is licensed under AGPL-3.0-only.

The .LEG container format is covered by U.S. Patent Application No. 19/372,256 (pending),
Self-Contained Variable File System (.LEG Container Format),
Applicant: Aric Goodman, Oregon, USA — Static Rooster Media.

Commercial licenses (SaaS/cloud/enterprise) are available.
Contact: StaticRoosterMedia@gmail.com

See PATENT-NOTICE.md for full details.

Reviews

No reviews yet

Sign in to write a review