MemMesh — persistent, self-improving memory for AI agents. Get started →
Self-HostingConfiguration

Configuration

MemMesh is configured through environment variables on the engine and API services. This page lists the ones you’ll most often set; the exact, complete list lives in the engine source and docker-compose.yml.

Database

VariableServicePurpose
MEMORY_DATABASE_URLmemory-retrievePostgres connection string for the retrieval engine.
AP_POSTGRES_HOST / AP_POSTGRES_PORT / AP_POSTGRES_USERNAME / AP_POSTGRES_PASSWORD / AP_POSTGRES_DATABASEapiPostgres connection for the API service.

Postgres must have the pgvector extension available (the compose stack uses the pgvector/pgvector:pg16 image). The api service also needs Redis — AP_REDIS_HOST / AP_REDIS_PORT (the compose stack runs redis:7-alpine).

These are for the self-hosted HTTP server. The single-binary local engine uses SQLite instead: it stores its DB at ~/.thinkfleet-memory/memory.db by default, overridable with the THINKFLEET_MEMORY_DB environment variable (or the --db flag). Its settings live in ~/.thinkfleet-memory/config.toml — see Installer & doctor.

Engine ↔ API wiring

VariableServicePurpose
MEMORY_GRPC_ADDRmemory-retrieveAddress the retrieval service binds (e.g. 0.0.0.0:50051).
MEMORY_GRPC_ENABLEDapiTurn on the gRPC client to the retrieval service.
MEMORY_GRPC_URLapiWhere the API reaches the retrieval service (e.g. memory-retrieve:50051).
MEMORY_GRPC_TLSapiWhether the gRPC channel uses TLS.
RUST_LOGmemory-retrieveLog level (e.g. info).

Licensing

VariablePurpose
MEMORY_LICENSE_MODELicense enforcement mode (e.g. single for a single-license desktop/dev engine).
MEMORY_LICENSE_TOKENThe license JWT the engine validates against.

See Licensing & Caps for how licensing maps to plan limits.

Billing (optional)

If you connect usage metering to Lago:

VariablePurpose
AP_LAGO_ENABLEDEnable Lago metering/entitlements.
AP_LAGO_API_URLLago API base URL.
AP_LAGO_API_KEYLago API key.
AP_LAGO_WEBHOOK_SECRETShared secret for the Lago webhook receiver.