Skip to content

Installation

MemoryLayer Enterprise is distributed as source (scitrera/memorylayer-enterprise) and as container images on GHCR. No PyPI or npm packages are published.


Prerequisites

RequirementUsed by
Python 3.12+, Git, pipEnterprise server, worker, data connectors, embedding extensions
Node.js 22+Admin dashboard
PostgreSQL with vector, age, and pg_textsearchEnterprise server storage (see PostgreSQL)
Redis-compatible cacheEnterprise default cache service
A MemoryLayer embedding server (memorylayer-embed-server)Embeddings, reranking, transcription, and (with the enterprise plugins) visual tokens and NER
An Aether deployment and credentialsAuthentication, authorization, task delivery to workers, rate limiting, API tokens, and data connectors messaging

Run from Source

The supported install path is scripts/dev.py. It creates .venv, then installs the MemoryLayer core and RPG packages (Apache-2.0) together with the enterprise projects in editable mode, all from one reviewed core commit pinned in oss-source.toml.

Terminal window
git clone https://github.com/scitrera/memorylayer-enterprise.git
cd memorylayer-enterprise
python3 scripts/dev.py enterprise
.venv/bin/memorylayer-enterprise --help

A bare pip install . does not select the pinned core source and is not supported.

Components

Pass one or more components to the installer (default: enterprise):

ComponentInstalls
enterpriseEnterprise server and worker (memorylayer-enterprise, memorylayer-worker)
connectorsData connectors service (data-connectors)
embedEmbedding-server extensions (visual tokenizer, GLiNER2 NER)
adminLinks a local TypeScript SDK build into the admin dashboard (use with MEMORYLAYER_OSS_PATH)
Terminal window
python3 scripts/dev.py enterprise connectors
python3 scripts/dev.py embed

Useful flags: --venv PATH (another virtual environment), --python PATH (install into an existing interpreter), --no-dev (omit test extras), --non-editable (install wheels).

Choosing the Core Source

By default the installer uses the commit pinned in oss-source.toml. To develop against a different core revision, set one of these before running the installer:

VariableEffect
MEMORYLAYER_OSS_REFResolve a branch or tag of scitrera/memorylayer to a single commit and install core and RPG from it
MEMORYLAYER_OSS_PATHInstall core and RPG from an existing local checkout, including uncommitted changes
Terminal window
MEMORYLAYER_OSS_REF=main python3 scripts/dev.py enterprise
MEMORYLAYER_OSS_PATH=../memorylayer python3 scripts/dev.py enterprise

Source selection happens at install time, not at server startup. Unset both variables and rerun the installer to return to the pinned commit.

Start the Server and Worker

Terminal window
# REST API (defaults to 127.0.0.1:61001, like the core server;
# the published container instead serves on 0.0.0.0:8000)
.venv/bin/memorylayer-enterprise serve --host 0.0.0.0 --port 61001
# Background worker (connects to Aether)
.venv/bin/memorylayer-worker start --aether-addr localhost:50051

memorylayer-enterprise info prints the enterprise defaults and plugins.

Admin Dashboard

Terminal window
cd memorylayer-admin
npm ci
MEMORYLAYER_URL=http://your-api-endpoint npm run dev # http://localhost:3200

The dashboard forwards /api/ml to MEMORYLAYER_URL. Configure /api/ml and an admin-scoped API key in the dashboard’s Settings page. See Admin Dashboard.


Containers from GHCR

Four multi-architecture images (linux/amd64 and linux/arm64) are built from the repository:

ImageContents
ghcr.io/scitrera/memorylayer-enterpriseEnterprise server and worker, document tools (Poppler, LibreOffice), and the matching Alembic migrations. Listens on port 8000; health check at /health.
ghcr.io/scitrera/memorylayer-data-connectorsData connectors service and its migrations. Listens on port 8100; health check at /healthz.
ghcr.io/scitrera/memorylayer-postgresPostgreSQL 17 with pgvector, Apache AGE, and pg_textsearch on the standard PostgreSQL entrypoint
ghcr.io/scitrera/memorylayer-postgres-cnpgThe same extensions on the CloudNativePG operand image

The embedding extensions and the admin dashboard are source components; there is no separate image for them. Images carry version, major/minor, and commit tags; latest is a moving tag, so pin exact digests for deployments.

Example

