Blog

skill · curated · mcp · memory · claude-code · Sep 17, 2026 · 2 min read

stash: give your AI agent a 9-stage memory pipeline that learns across sessions

What it is

alash3al/stash is a self-hosted MCP server that gives AI agents persistent memory across sessions. Unlike a flat key-value store or a bare vector DB, it runs every observation through a 9-stage consolidation pipeline: raw episodes → facts → relationships → causal links → patterns → contradiction detection → goal monitoring → failure analysis → validated hypotheses. The stated aim is to approximate how a working developer internalizes a project over time — not just "remember this," but "this decision conflicts with that earlier constraint."

When it earns its keep

If you're on a long-lived project — a multi-week migration, an evolving API, a design system with lots of opinionated choices — stash is the infrastructure-layer answer to what planning-with-files solves at the file layer. The agent builds a real model of your project's known decisions, contradictions, and emerging patterns that persists across every /clear. It also supports Ollama for fully local embeddings, so no observations leave your machine if that matters to you.

The real caveat

The setup cost is non-trivial: you need PostgreSQL with the pgvector extension running before the MCP server starts, which rules out "works in 30 seconds on my laptop." The 9-stage pipeline is also a black box in practice — there's no dashboard to inspect what the agent's cognitive model currently believes vs. what it has merely ingested. For most one-off coding tasks this is clear overkill; the complexity only pays off on genuinely long-running work. At roughly 767 stars it's early-stage, so expect rough edges.

Get it running

bash
git clone https://github.com/alash3al/stash.git
cd stash
cp .env.example .env   # add your API key and model name
docker compose up

Then point your Claude Code or Cursor MCP config at the local server — the exact URL and JSON snippet is in the README. If Postgres overhead isn't appealing, there's a hosted free-beta at usestash.io that skips the self-hosting entirely. Credit: alash3al/stash — Apache 2.0.