Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PostgreSQL Mode

PostgreSQL mode enables distributed, multi-instance Mnemo deployments with pgvector for vector search.

Setup

1. PostgreSQL with pgvector

docker run -d \
  --name mnemo-pg \
  -e POSTGRES_USER=mnemo \
  -e POSTGRES_PASSWORD=changeme_use_strong_password \
  -e POSTGRES_DB=mnemo \
  -p 5432:5432 \
  pgvector/pgvector:pg16

2. Start Mnemo with PostgreSQL

mnemo --postgres-url "postgres://mnemo:$POSTGRES_PASSWORD@localhost/mnemo"

Or build with the postgres feature:

cargo build --release --features postgres

Schema

Mnemo automatically creates all required tables on first connection:

  • memories with pgvector vector(N) column and HNSW index
  • acls, delegations, relations, agent_events
  • checkpoints, agent_profiles

Differences from DuckDB Mode

FeatureDuckDBPostgreSQL
Vector indexUSearch (HNSW)pgvector (HNSW)
Full-textTantivyPostgreSQL FTS (planned)
ConcurrencySingle-writerMulti-writer
PersistenceFile-basedServer-based
ScalingSingle instanceMultiple instances