Installation
MemoryLayer Enterprise is distributed as source (scitrera/memorylayer-enterprise) and as container images on GHCR. No PyPI or npm packages are published.
Prerequisites
| Requirement | Used by |
|---|---|
| Python 3.12+, Git, pip | Enterprise server, worker, data connectors, embedding extensions |
| Node.js 22+ | Admin dashboard |
PostgreSQL with vector, age, and pg_textsearch | Enterprise server storage (see PostgreSQL) |
| Redis-compatible cache | Enterprise 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 credentials | Authentication, 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.
git clone https://github.com/scitrera/memorylayer-enterprise.gitcd memorylayer-enterprise
python3 scripts/dev.py enterprise.venv/bin/memorylayer-enterprise --helpA 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):
| Component | Installs |
|---|---|
enterprise | Enterprise server and worker (memorylayer-enterprise, memorylayer-worker) |
connectors | Data connectors service (data-connectors) |
embed | Embedding-server extensions (visual tokenizer, GLiNER2 NER) |
admin | Links a local TypeScript SDK build into the admin dashboard (use with MEMORYLAYER_OSS_PATH) |
python3 scripts/dev.py enterprise connectorspython3 scripts/dev.py embedUseful 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:
| Variable | Effect |
|---|---|
MEMORYLAYER_OSS_REF | Resolve a branch or tag of scitrera/memorylayer to a single commit and install core and RPG from it |
MEMORYLAYER_OSS_PATH | Install core and RPG from an existing local checkout, including uncommitted changes |
MEMORYLAYER_OSS_REF=main python3 scripts/dev.py enterpriseMEMORYLAYER_OSS_PATH=../memorylayer python3 scripts/dev.py enterpriseSource 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
# 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:50051memorylayer-enterprise info prints the enterprise defaults and plugins.
Admin Dashboard
cd memorylayer-adminnpm ciMEMORYLAYER_URL=http://your-api-endpoint npm run dev # http://localhost:3200The 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:
| Image | Contents |
|---|---|
ghcr.io/scitrera/memorylayer-enterprise | Enterprise 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-connectors | Data connectors service and its migrations. Listens on port 8100; health check at /healthz. |
ghcr.io/scitrera/memorylayer-postgres | PostgreSQL 17 with pgvector, Apache AGE, and pg_textsearch on the standard PostgreSQL entrypoint |
ghcr.io/scitrera/memorylayer-postgres-cnpg | The 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
# PostgreSQL with the required extensionsdocker 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 serverdocker 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 imagedocker 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:50051Supply 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:
| Extension | Purpose |
|---|---|
vector (pgvector) | Vector and multivector similarity search |
age (Apache AGE) | Graph analysis and graph queries |
pg_textsearch | BM25 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
| Variable | Default | Description |
|---|---|---|
MEMORYLAYER_POSTGRESQL_URL | postgresql://localhost:5432/memorylayer | PostgreSQL connection URL (normalized to asyncpg) |
MEMORYLAYER_POSTGRESQL_POOL_SIZE | 10 | Connection pool size |
MEMORYLAYER_EMBEDDING_DIMENSIONS | 1536 | Embedding dimension used for vector columns; must match your embedding model |
MEMORYLAYER_CACHE_REDIS_URL | redis://localhost:6379/0 | Redis-compatible cache |
MEMORYLAYER_EMBED_SERVER_URL | http://localhost:61051 | Embedding server URL |
AETHER_GATEWAY_ADDR | localhost:50051 | Aether 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_MIGRATE | 1 | Set 0 on replicas when a separate process owns migrations |
MEMORYLAYER_REQUIRE_SECURE_AUTH | false | Refuse 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.
export MEMORYLAYER_URL=https://memory.example.com # your Aether auth proxyexport MEMORYLAYER_API_KEY=your-api-keyexport MEMORYLAYER_WORKSPACE_ID=my-workspaceWorkspaces 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.