Memory Vault — Claude Code MCP server: what it does, how to install
Self-hosted memory layer on Postgres and pgvector for AI agents. Keeps context, project notes, and architectural choices across sessions via hybrid search.
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.1What Memory Vault 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.
What it helps with
- 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 for the agent
- Use
recallto check our previous decisions about database migrations. - Store the new API endpoint specifications in the
defaultspace usingremember. - Run
memory_statusto inspect current memory statistics.
How to install Memory Vault
Platform CLI
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.1Replace <…> with your own values
Platform CLI
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.1Replace <…> with your own values
Config file
{
"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
Config file
{
"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
Platform CLI
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.1Replace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Memory Vault
How do I install Memory Vault in Claude Code?
Register the MCP container with the following command: `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 the placeholders with your actual PostgreSQL connection credentials.
What does Memory Vault do?
It grants agents persistent memory stored in a local PostgreSQL database with pgvector. The model accesses tools like recall and remember to pull or index project context using hybrid search.
Does Memory Vault require a GPU?
No dedicated GPU is necessary. Both the all-MiniLM-L6-v2 vector embedding model and the spaCy entity processor run directly on standard CPU cores.