Skip to content

staticroostermedia-arch/engram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

213 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

EngramGrok

Build Status MCP Glama License: AGPL-3.0 Patent Pending Geometric Memory

Persistent geometric memory for AI agents.

EngramGrok is a local, hardware-native memory substrate that gives AI agents coherent, long-term memory with structure-preserving compression, synthetic calculus over both words and numbers, and true continuity across cold shutdowns.

Unlike vector databases or simple logs, Engram uses fixed-size holographic blocks, VSA operations, sheaf gluing, and categorical reasoning to maintain meaning and relationships even after heavy compression and long-running sessions.

It is designed as a drop-in backend for any LLM (Grok, Claude, Llama, etc.) via the Model Context Protocol (MCP) and is fully open for anyone to build on.

EngramGrok is particularly well-suited for:

  • Long-running agentic systems
  • Games with persistent LLM characters
  • Personalized AI companions
  • Any application needing coherent, evolving memory beyond simple vector stores
Start here Doc
Grok Build / xAI reviewers docs/GROK_BUILD_MEMORY.md
Any agent (lean contract) docs/AGENT_MEMORY_CONTRACT.md + FIRST_RUN.md
Ritual skills SKILLS.mddocs/skills/
Deep operators HOW_WE_ACTUALLY_USE_THIS_IN_2026.md
Substrate builders (BYOP) AGENT_INTEGRATION_GUIDE.md

Human review: ./scripts/leg (static) or ./scripts/leg --live — traces, goals, momentum, Thought Tiles.


Why not flat RAG?

Flat vector / markdown Engram
Storage append-log / chunks 256KB geometric blocks (q/p/CRS/Merkle)
Wake cold start session_start + harness injection + handoff
Integrity none verify_*, scars, CRS ≥ 0.74
Code context RAG chunks context_for_edit + spatial AABB
Agent discipline hope rituals + subvisor H¹ + process sheaf

Full comparison vs mem0/Letta/chroma: see docs/GROK_BUILD_MEMORY.md.


Quick start

git clone https://github.com/staticroostermedia-arch/engram.git
cd engram
cargo build -p engram-server
target/debug/engram --version   # 0.6.0

MCP config (Grok Build / Cursor — use scripts/engram-grok):

{
  "mcpServers": {
    "engram": {
      "command": "/path/to/engram/scripts/engram-grok",
      "args": ["mcp"],
      "env": {
        "ENGRAM_STORE": "~/.engram/stalks/",
        "ENGRAM_PROFILE": "agent"
      }
    }
  }
}

Restart your IDE, then:

mcp_engram_session_start(intent="your goal")

Lean loop: session_startcontext_for_edit(path)recall(scope=anchors)quick_trace / remembersession_end(summary).

All ecosystems: integrations/README.md. Cursor ambient wake: ./scripts/cursor-engram-preflight.sh.


Memory model (one paragraph)

Fixed 256KB HolographicBlocks (.leg3): 8192D phase (q), momentum (p), CRS lawfulness, BLAKE3 Merkle, spatial AABB. VSA calculus + sheaf gluing via processes/*.toml (rituals, harness, monitor). NREM / ego.leg3 for long-horizon continuity. Details: docs/GEOMETRIC_MEMORY.md, docs/RITUALS.md, docs/HARNESS_INJECTION.md.

Linguistic calculus (words + numbers in the same sheaf): docs/CATEGORICAL_LINGUISTIC_CALCULUS.md.

flowchart LR
  W[session_start<br/>harness injection] --> E[edit + trace]
  E --> H[session_end handoff]
  H --> W
Loading

What's new in v0.6.0

  • .leg3 optimizations: Tiered blocks, hybrid wire, SOA+arena layout, homo+zk transforms, versioning+DSL for safe operations. The ".leg3" is our "Minecraft blocks for AI" primitive — a unified binary+vector object with VSA/holographic geometry and safe transformations that keeps meaning coherent even after heavy compression and long sessions.
  • Human-forward presentation fix: Reports, tiles, and summaries now lead with plain, engaging story-like language (the "why it matters" and "so what") before technical details, making the geometric memory substrate more approachable while preserving full richness for the manifold and agents.
  • Successful self-improvement cycle: The loop audited its own prior research offload, adopted the .leg3 capabilities lawfully via supervised subs in worktree, recorded everything as geometry (traces, tiles, updates), and closed with explicit self-reference. Full dogfood with Enram rituals and superpowers tools.

See CHANGELOG.md for full details.

Categorical Linguistic Calculus

EngramGrok now supports native synthetic calculus over linguistic structures — including mixed number + word operations — all inside the geometric memory manifold.

Key capabilities:

  • Structure-preserving compression and decompression of language while preserving homotopy coherence (meaning up to coherent deformation).
  • Synthetic operations: differentiate, integrate, and operadic composition on word bundles.
  • Mixed number + word reasoning with clearly defined bridging morphisms and class-mixing guards.
  • Full persistence via NREM consolidation and ego.leg3 self-modeling.

Quick Example

// Build a linguistic bundle + mixed expression
let bundle = LinguisticDiscourseBundle { ... };
let mixed = op_mixed_linguistic_number_scale(&num_phase, &word);

// Run calculus and store result
let delta = op_linguistic_differentiate(&bundle);
let result = op_linguistic_integrate(&[bundle, delta]);

// Store with full continuity
let _ = Leg3Pointer::mint_linguistic(&result, true); // promotes toward ego.leg3

All operations return CRS (Coherence-Reliability Score) and can be verified with mcp_engram_verify_manifold_integrity.


Examples

File What it does
examples/hello-engram-agent.py Minimal MCP loop
examples/mcp_client.py Session + recall + relate + verify
examples/ritual_verify.md Code Edit Ritual walkthrough
docs/examples/marketplace_demo.md Grok plugin demo

Build against target/debug/engram during development.


MCP tools

8 essential for daily work — full map: docs/TOOL_DECISION_MAP.md. Categorized reference: docs/MCP_TOOLS_REFERENCE.md.

Grok plugin slash commands: grok-plugin-engram/commands/.


Deep dive (linked, not repeated here)

Topic Doc
256KB / NVMe / GPU backends docs/architecture.md
CRS / scars / lawfulness docs/GEOMETRIC_MEMORY.md
Process sheaf + sub-agent governance processes/README.md
Substrate wins roadmap docs/SUBSTRATE_WINS_PLAN.md
Marketplace submission docs/MARKETPLACE_SUBMISSION.md
Philosophy MANIFESTO.md

Hardware: CPU (default), CUDA, ROCm, Metal, WebGPU — see docs/DEPLOYMENT_MODES.md.

CLI: engram remember|recall|forget|list|ingest|trace|distill|build-index

Namespaces: mcp_engram_set_namespace("project") or ~/.engram/sheaf.toml


Contributing

CONTRIBUTING.md · AGENTS.md · PR checklist in .github/PULL_REQUEST_TEMPLATE.md

Dev build: cargo build -p engram-server && target/debug/engram --version


License

AGPL-3.0-only. .leg3 format: U.S. Patent Application No. 19/372,256 (pending). Commercial licenses: StaticRoosterMedia@gmail.comPATENT-NOTICE.md.