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 "Install 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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceSelf-hosted MCP server giving AI agents persistent memory for personalization and context across conversations.Last updated195Apache 2.0
- Alicense-qualityAmaintenanceFramework-agnostic MCP server for agent memory with Postgres + pgvector, enabling persistent memory, recall, and task management across sessions.Last updatedMIT
- Alicense-qualityBmaintenancePersistent memory MCP server that stores and retrieves memories in Markdown files, enabling shared context across multiple AI agents with hybrid search and deduplication.Last updatedMIT
- Flicense-qualityCmaintenanceA self-hosted MCP server that gives AI agents persistent, searchable memory with importance scoring, knowledge graphs, and autonomous memory consolidation.Last updated1
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Person-owned, portable AI memory as a remote MCP server, readable and writable by any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lennymadethat/persistent-memory'
If you have feedback or need assistance with the MCP directory API, please join our Discord server