A fully self-hosted persistent memory system for Claude Code agents, running on Paul's Unraid R730 server. Provides semantic search via pgvector and entity relationships via graph queries, accessed through a local MCP server. Any agent can connect to it - agent-agnostic by design.


Architecture

flowchart LR
    A["Claude Agent (any)"] -->|MCP tool calls| B["sunday-memory MCP Server"]
    B -->|embed text| C["@xenova/transformers (local)"]
    B -->|store/query vectors| D["PostgreSQL + pgvector"]
    B -->|entity relationships| E["Graph layer (Apache AGE)"]

Components

sunday-memory MCP Server - Node.js service running inside the agent container. Exposes tools via MCP stdio transport:

Local Embeddings - Uses @xenova/transformers for embedding generation. Runs entirely on CPU, no external API calls, no cloud dependency. Models downloaded once and cached.

PostgreSQL + pgvector - Vector storage and similarity search. Production-grade, runs in Docker on Unraid. Stores memory text, embeddings, categories, metadata, timestamps, and entity references.

Graph Layer (Apache AGE) - PostgreSQL extension adding openCypher graph queries alongside pgvector. Same database, same backups, no additional infrastructure. See child page for full design.


Hardware