Skip to content

Installation

This page covers MemoryLayer (core), the Apache-2.0 server and SDKs. For the AGPL-3.0 production edition, see MemoryLayer Enterprise installation. For how the editions relate, see Editions & Licensing.

Server Installation

The MemoryLayer server is a Python FastAPI application (memorylayer-server on PyPI, version 0.2.0) that provides the REST API. It requires Python 3.12 or later.

Basic Installation

Terminal window
pip install memorylayer-server
memorylayer serve

That’s all a first run needs: no API key and no peer container. The server stores data in SQLite under ~/.config/memorylayer-server and listens on http://localhost:61001.

A bare install starts on the hash embedding provider. It is dependency-free and works offline, but it is lexical, not semantic: it matches shared words, not meaning. That is enough to try the API, but not enough to judge retrieval quality. The server logs a startup warning that names the upgrade paths. When you want real embeddings, pick one of the options below.

Real Embeddings: Self-Hosted on CPU

Run a memorylayer-embed-server peer. Its default single-vector model is sentence-transformers/all-MiniLM-L6-v2 (384 dimensions), which runs on CPU with no GPU and no API key:

Terminal window
# Embed server container (CPU build, published on Docker Hub)
docker run -d --name memorylayer-embed -p 61051:61051 \
-e EMBED_SERVER_RUN_SIDECAR=false \
scitrera/memorylayer-embed-server:0.2.0
# Point the core server at it
export MEMORYLAYER_EMBEDDING_PROVIDER=embed_server
export MEMORYLAYER_EMBED_SERVER_URL=http://localhost:61051
export MEMORYLAYER_EMBEDDING_DIMENSIONS=384 # must match the embed model
memorylayer serve

You can also run the embed server from a source checkout with pip install "./memorylayer-embed-server[local]" followed by memorylayer-embed serve. See Embed Server for extras, GPU images, and configuration.

Real Embeddings: Cloud

Terminal window
# OpenAI embeddings
pip install "memorylayer-server[openai]"
export MEMORYLAYER_EMBEDDING_PROVIDER=openai
export MEMORYLAYER_EMBEDDING_OPENAI_API_KEY=sk-...
memorylayer serve
# Google GenAI embeddings
pip install "memorylayer-server[google]"
export MEMORYLAYER_EMBEDDING_PROVIDER=google
export MEMORYLAYER_EMBEDDING_GOOGLE_API_KEY=...
memorylayer serve

Server Extras

ExtraInstalls
openaiOpenAI embeddings and LLM provider
anthropicAnthropic Claude LLM provider
googleGoogle GenAI embeddings and LLM provider
embeddingsopenai + google
llmopenai + anthropic + google
contextContext Environment sandbox executor (smolagents)
pdf / office / documentsDocument parsers: PDF, Word/PowerPoint, or both
tursoTurso/libSQL storage backend
observabilityOpenTelemetry instrumentation
allembeddings + llm + context + documents
Terminal window
pip install "memorylayer-server[all]"

Removed in v0.1.x: the in-process local (sentence-transformers), colpali, and qwen3-vl embedding providers were removed from memorylayer-server. Self-hosted models now run in memorylayer-embed-server. Setting a legacy provider name raises a startup error with migration guidance.

Repository Planning Graph Plugin

The Repository Planning Graph (RPG) ships as a separate Apache-2.0 plugin, memorylayer-server-rpg. Installing it also installs the matching server version. The server discovers the plugin automatically and exposes /v1/rpg:

Terminal window
pip install memorylayer-server-rpg
memorylayer serve

The official server Docker image already includes the plugin. See Repository Planning Graph.

Start the Server

Terminal window
# HTTP server (default port 61001, bound to 127.0.0.1)
memorylayer serve
# Custom host and port
memorylayer serve --host 0.0.0.0 --port 8080
# Debug logging
memorylayer -v serve

Verify Installation

Terminal window
curl http://localhost:61001/health
{"status": "healthy"}

Docker

The MemoryLayer repository ships a docker-compose.yml that runs the server with a CPU embed-server peer. You get real semantic embeddings with no GPU and no API key:

Terminal window
git clone https://github.com/scitrera/memorylayer
cd memorylayer
docker compose up

The server comes up on http://localhost:61001. The first request is slow while the embed server downloads model weights (about 90 MB for MiniLM and about 250 MB for ColPali). The weights are cached in a volume after that.

Running the Server Image Yourself

