Stash

Memory and knowledge

Stash, persistent memory layer for AI agents. Episodes, facts, and working context stored in Postgres. MCP server included. Self-hosted, single binary, no cloud required.

Your AI app calls the Stash MCP server, which does the memory and knowledge work and sends the result back to the chat.

About Stash

Stash is a community MCP server from alash3al, filed in our directory under memory and knowledge. Stash, persistent memory layer for AI agents. Episodes, facts, and working context stored in Postgres. MCP server included. Self-hosted, single binary, no cloud required.

Stash runs as a remote server at https://usestash.io/mcp, so there is nothing to install: your AI app connects over streamable HTTP, and most remote servers ask you to sign in with OAuth the first time.

At a glance

Publisher
alash3al (community)
Runs
As a hosted remote server
Written in
Go
License
Apache-2.0
GitHub stars
771

How to set up Stash

  1. Nothing to install: Stash is a remote server, so all you need is an AI app that accepts a remote MCP URL.
  2. Check the Stash README for keys or settings; the registry lists none that Stash requires.
  3. Add Stash to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Stash tools to confirm the connection.
  5. Run one read-only task with Stash first, and keep your app asking before each tool call until the results look right.

Stash compared with similar servers

  • Dsh Memory by FuRongJun-1999 has fewer GitHub stars than Stash (769 against 771); both are community servers, and Dsh Memory runs on your own machine and Stash runs as a remote server.
  • Hippo memory by kitfunso has more GitHub stars than Stash (801 against 771); both are community servers, and Hippo memory runs on your own machine and Stash runs as a remote server.
  • Context Portal by GreatScottyMac has fewer GitHub stars than Stash (767 against 771); both are community servers, and Context Portal runs on your own machine and Stash runs as a remote server.

Before you connect Stash

  • Give Stash its own sign-in or token with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Stash tool call until you trust what it does with them.
  • Treat text that Stash fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Stash on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Stash

How marketing and sales teams put Stash to work, by company size. Pick the size closest to yours and start Stash on one use case.

Small business

  • A small business can give Stash its offers, FAQs and tone of voice once, so every draft starts from the same facts.
  • Founders can use Stash to keep notes from calls and decisions, then ask what was agreed with a customer weeks later.
  • Stash runs as a remote server, so a small team can connect it in a few minutes with no install to maintain.

Mid-market

  • Marketing teams can connect Stash to positioning docs and past campaigns, so agents write on message without a long prompt each time.
  • Sales and marketing can share one knowledge base through Stash, so answers about pricing and features match across teams.
  • Start Stash on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can use Stash with permissions that follow the source documents, so an agent only recalls what the person asking may see.
  • Large orgs can make Stash the approved memory layer for agents, with retention rules and a way to delete what shouldn't be kept.
  • Stash is a community server, so have security review the code and pin a version before Stash touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Stash README

From alash3al/stash on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

Stash

Your AI has amnesia. We fixed it.

Every LLM starts every conversation from zero. Stash gives your agent persistent memory, it remembers, recalls, consolidates, and learns across sessions. No more explaining yourself from scratch.

Open source. Self-hosted. Works with any MCP-compatible agent.

Want persistent AI memory in 30 seconds, no Docker, no Postgres, no API keys?

Stash Cloud (usestash.io) is the hosted version built for everyday cross-tool use, free to start, no credit card required.

  1. Add one remote MCP URL to Claude, Claude Code, Cursor, Codex, OpenCode, or Replit:
    https://usestash.io/mcp
    
  2. Sign in and approve the connection (OAuth, per-app access you can revoke in one click).
  3. Get semantic search, structured folders, pinned project rules, live skills, version history, and shared team brains out of the box.

Listed in the Official MCP Registry (io.usestash/memory) · Try Stash Cloud →

Quick Start

git clone https://github.com/alash3al/stash.git
cd stash
cp .env.example .env   # edit with your API key + model
docker compose up

That's it. Postgres + pgvector, migrations, MCP server with background consolidation, all in one command.

Next: Getting Started guide, connect your MCP client, run init / remember / recall, and verify everything works.

Fully local (no cloud API): Ollama setup guide, host Ollama + Docker Compose, private embeddings and reasoner.

Atlas Cloud

