Four-layer memory substrate for long-horizon agents: write-gate admission, signed approvals, hash-chained ledger, revocable and portable.
View on GitHub ↗Long-horizon LLM agents lose themselves in their own context. This repository keeps the working memory small and the memory that matters on disk, split into four layers that different mechanics keep alive.
Author: liubai — project liu bai. Provenance watermark: liu bai (also embedded in exported state files). Version: 0.7.9.
Archived releases. v0.5.0 is deposited on Zenodo: 10.5281/zenodo.23638826 (concept DOI) — version DOI 10.5281/zenodo.23638827. v0.7.9 is the current source release; it is the version the v0.4 review response refers to.
To write and approve your first memory, see docs/INTEGRATING.md §1. A write only becomes loadable after a host approval — that gate is the design.
- MCP (Claude Desktop, Cursor, any MCP client): run four-layer-memory-mcp --root ./memory and paste the JSON from docs/INTEGRATING.md. The model gets twelve tools (memoryload, memoryadd, memoryconsolidate, memorystatus, memoryaudit, memoryquarantine, memoryreview, memoryhandoff, memoryrecall, memoryarchivesearch, memoryarchiveverify, memoryrecordoutcome) and needs no code changes on the host side. None of those tools can approve a write. - Every write leaves an archive. The store keeps an append-only, hash-chained log of the raw text behind each decision (archive/events.jsonl). It is never loaded into a layer, never injected and never exported: it exists so a human can audit what was actually written and recover the original wording behind a typed entry. memoryarchiveverify recomputes the chain; memoryarchivesearch finds raw text the working set no longer holds. - Recall is typed. memoryrec
From the project README.
Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:
[](https://mcp.liqiwa.com/s/liubai-ink--four-layer-memory.html)
Neuro-symbolic agents with verified memory. MCP math tools, an algebra repair Skill, and an open challenge. Verify solutions, learn checked rules, and reuse.
axisrobo/mneme-openOpen-source client SDKs (Python, TypeScript, Go), CLI, API docs, and prebuilt binaries for the Mneme agent cognition runtime (memory, context, ontology, knowledge). Apache-2.0.
ozankasikci/global-agent-memoryLocal-first, project-aware memory MCP server for Claude Code, Codex, and other AI agents, with Obsidian and an owner dashboard.
mienetic/mnema🧠 Mnema — Long-term memory for AI via MCP × Vector DB. Pluggable backends, hybrid search, Auto Dream consolidation, CLI + REST API + SDK.
jackson-cmd/risk-aware-trading-agentsAI trading agents for US stocks with news backtesting that can't see the future: a public LLM trading agent leaderboard (rta-bench-1), frozen point-in-time 2020/2022/2026 markets (prices, VIX, news),
scarletkc/PerennaA lightweight, Git-backed permanent memory for AI agents.
The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.