Terminal window
# PostgreSQL with the required extensions
docker run -d --name ml-postgres \
-e POSTGRES_USER=memorylayer -e POSTGRES_PASSWORD=change-me -e POSTGRES_DB=memorylayer \
-p 5432:5432 ghcr.io/scitrera/memorylayer-postgres:17
# Enterprise API server
docker run -d --name ml-enterprise -p 8000:8000 \
-e MEMORYLAYER_POSTGRESQL_URL=postgresql://memorylayer:change-me@ml-postgres:5432/memorylayer \
-e MEMORYLAYER_CACHE_REDIS_URL=redis://ml-redis:6379/0 \
-e MEMORYLAYER_EMBED_SERVER_URL=http://ml-embed:61051 \
-e AETHER_GATEWAY_ADDR=aether:50051 \
-e AETHER_API_KEY=... \
ghcr.io/scitrera/memorylayer-enterprise:latest
# Worker, from the same image
docker run -d --name ml-worker \
-e MEMORYLAYER_POSTGRESQL_URL=... -e MEMORYLAYER_CACHE_REDIS_URL=... \
-e MEMORYLAYER_EMBED_SERVER_URL=... -e AETHER_API_KEY=... \
--entrypoint memorylayer-worker \
ghcr.io/scitrera/memorylayer-enterprise:latest start --aether-addr aether:50051

Supply database, Aether, and other credentials through the runtime environment; the images contain none. All containers must share a network with PostgreSQL, Redis, the embedding server, and Aether.

Database Migrations

The server applies its Alembic migrations on startup by default. With several replicas, run migrations from exactly one process and set MEMORYLAYER_AUTO_MIGRATE=0 on the replicas. The enterprise image ships its migrations at /app/migrations (MEMORYLAYER_ALEMBIC_DIR) and /app/alembic.ini (MEMORYLAYER_ALEMBIC_CONFIG); the Alembic CLI reads DATABASE_URL, while the running service reads MEMORYLAYER_POSTGRESQL_URL.

The data connectors service runs its own migrations at startup when DC_POSTGRESQL_URL is set.


PostgreSQL

The enterprise server requires PostgreSQL with three extensions:

ExtensionPurpose
vector (pgvector)Vector and multivector similarity search
age (Apache AGE)Graph analysis and graph queries
pg_textsearchBM25 full-text search; must be in shared_preload_libraries

The memorylayer-postgres image preloads pg_textsearch and, on a newly initialized data directory, creates all three extensions and sets search_path to ag_catalog, "$user", public. Init scripts do not upgrade an existing database.

For CloudNativePG, use memorylayer-postgres-cnpg, set postgresql.shared_preload_libraries: [pg_textsearch], and create vector, age, and pg_textsearch in bootstrap.initdb.postInitSQL.

To use your own PostgreSQL, install the same extensions (the images pin Apache AGE 1.7.0) and apply equivalent settings.


Key Configuration

VariableDefaultDescription
MEMORYLAYER_POSTGRESQL_URLpostgresql://localhost:5432/memorylayerPostgreSQL connection URL (normalized to asyncpg)
MEMORYLAYER_POSTGRESQL_POOL_SIZE10Connection pool size
MEMORYLAYER_EMBEDDING_DIMENSIONS1536Embedding dimension used for vector columns; must match your embedding model
MEMORYLAYER_CACHE_REDIS_URLredis://localhost:6379/0Redis-compatible cache
MEMORYLAYER_EMBED_SERVER_URLhttp://localhost:61051Embedding server URL
AETHER_GATEWAY_ADDRlocalhost:50051Aether gateway gRPC address
AETHER_API_KEY / AETHER_API_KEY_FILE—Aether credentials
MEMORYLAYER_ENCRYPTION_KEY—Fernet key used to encrypt stored data-provider secrets
MEMORYLAYER_AUTO_MIGRATE1Set 0 on replicas when a separate process owns migrations
MEMORYLAYER_REQUIRE_SECURE_AUTHfalseRefuse to start if authentication or authorization is set to the open default services

See Configuration for blob storage, document pipeline, background jobs, and service selection.


Connecting Clients

Enterprise uses the same REST API as the core server, so the Python SDK, TypeScript SDK, MCP server, and agent integrations work unchanged.

Enterprise defaults to Aether authentication: the Aether auth proxy validates each request’s Authorization: Bearer <api-key> and forwards the verified tenant, user, and access level to MemoryLayer. Point clients at the auth proxy’s URL, not directly at the MemoryLayer container, and use an API key issued through API Keys.

Terminal window
export MEMORYLAYER_URL=https://memory.example.com # your Aether auth proxy
export MEMORYLAYER_API_KEY=your-api-key
export MEMORYLAYER_WORKSPACE_ID=my-workspace

Workspaces are not created implicitly in Enterprise. Create them explicitly (POST /v1/workspaces) before clients use them.

For local development without the gateway you can set MEMORYLAYER_AUTHENTICATION_SERVICE=default and MEMORYLAYER_AUTHORIZATION_SERVICE=default, which restores the core server’s open allow-all behavior. Never do this in a shared deployment.


Running Inside the Scitrera Platform

MemoryLayer Enterprise also runs per tenant inside the open-source Scitrera Platform. Each tenant gets its own Aether instance, MemoryLayer Enterprise, and data connectors service, using PostgreSQL with the vector, AGE, and pg_textsearch extensions. The platform’s Compose and Helm charts handle startup order, migrations, and credentials.