genesis-memory
Used as the HTTP server framework for the Genesis proxy gateway, which relays OpenAI and Anthropic API traffic.
Amazon Q Developer CLI is one of the 20 auto-wired supported clients, connecting to Genesis Memory via MCP.
Bun is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
Windsurf (Codeium) is an auto-wired client, connecting to Genesis Memory via MCP and proxy primitives.
CrewAI is supported via the proxy gateway by pointing the base URL at the local Genesis proxy.
Deno is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
Docker is wrapped by 'genesis run' as one of 60+ supported headless toolchains, with interactive shapes refused.
Genesis writes a canonical env file at ~/.genesis/genesis.env for proxy configuration by any SDK or framework.
Git is wrapped by 'genesis run' as a supported toolchain, and Git SHAs pass the privacy shield untouched.
GitHub is wrapped via the gh CLI in 'genesis run', and GitHub credentials are detected by the privacy shield.
Google API credentials are detected by the privacy shield's structural vendor patterns.
Gradle is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
Helm is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
Hugging Face credentials are detected by the privacy shield's structural vendor patterns.
JetBrains Junie / AI Assistant is an auto-wired client, connected via MCP and proxy primitives through ~/.junie/mcp/mcp.json.
LangChain is supported via the proxy gateway by pointing the base URL at the local Genesis proxy.
Genesis exports native Lua snippets for Neovim MCP clients such as mcphub, Avante, and CodeCompanion.
Make is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
Neovim is an auto-wired client via mcphub and related plugins, supporting MCP and proxy primitives.
npm is wrapped by 'genesis run' as a supported headless toolchain, and npm credentials are detected by the privacy shield.
The proxy gateway supports OPENAI_BASE_URL, relaying and compacting OpenAI /v1/chat/completions requests, and recognizes OpenAI API keys in its privacy shield patterns.
pnpm is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
Poetry is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
Pytest is wrapped by 'genesis run' as a supported headless toolchain.
Python is the implementation language for the MCP server and its SDK clients.
Ruff is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
SendGrid credentials are detected by the privacy shield's structural vendor patterns.
Slack credentials are detected by the privacy shield's structural vendor patterns.
SQLite in WAL mode is the local storage backend for the shared memory database (memory.db) used by all clients.
Stripe credentials are detected by the privacy shield's structural vendor patterns.
Terraform is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
TOML is a supported export format for canonical mcpServers configurations and for clients like Codex CLI.
YAML is a supported export format for canonical mcpServers configurations and markers, used by clients like Continue.dev, Goose, and Aider.
yarn is wrapped by 'genesis run' as one of 60+ supported headless toolchains.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@genesis-memoryremember the fix for the auth race condition we debugged yesterday"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Why
Every AI coding agent has the Goldfish Effect: each session starts from nothing. Decisions, invariants, half-finished threads and hard-won debugging insight evaporate. You repeat yourself; the agent re-reads 80k tokens of test output; your bill grows.
GENESIS is a local-first cognitive memory OS that sits between your agents and their models:
Primitive | What it does | Who uses it |
MCP (stdio) | 19 cognitive tools — | Cursor, Claude Code/Desktop, VS Code, Zed, Windsurf, JetBrains, Neovim, Emacs, Codex, Gemini CLI, Amazon Q, Goose, Cline, Roo, Continue |
Hook (pre-prompt) | Injects a ≤200-token subconscious capsule: active thread, last cross-client dialogue turn, matching skills, top engrams, one recall directive | Cursor 1.7 hooks, Claude Code |
Proxy (stateless gateway) |
| Any SDK, LangChain, LlamaIndex, CrewAI, AutoGen, Aider, anything with a base URL |
Everything is stdlib-only Python, runs under 100 MB RSS, stores to one WAL-mode SQLite file, and never phones home.
Related MCP server: memento
Quick start
pip install genesis-memory # or: git clone … && pip install -e .
genesis setup --preview # read-only: what is installed, what would be wired
genesis setup --yes # wire every detected client (timestamped backups; --revert undoes)
genesis dashboard --open # Mission Control at http://127.0.0.1:8090
genesis run -- pytest tests/ # headless, spooled, exit-code preserving
genesis doctor # system diagnostics, client matrix & update check
genesis upgrade # 1-click self-upgrade to the latest releaseAnything not auto-detected:
genesis clients # the universal matrix with detection status
genesis export-config --client zed --format native # exact snippet in the client's own dialect
genesis export-config --format toml # canonical mcpServers as TOML / yaml / json / env / lua / elisp
genesis export-config --all --out ./snippets # one file per clientUniversal client support
genesis setup is a data-driven registry (genesis_memory/cli/client_registry.py): each client declares where its config lives, how to detect it, which primitives it supports and how to render the patch in its own dialect. JSON/JSONC files are deep-merged (your existing servers and comments survive); YAML/TOML/Lisp/dotenv files get an idempotent >>> genesis-memory >>> marker block that re-runs replace and --revert removes.
Client | Config | Primitives | Format |
Cursor |
| MCP · Hook · Proxy | json |
Claude Code |
| Hook · MCP · Proxy | json |
Claude Desktop |
| MCP | json |
OpenCode |
| MCP · Proxy · Hook | jsonc |
Antigravity IDE |
| MCP · Hook | native |
Windsurf (Codeium) |
| MCP · Proxy | json |
Zed |
| MCP · Proxy | jsonc |
VS Code (Copilot agent mode) |
| MCP · Proxy | jsonc |
Cline |
| MCP · Proxy | json |
Roo Code |
| MCP · Proxy | json |
Continue.dev |
| MCP · Proxy | yaml |
JetBrains Junie / AI Assistant |
| MCP · Proxy | json |
Neovim (mcphub · Avante · CodeCompanion · Copilot.lua) |
| MCP · Proxy | json / lua |
Emacs (gptel · aidermacs · mcp.el) |
| MCP · Proxy | elisp |
Aider |
| Proxy | yaml |
OpenAI Codex CLI |
| MCP · Proxy | toml |
Gemini CLI |
| MCP | json |
Amazon Q Developer CLI |
| MCP | json |
Goose (Block) |
| MCP · Proxy | yaml |
Any SDK / framework (LangChain, LlamaIndex, CrewAI, AutoGen, OpenAI, Anthropic) |
| Proxy | env |
# Zero code changes for any framework: point the base URL at the gateway.
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="not-needed")Architecture
flowchart LR
subgraph Clients["20 AI clients · any SDK"]
C1[Cursor] --- C2[Claude Code] --- C3[VS Code / Zed / JetBrains] --- C4[Neovim / Emacs] --- C5[LangChain · CrewAI · …]
end
Clients -- "stdio MCP (19 tools)" --> D[genesis-daemon<br/><100 MB RSS · stdlib only]
Clients -- "pre-prompt hook<br/>≤200-token capsule" --> H[subconscious_hook.py]
Clients -- "OPENAI_BASE_URL / ANTHROPIC_BASE_URL" --> P[genesis-proxy :8000<br/>/v1/chat/completions · /v1/messages]
D & H & P --> S[(memory.db<br/>SQLite WAL · busy 5000ms<br/>BEGIN IMMEDIATE + retry)]
R[genesis run<br/>headless spooler] -- "redacted bytes" --> SP[(~/.genesis/spool<br/>TTL 7d · LRU 500MB)]
S --> SL[sleep daemon<br/>Hebbian decay · skills · digest]
S & SP & P --> M[Mission Control :8090<br/>SSE telemetry · read-only]
PS[[Privacy Shield<br/>15 patterns + Shannon entropy]] -.guards.-> S & SPRepository layout
genesis_memory/
├── core/
│ ├── db.py # WAL + busy_timeout + BEGIN IMMEDIATE + jittered retry (shared by every process)
│ ├── privacy_shield.py # structural patterns + Shannon-entropy detector; redact()/scan()/redact_bytes()
│ ├── hebbian_engine.py # stability τ, decay, reinforcement
│ ├── skill_synthesizer.py # recurring outcomes → procedural skills
│ ├── ast_edge_extractor.py # dependency closure for attest_closure
│ ├── licensing.py # offline HMAC-SHA256 tiers
│ └── team_sync.py # enterprise vector-clock sync
├── daemon/server.py # stdio MCP daemon · versioned schema · lock-storm resilient dispatch
├── hooks/subconscious_hook.py# ≤200-token capsule, ambient turn capture
├── proxy/ # aiohttp gateway (OpenAI + Anthropic), compactor, distiller, pricing engine (+ bundled catalog)
├── cli/
│ ├── run.py # genesis CLI · 60+ toolchain headless spooler
│ ├── client_registry.py # universal data-driven client matrix (20 specs, aliases, dialect renderers)
│ ├── config_formats.py # dependency-free JSON/YAML/TOML/env emitters + marker-block merger
│ ├── export_config.py # genesis export-config / genesis clients
│ ├── init_cmd.py # genesis setup · preview · backup · --revert
│ └── templates/opencode_plugin.js
├── sleep/ # consolidation cycle, digest, ledger
└── dashboard/ # Mission Control (stdlib HTTP + SSE) and static/index.html cockpit
site/ # React 19 + Vite 7 landing page with live interactive demos
tests/ # 421 tests: chaos, concurrency, multi-process, privacy, clients, dashboard, proxyCapabilities
Lossless headless spooling — genesis run
Wraps 60+ toolchains (pytest ruff mypy black tsc npm pnpm yarn bun deno cargo go dotnet gradle mvn make docker kubectl helm terraform pip uv poetry git gh …) in a strict headless environment (CI=1 TERM=dumb NO_COLOR=1 PAGER=cat GIT_TERMINAL_PROMPT=0 PIP_NO_INPUT=1 …), refuses interactive shapes (git rebase -i, docker run -it, --watch), captures every byte to an atomic spool, prints a ≤10-line summary with a ctx:log/<id> pointer and preserves the exit code. Agents dereference with genesis_log(id, grep=…).
Zero-trust privacy shield
Two independent detectors — 15 structural vendor patterns (OpenAI, Anthropic, Google, GitHub, AWS, Slack, Stripe, SendGrid, npm, Hugging Face, JWT, Bearer, PEM, basic-auth URLs, KEY=value) and a Shannon-entropy gate at 4.0 bits/char for credentials with no known prefix. Git SHAs, URLs, paths and identifiers pass untouched. Applied at remember() (reject), thread/dialogue fields (redact), and the spool before the atomic write (GENESIS_SPOOL_RAW=1 opts out).
Bulletproof SQLite concurrency
Every connection goes through core/db.py: WAL journal, busy_timeout=5000, synchronous=NORMAL, BEGIN IMMEDIATE transaction scope, jittered exponential retry, and read-only URIs for dashboards/reports. The MCP dispatcher rolls back and retries a tool call that loses a write race. The suite runs 8 threads × 25 writes and 4 processes × 15 JSON-RPC calls against one file and asserts zero database is locked.
Stateless gateway — OpenAI and Anthropic
POST /v1/chat/completions and POST /v1/messages both get structural tool-pair compaction, memory capsule injection and streaming passthrough with TTFT preserved. Shadow mode measures without mutating. GET /v1/telemetry, /v1/pricing, /v1/receipts/{id}, /v1/recovery/{id}.
Biomimetic sleep consolidation
Engrams carry a stability τ; retention decays as e^(−age/τ). Reinforcement widens τ, contradiction narrows it, dormant engrams are tombstoned, recurring wins are distilled into skills, and a bounded Active Digest primes the next session.
Mission Control dashboard — genesis dashboard
Zero-dependency cockpit on :8090, streaming /api/stream SSE: token/dollar diet ticker, orbital Memory Universe (drag · zoom · inspect · reinforce), BM25 Engram Explorer with keyboard navigation, Conflict Deck (accept / keep / dismiss), Skill Browser, Hebbian Sleep curves, Client Mesh with live detection, Privacy Shield sandbox, spool & ledger, and a ⌘K command palette. Read-only over WAL; every action is an explicit audited POST.
MCP tools
Tool | Purpose |
| Episodic store with FTS5 BM25 ranking, utility scoring, supersession |
| Hebbian +1 / −1 from outcomes |
| Propose a better rule; human veto queue |
| Unified cross-client active work thread |
| Cross-client conversational continuity with provenance |
| Procedural memory |
| AST dependency closure attestation |
| Dereference spooled output (grep / pagination / chunked) |
| Consolidation trigger; health & counters |
| One-tool gateway: |
Set GENESIS_MCP_TOOL_MODE=gateway to advertise only the gateway tool and shrink every-turn schema bytes.
Benchmarks (reference machine, tests/)
Scenario | Before | After | Δ |
| ~79,200 tok | 84 tok | −98.4 % |
Subconscious capsule vs. whole store | 21,480 tok | 176 tok | −99.2 % |
14-turn conversation + 2,200 tool lines via gateway | 60,800 tok | 3,030 tok | −95.0 % |
Recall latency @ 10k engrams | — | < 50 ms | — |
Daemon RSS steady state | — | ≈ 30 MB | budget 100 MB |
8 procs × concurrent writes to one DB | — | 0 lock errors | — |
Testing
python -m pytest tests/ # 421 passed, 1 skipped
python -m pytest tests/test_db_hardening.py # multi-thread + multi-process lock storm
python -m pytest tests/test_privacy_shield.py tests/test_universal_clients.py tests/test_dashboard_server.pyLicensing
Source-available under the Business Source License 1.1 (free for individuals, teams under 10, and all non-production use; converts to MIT on 2029-09-11). Versions ≤ v0.6.1 stay MIT forever. See LICENSE.
Offline-first HMAC-SHA256 — works air-gapped.
Community | Developer Pro | Enterprise Gateway | |
Price | Free / Community | $14 mo · $12 annual | $39 seat/mo · $32 annual |
Local SQLite memory · hook · spooler · 20-client setup · privacy shield | ✅ | ✅ | ✅ |
High-ratio compactor · Hebbian sleep · dashboard · live pricing · Anthropic route | — | ✅ | ✅ |
Team shared memory sync · on-prem Docker gateway · audit logs · SLA | — | — | ✅ |
genesis auth --key GEN-PRO-<key>
genesis licenseLinks
RELEASE_CHANGELOG.md — every change in v0.5.0, with rationale and impact
docs/ARCHITECTURE.md · docs/MCP_SPEC.md · llms.txt · openapi.json
Landing page:
cd site && npm install && npm run build && npm run preview→ http://localhost:4173
This server cannot be deployed
Maintenance
Related MCP Connectors
- memnodeOAuthdev.memnode
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Persistent memory for AI agents — log and recall conversation context over MCP.
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Related MCP Servers
- AlicenseAqualityAmaintenanceLocal-first MCP server that gives any AI coding agent per-project memory, workflow intelligence, and always-on, lossless token & context optimization.3760 npm6MIT
- AlicenseNot gradedqualityAmaintenanceProvides persistent memory for AI coding agents via MCP, enabling agents to store and semantically recall facts, events, and lessons across sessions, all running locally without cloud dependencies.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceLocal-first memory daemon for AI coding agents that captures session transcripts, distills typed memories (decisions, facts, lessons, commands, todos), and serves them via hybrid search through MCP tools.88 npmMIT
- AlicenseBqualityAmaintenanceEnables AI coding agents to maintain persistent project context, including rules, decisions, environment intelligence, and Git history, using a local-first MCP server with automatic project detection and token-efficient retrieval.13MIT