Skip to content

ECD5A/Memory-Genome-Engine

Memory Genome Engine

Rust 1.95+ Apache 2.0 Local-first memory Binary storage CLI TUI MCP Encrypted stores Python TypeScript SDK
Русская версия

Memory Genome Engine gives AI agents durable, local-first project memory they can recall across sessions without requiring a cloud service or vector database. It stores typed MemoryCell records, describes them with MarkerGenome, moves cold memory into sealed binary pages, and returns task-relevant ContextPacket output.

Memory Genome Engine terminal dashboard

What It Does

  • Remembers facts, decisions, preferences, notes, and agent observations.
  • Keeps recent memory in fast L1 Hot RAM with durable binary persistence.
  • Seals older memory into immutable binary pages with candidate indexes.
  • Supports focused, broad, and full-scope recall.
  • Imports existing Markdown notes as one-time migration input and supports soft memory status maintenance.
  • Provides CLI, TUI, an MCP-compatible stdio server, Python SDK, and TypeScript SDK.
  • Supports opt-in encrypted stores for hot payloads, snapshots, and sealed page payloads.
  • Uses binary runtime storage; JSON is protocol/debug report output only.

Why MGE

MGE treats agent memory as an inspectable local subsystem rather than an opaque chat-history or hosted-search feature:

  • MarkerGenome keeps scope, kind, status, trust, sensitivity, subject, and custom markers explicit.
  • The hot-to-sealed lifecycle combines immediate RAM recall with durable, validateable binary storage.
  • ContextPacket returns ranked memory together with constraints, warnings, and score details for agent workflows.
  • CLI, MCP-compatible stdio, and thin SDKs expose the same Rust engine without requiring a cloud service, embedding model, or vector database.

Marker-first retrieval is deterministic and lightweight, but it is not universal semantic search. Query anchors and ingestion quality matter, and default recall ranks candidates rather than automatically abstaining. Agent hosts that prefer silence over weak matches can opt in with --min-score / min_score. The measured evidence and limitations are documented separately.

Measured Evidence

Local release-mode retrieval runs use strict top-5 scoring and official dataset files supplied outside the repository:

Dataset / default Exact focused path Memories Hit@5 Recall@5 MRR@5
LongMemEval Oracle 4,578 0.972 0.877 0.775
LongMemEval-S 85,253 0.896 0.782 0.701
LoCoMo 5,881 0.531 0.487 0.393

These measure retrieval from deterministic adapters, not final LLM answer quality or superiority over another product. Dataset revisions, checksums, ingestion rules, BM25 diagnostics, context-budget measurements, and limitations are in Release.

Quick Start

Install a checksummed release using the Quickstart, then initialize a store and optionally connect a local agent host:

mge setup
mge setup codex
mge setup claude-code
mge setup cursor
mge remember "User prefers concise technical answers" --kind user_preference --scope global --trust user_confirmed
mge recall "How should the agent answer technical questions?"
mge seal
mge validate --deep

mge setup codex, mge setup claude-code, and mge setup cursor register the local mge-mcp-server for those hosts. mge setup generic-mcp prints a portable stdio configuration for other tools.

Terminal UI:

mge tui
mge setup --help

Encrypted Store

export MGE_PASSPHRASE="use-a-real-secret"
mge init --encrypted --passphrase-env MGE_PASSPHRASE
mge remember "private memory" --passphrase-env MGE_PASSPHRASE
mge recall "private memory" --passphrase-env MGE_PASSPHRASE
mge seal --passphrase-env MGE_PASSPHRASE
mge validate --deep --passphrase-env MGE_PASSPHRASE

Payload encryption protects hot records, snapshots, and sealed page payloads. Metadata such as marker dictionary, indexes, catalog summaries, Markdown export, and process memory while unlocked remains plaintext by design. See Security.

Agent Integration

Agents can use the same local store through CLI commands, the MCP-compatible stdio server, or thin SDK wrappers.

CLI recall:

mge recall "project context" --mode broad --scope my_project

MCP stdio server for any compatible host:

mge-mcp-server --store .memory-genome

SDK examples:

python examples/python_agent_host.py
node examples/typescript_agent_host.ts

See Integration for encrypted host setup, schemas, structured errors, and SDK details.

Documentation

Community

Donate

If Memory Genome Engine is useful to your work, you can support the project here:

  • Bitcoin (BTC): 1ECDSA1b4d5TcZHtqNpcxmY8pBH1GgHntN
  • USDT (TRC20): TUF4vPdB6QkjCvZq18rBL4Qj4dK5ihCN75

Contact

For commercial integration, support, collaboration, and partnership inquiries:

Email   Telegram   GitHub repository

About

Local-first structured memory engine for AI agents with binary storage, CLI/TUI, MCP-ready JSON-RPC, SDKs, and optional encrypted stores.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors