MCPcopy Index your code
hub / github.com/alash3al/stash

github.com/alash3al/stash @v0.2.11

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.11 ↗ · + Follow
250 symbols 704 edges 42 files 140 documented · 56%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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.

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.

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 Desktopclaude_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, 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.

Learn More

alash3al.github.io/stash →

License

Apache 2.0

Extension points exported contracts — how you extend this code

Embedder (Interface)
Embedder converts text into a fixed-dimension vector. Implementations: OpenAI (production), Fake (tests). [2 implementers]
internal/embedder/embedder.go
Reasoner (Interface)
Reasoner synthesizes structured reasoning over text input. [1 implementers]
internal/reasoner/reasoner.go

Core symbols most depended-on inside this repo

render
called by 103
cmd/cli/mcp.go
getBootstrap
called by 41
cmd/cli/commands.go
printJSON
called by 38
cmd/cli/commands.go
Close
called by 37
internal/brain/brain.go
Printf
called by 18
internal/db/db.go
ResolveNamespaceIDs
called by 12
internal/brain/brain.go
resolveNamespaceIDs
called by 12
internal/brain/brain.go
Sanitize
called by 9
internal/brain/brain.go

Shape

Method 108
Function 91
Struct 48
Interface 2
TypeAlias 1

Languages

Go100%

Modules by API surface

internal/reasoner/openai.go24 symbols
internal/reasoner/reasoner.go18 symbols
internal/brain/brain.go18 symbols
internal/models/models.go16 symbols
internal/brain/consolidate.go14 symbols
internal/brain/hypothesis.go11 symbols
internal/brain/goal.go11 symbols
internal/embedder/cache.go9 symbols
internal/bootstrap/bootstrap.go8 symbols
cmd/cli/hypothesis.go8 symbols
cmd/cli/commands.go8 symbols
internal/queries/queries.go7 symbols

Datastores touched

stashDatabase · 1 repos

For agents

$ claude mcp add stash \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page