# SAME - Stateless Agent Memory Engine

SAME gives AI coding agents persistent project context in local storage. Use it when sessions need to retain decisions and handoffs.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 24
- Author: sgx-labs
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/sgx-labs/statelessagent
- Updated: 2026-10-15
- HTML: https://affpapa.org/en/nevibecode/mcp/same-stateless-agent-memory-engine

## What it does

SAME indexes a project’s Markdown notes, stores them in SQLite, and exposes relevant context through MCP. It records decisions and task handoffs, while `same init` configures hooks and MCP tools for the project.

Search works locally with SQLite FTS5 and keywords. Ollama can add semantic search after `same reindex`, but the server also runs without it. SAME can flag stale notes, scan for PII, and protect files when several agents work on the same codebase. Without Ollama, retrieval uses keyword matching.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `VAULT_PATH` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add same -e VAULT_PATH=<VAULT_PATH> -- npx -y @sgx-labs/same
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add same-stateless-agent-memory-engine --env VAULT_PATH=<VAULT_PATH> -- npx -y @sgx-labs/same
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "same-stateless-agent-memory-engine": {
            "command": "npx",
            "args": [
                "-y",
                "@sgx-labs/same"
            ],
            "env": {
                "VAULT_PATH": "<VAULT_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "same-stateless-agent-memory-engine": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@sgx-labs/same"
            ],
            "env": {
                "VAULT_PATH": "<VAULT_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e VAULT_PATH=<VAULT_PATH> same-stateless-agent-memory-engine npx -y @sgx-labs/same
```
Replace <…> with your own values

## When to use it
- retain agent decisions across sessions
- retrieve context from Markdown notes
- restore handoffs for the next session
- flag stale knowledge in the vault
- scan notes for PII before git pushes

## Example prompts
- Remember that this project uses JWT for authentication and save the decision.
- What did we decide about authentication? Search the project memory.
- Create a handoff for the next session with the unfinished tasks.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
