Stash — Your AI has amnesia. We fixed it.

Open original

Stash is an open-source service that adds continuous memory to any AI model by storing and organizing session data in PostgreSQL with pgvector. It transforms raw conversations into structured facts, relationships, and patterns, so agents recall preferences, avoid repeated errors, and track long-term goals. Integration via MCP makes it model-agnostic, self-hostable, and free of vendor lock-in.

  • Stash gives AI persistent memory by storing conversations in PostgreSQL/pgvector and running a 9-stage pipeline that turns raw episodes into facts, relationships, causal links, patterns, contradictions, goals, and failure detection
  • Unlike RAG's static document search, Stash learns automatically from conversations and outcomes without manual tagging, improving over time
  • It's model-agnostic and vendor-lock-in-free via MCP integration, working with Claude, GPT, or local models
  • Setup requires just three commands (clone repo, configure .env, docker compose up), with self-hosting keeping data local

Stash plugs into any AI agent—Claude, GPT, local models—so it remembers every interaction instead of treating each session as new. Built on PostgreSQL with pgvector, it captures raw observations (“episodes”) and runs a background pipeline that clusters those into “facts,” extracts relationships, maps causal links and patterns, spots contradictions, even tracks goals and repeated failures. You get a persistent, hierarchical memory store—namespaces act like folders (/users/alice, /projects/restaurant-saas, /self/limits)—so personal preferences, project details and the agent’s own strengths stay separate and safe. Traditional Retrieval-Augmented Generation (RAG) only searches static documents when you ask a question. Stash goes further: it learns from conversations, decisions and outcomes without you writing or tagging anything. Over weeks and months it builds a knowledge graph, infers goals, detects mistakes you keep making and corrects itself. RAG is a smarter search engine. Stash is a colleague who recalls every step and gets more useful over time. Setup takes three commands: clone the GitHub repo, copy and edit .env with your API key and model settings, then run docker compose up. Behind the scenes, a consolidation pipeline runs stages—from raw episodes (01) through facts (02), relationships (03), causal links (04), patterns (05), contradictions (06), goal inference (07), failure pattern detection (08) to hypothesis scanning (09). Everything’s open source, model-agnostic and yours to own. Stash speaks the MCP protocol out of the box. Drop it into Claude Desktop, Cursor or any other MCP client in under five minutes. No SDK, no vendor lock-in. Your data stays local if you want, and you can combine Stash with RAG for document searches while maintaining true memory of your evolving projects.

Ask about this article