The server image (scitrera/memorylayer-server on Docker Hub, also published to ghcr.io/scitrera) installs the server with the [all] extras and includes the RPG plugin. It pins MEMORYLAYER_EMBEDDING_PROVIDER=embed_server, so it expects a memorylayer-embed-server peer. The pin is deliberate: a missing peer is logged as an actionable error at startup, and the container never silently falls back to lexical matching. To use a different provider, override the variable:

Terminal window
# Self-hosted embed-server peer
docker run -d --name memorylayer -p 61001:61001 \
-v memorylayer-data:/data \
-e MEMORYLAYER_EMBED_SERVER_URL=http://embed-host:61051 \
-e MEMORYLAYER_EMBEDDING_DIMENSIONS=384 \
scitrera/memorylayer-server:0.2.0
# Cloud embeddings via OpenAI
docker run -d --name memorylayer -p 61001:61001 \
-v memorylayer-data:/data \
-e MEMORYLAYER_EMBEDDING_PROVIDER=openai \
-e MEMORYLAYER_EMBEDDING_OPENAI_API_KEY=sk-... \
scitrera/memorylayer-server:0.2.0
# Local smoke test (no external dependencies; lexical vectors)
docker run -d --name memorylayer -p 61001:61001 \
-v memorylayer-data:/data \
-e MEMORYLAYER_EMBEDDING_PROVIDER=hash \
scitrera/memorylayer-server:0.2.0

Data is persisted in the /data volume. See Configuration for all environment variables.

The embed-server image ships in two variants under one repository:

TagContents
scitrera/memorylayer-embed-server:<version>CPU. sentence-transformers (384-d) + in-process ColPali. Runs anywhere.
scitrera/memorylayer-embed-server:<version>-cuda13CUDA 13. Adds vLLM, OCR, and transcription. Needs an NVIDIA GPU.

hash vs mock: hash is the server’s default. It is a dependency-free lexical provider: texts that share words get a meaningful similarity, so retrieval returns sensible rankings offline. mock hashes each whole string into an essentially random vector and carries no token-level signal. Use mock only for wiring tests, never to evaluate recall quality.

Client SDKs

All client SDKs are Apache-2.0 and work the same way against MemoryLayer (core) and MemoryLayer Enterprise.

Python SDK

Terminal window
pip install memorylayer-client
from memorylayer import MemoryLayerClient
async with MemoryLayerClient(
base_url="http://localhost:61001",
workspace_id="my-workspace"
) as client:
memory = await client.remember("Hello, MemoryLayer!")

TypeScript SDK

Terminal window
npm install @scitrera/memorylayer-sdk
import { MemoryLayerClient } from "@scitrera/memorylayer-sdk";
const client = new MemoryLayerClient({
baseUrl: "http://localhost:61001",
workspaceId: "my-workspace",
});
const memory = await client.remember("Hello, MemoryLayer!");

Go SDK

Terminal window
go get github.com/scitrera/memorylayer/memorylayer-sdk-go

The core Go module uses only the standard library. The optional Aether transport lives in a separate module (github.com/scitrera/memorylayer/memorylayer-sdk-go/aether). See the Go SDK section.

Framework Integrations

MCP Server (Claude Code, Claude Desktop, Cursor, and others)

Terminal window
npm install @scitrera/memorylayer-mcp-server

See MCP Server Integration for setup instructions.

Agent-Host Plugins

HostGuide
Claude CodeClaude Code Integration
OpenCodeOpenCode Integration
CodexCodex Integration
OpenClawOpenClaw Integration

LangChain

Terminal window
pip install memorylayer-langchain

See LangChain Integration for the usage guide.

LlamaIndex

Terminal window
pip install memorylayer-llamaindex

See LlamaIndex Integration for the usage guide.

System Requirements

ComponentRequirement
Server, embed server, RPG pluginPython 3.12+
Python SDK, LangChain, LlamaIndexPython 3.12+
TypeScript SDK, MCP server, Claude Code and OpenCode pluginsNode.js 18+
OpenClaw pluginNode.js 24.16+
Go SDKGo 1.25.14+

Development Installation

To contribute to MemoryLayer, clone the repository and install in development mode:

Terminal window
git clone https://github.com/scitrera/memorylayer
cd memorylayer
python -m venv .venv && source .venv/bin/activate
# Server
pip install -e "memorylayer-core-python[dev]"
# Python SDK
pip install -e "memorylayer-sdk-python[dev]"
# TypeScript SDK
cd memorylayer-sdk-typescript
npm install
npm run build