Atlas Cloud is a full-modal AI inference platform that gives developers a single AI API to access video generation, image generation, and LLM APIs. Instead of managing multiple vendor integrations, you connect once and get unified access to 300+ curated models across all modalities.

Check out Atlas Cloud's coding plan promotion: https://www.atlascloud.ai/console/coding-plan

Stash already supports Atlas Cloud through its OpenAI-compatible API. Set your .env like this:

STASH_OPENAI_API_KEY=your-atlas-cloud-api-key
STASH_OPENAI_BASE_URL=https://api.atlascloud.ai/v1
STASH_EMBEDDING_MODEL=text-embedding-3-small
STASH_REASONER_MODEL=deepseek-ai/DeepSeek-V3-0324
STASH_VECTOR_DIM=1536

Atlas Cloud works well here because Stash only needs:

  • an embeddings model for vectorization
  • a chat-capable reasoning model for consolidation
  • an OpenAI-compatible base URL and API key

See Getting Started for a fuller configuration checklist.

MCP Client Setup

After docker compose up, Stash exposes an MCP server over SSE at:

http://localhost:8080/sse

Point any MCP-compatible client at that URL. Example configs:

Cursor, ~/.cursor/mcp.json

{
  "mcpServers": {
    "stash": {
      "url": "http://localhost:8080/sse"
    }
  }
}

Claude Desktop, claude_desktop_config.json

{
  "mcpServers": {
    "stash": {
      "url": "http://localhost:8080/sse"
    }
  }
}

OpenCode, ~/.config/opencode/config.json

{
  "mcp": {
    "stash": {
      "type": "remote",
      "url": "http://localhost:8080/sse",
      "enabled": true
    }
  }
}

Windsurf, ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "stash": {
      "url": "http://localhost:8080/sse"
    }
  }
}

Works with any agent that supports MCP over SSE, Claude Desktop, Cursor, Windsurf, Cline, Continue, OpenAI Agents, Ollama, OpenRouter, Atlas Cloud-backed setups, and more.

What It Does

Stash is a cognitive layer between your AI agent and the world. Episodes become facts. Facts become relationships. Relationships become patterns. Patterns become wisdom.

A 9-stage consolidation pipeline turns raw observations into structured knowledge, facts, relationships, causal links, patterns, contradictions, goal tracking, failure patterns, and hypothesis verification. Each stage only processes new data since the last run.

Stash Cloud vs. Self-Hosted

For most people, Stash Cloud (usestash.io) is the fastest way to get persistent memory across every AI tool without maintaining a database, embeddings provider, or local server:

Stash Cloud (usestash.io) Self-Hosted (this repo)
Setup Add https://usestash.io/mcp and sign in (OAuth) Clone, configure .env + API keys, run Docker + Postgres
Transport Remote Streamable HTTP + OAuth (per-app revoke) Local SSE (http://localhost:8080/sse)
Memory model Structured folders, semantic search, pinned project rules, live skills, version history Episodes, facts, and 9-stage background consolidation
Teams & sharing Shared team brains with roles + consented brain-to-brain handovers Single self-hosted instance
Cost Free personal tier (no ads, never trains on your data) Your own infrastructure + LLM/embedding API bills

Stash Cloud is built from scratch as a multi-tenant hosted product and shares no code with this repository. This open-source repository stays Apache 2.0 for anyone who prefers to self-host locally (including fully offline with Ollama).

Connect your AI to Stash Cloud →

Learn More

alash3al.github.io/stash →

License

Apache 2.0

Questions about Stash

What is the Stash MCP server?

Stash, persistent memory layer for AI agents. Episodes, facts, and working context stored in Postgres. MCP server included. Self-hosted, single binary, no cloud required. Stash is maintained by alash3al on GitHub at alash3al/stash, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I add Stash to Claude Code?

Stash is a remote server, so you add its URL instead of installing a package: run claude mcp add --transport http stash https://usestash.io/mcp in your terminal. In other apps, add the Stash URL as a remote or custom connector.

Does Stash need an API key?

The registry lists no required keys for Stash. Check the Stash README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Stash an official MCP server?

No. Stash is a community server maintained by alash3al. Community servers can be excellent; read the code and the open issues before you give Stash access to company data.

What license is Stash under?

Stash is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Stash; the service it connects to has its own terms.