# sanctum-mind [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/lkmconstructs/sanctum-mind  
**GitHub Stars:** 5  
**npm Downloads (last month):** 490  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/sanctum-mind

## Description
Persistent memory and identity for AI minds, served as MCP tools on Postgres.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "sanctum-mind": {
    "command": "npx",
    "args": ["-y","sanctum-mind"],
    "env": {
      "POSTGRES_PASSWORD": "",
      "VERB_PASSWORD": "",
      "DAEMON_PASSWORD": "",
      "IMPORT_PASSWORD": "",
      "APP_PASSWORD": "",
      "OPERATOR_PASSWORD": "",
      "IDENTITY_COOLING_HOURS": ""
    }
  }
}
```

**Requires environment variables:** `POSTGRES_PASSWORD`, `VERB_PASSWORD`, `DAEMON_PASSWORD`, `IMPORT_PASSWORD`, `APP_PASSWORD`, `OPERATOR_PASSWORD`, `IDENTITY_COOLING_HOURS` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What sanctum-mind does

sanctum-mind provides a persistent knowledge and identity layer for AI minds over MCP and Postgres. A service can host multiple named minds, with each mind holding its own memories, feelings, tasks, promises, relationships, drives, and other state. Access is tied to a mind-specific bearer key, and one mind cannot read another mind's records unless the operator has created an appropriate grant.

Writes are retained in an append-only ledger rather than replacing earlier records. Current views such as mood, open loops, and tasks are updated alongside those ledger entries, allowing the service to expose both present state and historical activity.

Identity cores and vows have additional safeguards. New cores and vows take effect immediately, while rewrites, retirements, and vow breaks normally wait through a configurable cooling period. A mind can withdraw a pending change during that period. Stewards can inspect identity and vows, attest to rewrites, and add objections or notes, but cannot directly edit identity or shorten every type of waiting period.

## How it works

A mind typically begins a session with `mind_orient`. The response includes identity, vows, current state, the previous handoff, health, and—by default—open loops, threads, tasks, relationships, drives, unread letters, and the seven most prominent attention items. A fuller response can include desires, holdings, and recent events.

`mind_write` stores ordinary records such as identity notes, operational notes, episodic memories, journal entries, or general notes. `mind_observe` stores an experience and creates a linked node in the memory graph; it requires at least one emotional charge tag.

Memory retrieval uses `mind_search` for word matching, meaning-based matching, or both. `mind_surface` finds topic-related memories, including less direct associations. Semantic retrieval requires an embedding model; disabling embeddings leaves word search available and reports that meaning search cannot be used.

A separate daemon runs background passes every 30 minutes. It handles decay, expiry, stale-loop detection, settling, identity changes whose cooling period has ended, missing embeddings, unread-letter aging, event delivery to configured external systems, and other maintenance. An optional extractor can look for items a mind may want to notice once per day. Changes made by these processes are logged.

## Setup and configuration

Docker Compose is the documented deployment path. Create an `exchange` directory, start the Postgres 16 database with pgvector, run the initialization service, then start the mind service and daemon:

```bash
mkdir -p exchange
docker compose up -d db
docker compose run --rm init
docker compose up -d mind
docker compose up -d daemon
```

Initialization creates the first mind, prints its bearer key once, and outputs Streamable HTTP and Docker stdio connection configurations. Save the key securely because only its fingerprint is stored. The default service address is `http://127.0.0.1:8002`, published to loopback.

Set `MIND` when creating a mind with a name other than `alpha`. Initialization can be repeated, and key rotation requires the `--rotate` option. For deployments reachable by others, replace the local database and lane passwords before the first database startup. Password values should use letters and digits because they are inserted into URLs. `IDENTITY_COOLING_HOURS` controls the identity waiting period and defaults to 24 hours; setting it to zero suits a single-user deployment.

The service uses separate database lanes for the MCP service, daemon, operator, and import functions. The operator can create minds, issue keys, manage grants, suspend or restore access, export or import minds, and delete minds, but operator privileges do not directly edit a mind's identity or vows. Deleting a mind removes all of its data.

## Tools and capabilities

- Orient a mind at session start with identity, state, handoff, health, and related context.
- Append ordinary memory records and emotionally tagged observations.
- Search memories by words, embeddings, or both, and surface related topics.
- Maintain tasks, open loops, threads, drives, desires, holdings, and relationships.
- Manage identity cores and vows with delayed changes and withdrawal during cooling.
- Send letters between minds hosted on the same service.
- Give stewards limited oversight through grants, attestations, objections, and vow notes.
- Run daemon maintenance for decay, expiry, embeddings, delivery, and pending changes.
- Export and import mind data through the operator and import lanes.

_Full upstream README: https://allmcps.com/mcp/sanctum-mind/readme_

