living-memory
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Living Memory · الذاكرة الحية
The durable mind layer for autonomous agents. A local-first memory system that lets an agent remember, reflect, and resume work across sessions — without starting from zero and without surrendering its memory to a vendor.
Live demo: https://pawloblock-byte.github.io/living-memory/
Runs entirely in your browser with a built-in simulated model. No API key, no account, no server needed to try it. Your memories stay in IndexedDB on your device.
Why
Most agents have a context window, not a memory. When the window closes they forget decisions, preferences, and unfinished work. Living Memory gives them a small, honest, open memory layer:
Retain — store facts, decisions, preferences, procedures and feedback.
Recall — hybrid relevance: semantic similarity + recency + importance + reinforcement + tags.
Reflect — compress episodes into durable semantic knowledge.
Maintain — deduplicate, detect contradictions, decay, archive and purge.
Resume — reconstruct project state, last session and next step for a new agent.
It is model-agnostic, self-hostable, and readable for decades (plain JSON/SQLite, no proprietary format).
Related MCP server: mnemo
Core model
Every memory lives on two axes plus a lifecycle:
Axis | Values |
Type |
|
Network |
|
Lifecycle | active → superseded / trashed → purged |
Deduplication: near-identical memories (cosine ≥ 0.94 and token Jaccard ≥ 0.7) are merged instead of piled up.
Contradiction handling: a new memory supersedes an old one only when it shares a subject/tag or uses an explicit change cue (
instead,moved to,switched,انتقل,بدل,تغير,الآن,لم يعد). History is never silently overwritten — the old memory is kept with asupersededBypointer.Forgetting is a feature: decay lowers salience, low-value items move to trash, trash is purged after a retention window. Pinned memories are protected.
Features
Browser app — React 19 + Vite, bilingual English/Arabic with full RTL, dark futuristic UI, mobile-first.
Local-first — all state in IndexedDB; export/import the whole mind as JSON.
Encrypted secrets — LLM API keys encrypted with AES-256-GCM using a non-extractable browser
CryptoKey; file vault encrypted the same way.Bring your own model — OpenAI, Anthropic, Google, any OpenAI-compatible local server (Ollama, LM Studio, vLLM), or the built-in simulated adapter.
Server mode — Fastify API with SQLite (default) or PostgreSQL, wallet/Google auth, per-user agents, and an MCP endpoint.
MCP — expose memory to Claude Code / any MCP client over JSON-RPC (
initialize,tools/list,tools/call).Solana payments — 7-day trial, then $19/month, paid on mainnet-beta and verified on-chain by the server before activation. The treasury address is never rendered in the UI.
Quick start (web)
git clone https://github.com/pawloblock-byte/living-memory.git
cd living-memory
npm install
npm run dev # http://localhost:5173Build a static site:
npm run build # apps/web/dist
npm run build:pages # same, with base path /living-memory/Open the app → Continue with wallet (Phantom/Solflare) or Try the demo. The demo seeds a sample project, session and memories so you can see recall, reflection and resume immediately.
Quick start (API)
cp .env.example .env
npm run dev:api # http://localhost:8787
curl http://localhost:8787/healthWith no DATABASE_URL, data is stored in ./data/living-memory.sqlite (via the built-in node:sqlite). Set DATABASE_URL=postgres://… for PostgreSQL.
Auth
POST /auth/nonce→{ nonce, message }Sign
messagewith the wallet (ed25519).POST /auth/walletwith{ walletAddress, message, signature, nonce }→{ token }Send
Authorization: Bearer <token>on every request.
Google sign-in: POST /auth/google with a Google ID token credential (verified against Google's tokeninfo; set GOOGLE_CLIENT_ID to enforce audience).
Main endpoints
Method | Path | Purpose |
GET |
| liveness + backend info |
POST |
| authentication |
GET/POST |
| list/create agents |
GET/POST |
| list / recall / retain |
GET |
| one memory + links |
POST |
| lifecycle |
GET |
| recall |
GET |
| prompt-ready context block |
GET |
| project + session handoff |
POST |
| chat with memory injection |
POST/GET |
| maintenance |
GET/POST |
| projects and sessions |
GET |
| export one agent's mind (JSON) |
GET/POST |
| trial + on-chain activation |
POST |
| MCP JSON-RPC endpoint |
MCP client config
{
"mcpServers": {
"living-memory": {
"url": "https://your-host/mcp",
"headers": { "Authorization": "Bearer <token>" }
}
}
}Tools: living_memory_retain, living_memory_recall, living_memory_reflect, living_memory_resume, living_memory_context, living_memory_stats.
Self-hosting with Docker
cp .env.example .env
# set JWT_SECRET, MASTER_KEY, TREASURY_ADDRESS, and optional DATABASE_URL
docker compose up --buildThe compose file runs the API with a persistent volume (lm-data) and the web app behind nginx. To use PostgreSQL, uncomment the db service and set DATABASE_URL. See ARCHITECTURE.md and SECURITY.md.
Payments — honest version
The product is 7 days free, then $19 / 30 days.
Payment is a plain SOL transfer to the project treasury on Solana mainnet-beta, approved in the user's wallet.
The browser builds the transfer, the wallet signs it, then the server independently verifies the transaction (
getTransaction) for recipient, amount and sender before activating the subscription. Client claims are never trusted.The treasury address is configuration, not UI. It is never rendered in the product.
Static demo vs. enforcement: the GitHub Pages build activates the subscription locally to demonstrate the flow; it is not a payment boundary. Only the API verifies the transaction on-chain before activation.
Not implemented yet: fully automatic on-chain recurring billing through the Solana Subscriptions program. Current activation is per period; renewal is a new verified payment. This is stated plainly instead of pretending otherwise.
Security model
Security is layered, and the limits are stated instead of hidden.
Client (web)
The entire memory snapshot is encrypted at rest with AES-256-GCM using a non-extractable
CryptoKey. Raw IndexedDB no longer contains readable memories; legacy plaintext snapshots migrate automatically.A strict Content-Security-Policy is injected into the production HTML: no
unsafe-eval, no inline scripts, no third-party JavaScript. Only Google Identity Services is allowed, for sign-in.The Google Fonts stylesheet and all other third-party assets were removed; the UI uses the system font stack and works offline. Google Sign-In may load its own button font from Google.
No
dangerouslySetInnerHTML,innerHTML,evalornew Functionin application code;npm run security:checkfails CI if one appears or if the CSP weakens.LLM keys and vault files are encrypted with the same non-extractable key.
Server
Helmet security headers, per-route rate limits (auth/payment), 1 MB body limit and request timeouts.
Single-use nonces with an atomic claim, ed25519 signature verification, HMAC JWTs, and production startup refuses to run without
JWT_SECRETandMASTER_KEY.Explicit CORS allowlist in production (
CORS_ORIGINS); ownership checks on every agent route.Payments are verified on-chain, priced at the live SOL rate with tolerance, and each signature can activate only one account.
The server memory snapshot is AES-256-GCM encrypted with
MASTER_KEYbefore it reaches SQLite/PostgreSQL; legacy rows migrate on load.
Honest limits — read this
No browser app can fully protect against active XSS or a malicious extension running in the same origin. A non-extractable key cannot be exported, but injected code can call the app's own decrypt functions while the page is open. Encryption protects data at rest (stolen disk/backup, casual inspection), not a compromised live session.
Anyone with physical access and an unlocked browser profile can read the decrypted session. Use full-disk encryption, a separate browser profile, and lock your device.
GitHub Pages cannot send custom HTTP headers. The meta CSP covers script execution there, but
frame-ancestors/HSTS/COOP require a real server. The included nginx image sets the full set; use it (or Cloudflare) for a hardened deployment.Wallet extensions inject provider scripts by design; only install reputable wallets and keep them updated.
See SECURITY.md for the full threat model and deployment checklist.
Repository layout
apps/web React SPA (local-first, static-deployable)
apps/api Fastify API, SQLite/Postgres, MCP
packages/memory-engine retention, recall, reflection, maintenance
packages/solana-gate plan, access states, on-chain payment verification
packages/llm-adapters OpenAI/Anthropic/Google/local/simulated adapters
packages/shared-types shared domain typesDevelopment
npm run typecheck
npm test # memory engine + encrypted persistence
npm run test:solana # payment gate
npm run build
npm run security:check # DOM sinks, cleartext URLs, production CSPContributions are welcome — see CONTRIBUTING.md.
License
MIT © Living Memory contributors. See LICENSE.
بالعربية
الذاكرة الحية طبقة ذاكرة دائمة للوكلاء الأذكياء. يتذكر الوكيل الحقائق والقرارات والتفضيلات، يتأمل تجاربه ليستخلص معرفة دائمة، ويستأنف العمل من حيث توقف بدل أن يبدأ من الصفر.
جرّب الآن: https://pawloblock-byte.github.io/living-memory/ — يعمل داخل المتصفح بذاكرة محلية، دون مفتاح API.
التثبيت:
npm install && npm run dev، أوdocker compose up --buildللاستضافة الذاتية.الخصوصية: كل شيء محلي أولًا. مفاتيح النماذج مشفّرة AES-256-GCM، ويمكن تصدير الذاكرة كاملة بصيغة JSON.
الاشتراك: تجربة 7 أيام ثم 19 دولارًا كل 30 يومًا، تُدفع على شبكة Solana الرئيسية ويتم التحقق منها على السلسلة قبل التفعيل. لا يظهر عنوان الخزينة في الواجهة إطلاقًا.
الترخيص: MIT.
اقرأ ARCHITECTURE.md لفهم المحرك، وSECURITY.md لنموذج الأمان.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Cross-tool persistent memory and context for AI assistants over MCP.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceCollects session JSONL from Codex and Claude Code into local SQLite memory, exposed through MCP with tools for memory context, search, get, put, forget, sleep, and status.-
- AlicenseNot gradedqualityCmaintenanceEnables Claude and other MCP hosts to persist and recall long-term agent memories—episodic turns, semantic facts with conflict-aware versioning, and procedural rules—using scored retrieval and supporting deletion.MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients such as Claude Code, Codex CLI, Cursor and Cline to keep persistent, local-first memory across sessions, backed by a SQLite store with a web dashboard and background reflection services. It lets agents save and recall context automatically without sending data off the machine.446 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible coding agents to store, search, and manage persistent local project memories across sessions, with context injection, feedback-driven reinforcement, analytics, and archiving.MIT