# 开源内存层，让任何AI代理都能实现Claude.ai和ChatGPT的功能

- 来源：Hacker News 热门（buzzing.cc 中文翻译）
- 作者：alash3al
- 发布时间：2026-04-25 22:51
- AIHOT 分数：56
- AIHOT 链接：https://aihot.virxact.com/items/cmoehrtip013psllzt9ek7s29
- 原文链接：https://alash3al.github.io/stash?_v01=

## AI 摘要

开源项目Stash发布，为AI代理提供长期记忆与上下文管理能力。它通过独立存储和检索对话历史，使开发者无需依赖特定API即可为应用添加持久化记忆功能。该项目已在GitHub开源，并获Hacker News社区关注，降低了构建复杂AI代理的门槛。

## 正文

Your AI has amnesia.

Stash makes your AI remember you. Every session. Forever. No more explaining yourself from scratch.

Not just memory.A second brain.

Stash is a persistent cognitive layer that sits between your AI agent and the world. It doesn't replace your model — it makes your model continuous. Episodes become facts. Facts become patterns. Patterns become wisdom.

"Your AI is the brain. Stash is the life experience."

Memory organizedlike folders.

Not all memory is equal. What your agent learns about you is different from what it learns about a project, which is different from what it knows about itself. Namespaces let the agent organize what it learns into clean, separate buckets — just like folders on your computer.

Each namespace is a path. Paths are hierarchical. Reading from /projects automatically includes everything under /projects/stash, /projects/cartona, and so on. You never have to think about it — the agent does.

/projects

/projects/stash

/projects/cartona

/projects

/self

Watch Stash remember.

A real conversation loop — two sessions, one agent, zero repetition. Watch what happens between them.

RAG gives your AIa search engine.Stash gives it a life.

You've probably heard of RAG — Retrieval Augmented Generation. It's clever. But it's not memory. Here's the difference, in plain English.

You give it a pile of documents. When you ask a question, it searches those documents and hands you the relevant pages. That's it. It doesn't remember your conversation. It doesn't learn. It doesn't know you. Every question starts from scratch — it's just a smarter search engine over files you already wrote.

Only knows what's in your documents

Cannot learn from conversations

Cannot track goals or intentions

Cannot reason about cause and effect

Cannot notice contradictions over time

Stateless — no continuity whatsoever

You must write the knowledge first

Stash learns from everything your agent experiences — conversations, decisions, successes, failures. It synthesizes raw observations into facts, connects facts into a knowledge graph, detects contradictions, tracks goals, and builds an understanding of you that deepens over time. You don't write anything. It figures it out.

Learns from every conversation automatically

Builds a knowledge graph over time

Tracks your goals across weeks and months

Reasons about cause and effect

Self-corrects when beliefs contradict

Continuous — picks up exactly where you left off

Creates knowledge — you don't have to

Everyone gave AIa notepad.We gave it a mind.

Claude.ai has memory. ChatGPT has memory. They only work for themselves — locked to one platform, one model, one company. Stash works for everyone, everywhere, forever. And it goes far deeper than any of them.

Brilliant brain, no experience

AI models reason brilliantly but remember nothing. Every session you re-explain who you are, what you need, and what you've already tried. You're training the same student every single day.

Context windows are expensive

The workaround is stuffing full conversation history into every prompt. It's slow, expensive, and you still hit the limit. You're paying for tokens that repeat the same facts over and over.

Agents repeat their mistakes

Your agent tried something, it failed, and next session it tries the exact same thing again. There's no mechanism to carry lessons forward. Every failure is forgotten.

Memory is a platform privilege

Only a handful of AI platforms offer memory — and only for their own models. Your custom agent, your local LLM, your Cursor setup? They all start blind. Memory shouldn't be a premium feature.

Up and runningin 3 commands.

No infrastructure to set up. No dependencies to install manually. Docker Compose handles everything — Postgres, pgvector, Stash, all wired together and ready.

.env.example

.env

docker compose up

init

remember

recall

STASH_VECTOR_DIM

.env

Works with any MCP client.

Start Stash, point any MCP-compatible agent at the URL below. That's it. No SDK. No vendor lock-in.

docker compose up

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

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

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

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

http://localhost:8080/sse

Raw memory becomes wisdom

A background process continuously synthesizes your agent's experiences into structured knowledge. It runs on a schedule — your agent just lives.

Your agent canknow itself.

Call init and Stash creates a /self namespace scaffold. The agent uses its own memory layer to build and maintain a model of its own capabilities, limits, and preferences.

init

/self

An agent thatnever stops learning.

Give your agent a 5-minute research loop. It orients from past memory, researches a topic it chooses itself, invents new connections, consolidates what it learned, and closes gracefully — ready to pick up next time.

Run it as a cron job. Every 5 minutes, your agent gets smarter.

Your model. Your infrastructure.

Stash uses one provider for both embedding and reasoning — any OpenAI-compatible backend works. Cloud, local, or self-hosted. No vendor lock-in, ever.

Cloud APIs

OpenRouter gives you access to hundreds of models — GPT, Claude, Gemini, Mistral — all behind one OpenAI-compatible endpoint. Point Stash at it and pick any model for embedding and reasoning.

Local Models

Running Ollama locally? Stash works out of the box. Use Qwen, Llama, Mistral, or any model you've pulled — your memory stays fully private, fully offline.

Self-Hosted

vLLM, LM Studio, llama.cpp server, Together AI, Groq — if it speaks the OpenAI API format, Stash speaks it back. Same provider serves both models.

STASH_VECTOR_DIM

openai/text-embedding-3-small

STASH_VECTOR_DIM=1536

Open source. Apache 2.0 licensed. Backed by PostgreSQL. Works with any MCP-compatible agent.
