# Memory Vault

Self-hosted memory layer on Postgres and pgvector for AI agents. Keeps context, project notes, and architectural choices across sessions via hybrid search.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 65
- Author: MihaiBuilds
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/MihaiBuilds/memory-vault
- Updated: 2026-10-19
- HTML: https://affpapa.org/en/nevibecode/mcp/memory-vault

## What it does

Memory Vault attaches a persistent PostgreSQL 16 database with the pgvector extension to your coding agent. Through four MCP tools (`recall`, `remember`, `forget`, and `memory_status`), assistants retrieve earlier decisions and file new facts. The hybrid retrieval pipeline pairs `all-MiniLM-L6-v2` semantic embeddings with keyword indexes.

The database handles relational data, vector records, and knowledge graphs in one place. Text entity extraction runs through spaCy with the `en_core_web_sm` package. The entire stack executes on a standard CPU. It requires no GPU. Aside from MCP, the repository supplies a FastAPI REST backend and a browser dashboard on port 8000.

Without working PostgreSQL credentials passed to `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, and `DB_PASSWORD`, the Docker container exits immediately. On Windows systems, clone the repository into WSL2 to avoid CRLF line-ending breakages.

## Requirements
- Needs: Docker
- Environment variables: `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASSWORD` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: PostgreSQL

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env DB_HOST=<DB_HOST> --env DB_PORT=<DB_PORT> --env DB_NAME=<DB_NAME> --env DB_USER=<DB_USER> --env DB_PASSWORD=<DB_PASSWORD> --transport stdio memory-vault -- docker run -i --rm -e DB_HOST -e DB_PORT -e DB_NAME -e DB_USER -e DB_PASSWORD ghcr.io/mihaibuilds/memory-vault-mcp:1.6.1
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add memory-vault --env DB_HOST=<DB_HOST> --env DB_PORT=<DB_PORT> --env DB_NAME=<DB_NAME> --env DB_USER=<DB_USER> --env DB_PASSWORD=<DB_PASSWORD> -- docker run -i --rm -e DB_HOST -e DB_PORT -e DB_NAME -e DB_USER -e DB_PASSWORD ghcr.io/mihaibuilds/memory-vault-mcp:1.6.1
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "memory-vault": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "DB_HOST",
                "-e",
                "DB_PORT",
                "-e",
                "DB_NAME",
                "-e",
                "DB_USER",
                "-e",
                "DB_PASSWORD",
                "ghcr.io/mihaibuilds/memory-vault-mcp:1.6.1"
            ],
            "env": {
                "DB_HOST": "<DB_HOST>",
                "DB_PORT": "<DB_PORT>",
                "DB_NAME": "<DB_NAME>",
                "DB_USER": "<DB_USER>",
                "DB_PASSWORD": "<DB_PASSWORD>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "memory-vault": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "DB_HOST",
                "-e",
                "DB_PORT",
                "-e",
                "DB_NAME",
                "-e",
                "DB_USER",
                "-e",
                "DB_PASSWORD",
                "ghcr.io/mihaibuilds/memory-vault-mcp:1.6.1"
            ],
            "env": {
                "DB_HOST": "<DB_HOST>",
                "DB_PORT": "<DB_PORT>",
                "DB_NAME": "<DB_NAME>",
                "DB_USER": "<DB_USER>",
                "DB_PASSWORD": "<DB_PASSWORD>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e DB_HOST=<DB_HOST> -e DB_PORT=<DB_PORT> -e DB_NAME=<DB_NAME> -e DB_USER=<DB_USER> -e DB_PASSWORD=<DB_PASSWORD> memory-vault docker run -i --rm -e DB_HOST -e DB_PORT -e DB_NAME -e DB_USER -e DB_PASSWORD ghcr.io/mihaibuilds/memory-vault-mcp:1.6.1
```
Replace <…> with your own values

## When to use it
- retain architecture decisions across separate agent sessions
- search stored notes by combining keyword match and semantic meaning
- isolate domain facts using dedicated memory spaces
- extract entities into a knowledge graph without calling cloud LLMs

## Example prompts
- Use `recall` to check our previous decisions about database migrations.
- Store the new API endpoint specifications in the `default` space using `remember`.
- Run `memory_status` to inspect current memory statistics.

## 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
