persistent-memory
Deploys the MCP server as a Cloudflare Worker, providing serverless execution.
Uses OpenAI's text-embedding-3 model to generate embeddings for semantic search.
Stores pages and chunks in Supabase PostgreSQL with pgvector for vector similarity search.
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., "@persistent-memorysearch my vault for project ideas"
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.
persistent-memory
Give any AI agent a permanent memory.
Most AI assistants forget everything the moment a conversation ends. This is the infrastructure that fixes that — a self-hostable memory layer any Claude (or other LLM) client can read from and write to, over the Model Context Protocol. Your notes, decisions, and project state live in a Postgres + pgvector store, stay searchable by meaning (not just keywords), and mirror to plain Markdown files you own.
Built and used in production as the memory behind a personal knowledge vault. Extracted here as a clean, reusable starting point.
What you get
Piece | What it does |
MCP server ( | A Cloudflare Worker exposing five tools — |
Vector store ( | Postgres schema for |
Bulk embedder ( | Reads a folder of Markdown, chunks it (~500 tokens), embeds it, and upserts to the store. One command to load your whole knowledge base. |
File-sync mirror ( | Watches a local folder and keeps files ⇄ database in sync both ways, so you can edit in any editor and the memory stays current. |
Related MCP server: ilma
How it works
Any LLM client ──MCP──▶ Worker (5 memory tools) ──▶ Postgres + pgvector
▲ │
└─────────── semantic search results ◀──────────────┘
Your Markdown folder ⇄ file-sync ⇄ same database (edit anywhere, stays in sync)The database is the source of truth; the Markdown files are a backup mirror you can read, grep, and edit offline. Every write re-embeds only what changed, so ongoing cost is pennies.
Quick start
Provision a Postgres with pgvector (Supabase is easiest — the
vectorextension is one click). Run the SQL inmigrations/in order.Configure secrets (never commit these):
SUPABASE_URL— set inserver/wrangler.toml[vars](replaceYOUR_SUPABASE_PROJECT_REF)SUPABASE_SERVICE_ROLE_KEY,OPENAI_API_KEY,AUTH_TOKEN—wrangler secret puteach
Bulk-load your notes:
npm install && npm run embedDeploy the memory server:
cd server && npx wrangler deployConnect a client — add the worker URL as an MCP connector. Auth is via URL path (
POST /mcp/<AUTH_TOKEN>) because some clients don't send Bearer headers.
Design notes
Embeddings: OpenAI
text-embedding-3by default; swap the provider insrc/embed.ts.Auth: single shared
AUTH_TOKENin the URL path. For multi-tenant use, issue one token per agent and validate against a table.Cost: one-time bulk embed is a few dollars for a large vault; ongoing sync is pennies/day.
How this pairs with Mothership long-session memory
These solve different amnesia problems:
Problem | Layer | Where |
“The chat forgot what we decided three hours ago when the window rolled over” | Conversation continuity — Persistent State ledger + verbatim tail + exact | Mothership ( |
“The model doesn’t know my projects, rules, or past work across any chat” | Long-term knowledge — searchable Markdown vault + embeddings | This repo |
Use both. Mothership keeps a single long thread coherent; persistent-memory keeps your wiki available to every agent. Neither should store secrets as pasted values — point at env files / secret stores.
See also docs/memory-layers.md.
License
MIT — see LICENSE. Use it, fork it, build your own memory on it.
Built by lennymadethat.
This server cannot be deployed
Maintenance
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
- memnodeOAuthdev.memnode
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
An MCP memory server. One memory your agents share — across models, devices and apps.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceSelf-hosted MCP server giving AI agents persistent memory for personalization and context across conversations.62 PyPI276Apache 2.0
- AlicenseNot gradedqualityCmaintenanceFramework-agnostic MCP server for agent memory with Postgres + pgvector, enabling persistent memory, recall, and task management across sessions.MIT
- FlicenseNot gradedqualityCmaintenanceA self-hosted MCP server that gives AI agents persistent, searchable memory with importance scoring, knowledge graphs, and autonomous memory consolidation.1-
- AlicenseAqualityAmaintenanceA self-hosted MCP server that gives AI agents shared, long-term memory over a git-backed folder of markdown, enabling persistent knowledge search, read, and write without a database.1626 npm11MIT