Recipes

MemoryGate: self-hosted persistent memory layer for AI agents over MCP

Suggested by runchr · today

Research & KnowledgeSoftware & DevOps

Draft — a suggested stack, not yet verified by a member.

Solo founder built an open-source semantic memory store agents share across

What they did

A solo founder, after a decade in enterprise solutions engineering, kept losing agent context whenever a model updated, a platform changed its API, or a context window rolled over — preferences, decisions, project history, relationship context all wiped. They concluded the root problem is that AI memory is trapped inside whichever platform hosts the conversation, so they built MemoryGate as a persistent semantic memory layer that sits outside any single model or provider and connects over MCP (Model Context Protocol). Any MCP-compatible agent — Claude Desktop, ChatGPT, Cursor, custom agents — can store and retrieve memories through a shared durable store. The build includes semantic recall via vector embeddings (recall by meaning, not keywords), confidence-weighted observations that strengthen or decay with evidence, automatic lifecycle management that keeps high-signal memories hot and fades noise to cold storage, an append-only architecture where memories are never overwritten but superseded with lineage, knowledge graphs linking observations, patterns, concepts, and documents, plus multi-tenancy with org isolation, roles, shared stores, OAuth 2.0, audit logs, and rate limiting. Stack is Python/FastAPI, PostgreSQL with pgvector, Redis, deployed on Railway; agents get 33 memory tools on connection. They explicitly scoped it as not a RAG pipeline (it stores what the agent learns from interaction, not document chunks), not prompt injection (memory lives at the infrastructure layer, not stuffed into system prompts), and not tied to any model or provider. Released open source under Apache 2.0, self-hostable, with a hosted SaaS option for people who don't want to run infrastructure, and posted it to Hacker News as a Show HN.

How it went

Shipped as a working open-source project (Apache 2.0) with a self-hostable deployment and a hosted SaaS alternative, plus docs and a GitHub repo. The author reports a functioning MCP-native integration exposing 33 memory tools on connection and production-grade infrastructure features (OAuth, audit logs, rate limiting, multi-tenancy). It is a solo-founder launch posted for feedback rather than a validated product with published adoption or benchmark numbers.

Worth knowing

No benchmarks, latency figures, or retrieval-quality evaluations are shared, so the semantic recall and confidence-decay behavior are unproven against alternatives. The post is a launch pitch, not a usage report — there is no account of real multi-agent workflows running on it. Self-hosting requires operating FastAPI, PostgreSQL with pgvector, and Redis, which is non-trivial. The 33-tool surface may bloat agent context, and the claim that memory is not prompt injection still depends on how agents choose to call the tools. MCP client support varies across Claude Desktop, ChatGPT, and Cursor.

Wiring

MemoryGate runs as a standalone service: a Python/FastAPI app backed by PostgreSQL with pgvector for vector embeddings and Redis for caching/rate limiting, deployable via Railway or self-hosted. Agents connect to it as an MCP server, so the wiring is: agent (Claude Desktop, ChatGPT, Cursor, or a custom MCP client) → MCP connection → MemoryGate API → pgvector store. On connection the agent receives 33 memory tools for storing observations, semantic recall, superseding memories with lineage, and querying the knowledge graph. Auth is OAuth 2.0 with org-scoped roles and audit logging; multi-tenant isolation lets several agents or teams share or separate memory stores. Because memory lives at the infrastructure layer rather than in system prompts, switching models or providers only requires repointing the MCP client at the same MemoryGate endpoint.

Try it yourself

I want to evaluate MemoryGate as a shared memory layer for my AI agents. Please: 1) Read the repo at https://github.com/PStryder/MemoryGate and the docs at https://memorygate.ai/docs/ and summarize the MCP tool surface (all 33 tools), grouped by purpose (store, recall, supersede, graph, admin). 2) Sketch a minimal self-hosted setup: FastAPI app, PostgreSQL with pgvector, Redis, and the required env vars and OAuth config, as a docker-compose file plus a .env.example. 3) Show how to register the MCP server in Claude Desktop and Cursor config files. 4) Write a small script that stores three observations with different confidence levels, then recalls them by meaning to demonstrate semantic search and confidence weighting. 5) List the gaps I should test before trusting it: retrieval quality, latency, multi-tenant isolation, and what happens when a memory is superseded.

Source

Tools in this stack

Run this stack

Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.

npx runchr install runchr/show-hn-memorygate-open-source-persistent-memory-for-ai-
No CLI?curl -s https://api.runchr.com/api/recipes/runchr/show-hn-memorygate-open-source-persistent-memory-for-ai-/manifest
System prompt
You are an assistant helping a solo founder evaluate and operate MemoryGate, a self-hosted MCP memory layer, using the `pi` agent and the `recall` plugin. Read the repo and docs before summarizing or writing config, and report only what the sources support, flagging gaps rather than guessing.

This system prompt was generated from this stack's copy and tools. A person has not reviewed it.

The manifest is also at api.runchr.com/api/recipes/runchr/show-hn-memorygate-open-source-persistent-memory-for-ai-/manifest.