I built a self-hosted memory layer that works across Claude, ChatGPT, and Cursor

Reddit r/ArtificialInteligence Tools

Summary

The author introduces an open-source MCP server running on Cloudflare Workers that provides persistent, searchable memory for AI clients like Claude, ChatGPT, and Cursor using vector embeddings and duplicate detection.

*Disclosure: I built this and it’s open source.* Every AI tool has the same problem. Close the chat and it forgets everything. The built-in memory features that exist are black boxes. You can’t search them, audit them, or control what gets stored. **What I built:** An MCP server that runs on Cloudflare Workers and gives any MCP-compatible AI client persistent, searchable memory. Five tools: remember, recall, list\_recent, forget, append. **How it works:** Every note gets embedded using bge-small-en-v1.5 on Workers AI and stored in Cloudflare Vectorize as a 384-dimensional vector. Recall queries by cosine similarity so retrieval works by meaning not keywords. “Users dropping off at checkout” surfaces when you search “conversion problems” with no keyword overlap needed. Long notes are chunked at sentence boundaries with 200-character overlap before embedding. Each section gets its own vector rather than one diluted embedding for the whole note. Duplicate detection runs before every store. Above 95% similarity the write is blocked. Between 85-95% it’s stored but flagged. This stops the brain filling up with repeated context across sessions. The append tool handles updates. When something changes, it adds to an existing entry with a timestamp rather than creating a conflicting duplicate. Write pattern: D1 write is synchronous so the response is instant. Vectorize embedding runs via ctx.waitUntil() in the background so capture stays fast. **Limitations:** No dashboard yet. Browsing memory is raw JSON from an endpoint. Vectorize and Workers AI don’t run in local wrangler dev, you need –remote for real testing. ChatGPT MCP support is in beta via Developer Mode for Plus/Pro users only. **Stack:** Cloudflare Workers, D1, Vectorize, Workers AI. Free tier. [**Repo:**](https://github.com/rahilp/second-brain-cloudflare) [github.com/rahilp/second-brain-cloudflare​​​​​​​​​​​​​​​​](https://github.com/rahilp/second-brain-cloudflare)
Original Article

Similar Articles

Second Brain for AI

Product Hunt

A free persistent memory tool for AI models like Claude, ChatGPT, and Cursor.

rohitg00/agentmemory

GitHub Trending (daily)

agentmemory is an open-source persistent memory layer for AI coding agents (Claude Code, Cursor, Gemini CLI, Codex CLI, etc.) that uses knowledge graphs, confidence scoring, and hybrid search to give agents long-term memory across sessions via MCP, hooks, or REST API. Built on the iii engine, it requires no external databases and exposes 51 MCP tools.