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
pip install memorylayer-servermemorylayer serveThat’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:
# 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 itexport MEMORYLAYER_EMBEDDING_PROVIDER=embed_serverexport MEMORYLAYER_EMBED_SERVER_URL=http://localhost:61051export MEMORYLAYER_EMBEDDING_DIMENSIONS=384 # must match the embed modelmemorylayer serveYou 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
# OpenAI embeddingspip install "memorylayer-server[openai]"export MEMORYLAYER_EMBEDDING_PROVIDER=openaiexport MEMORYLAYER_EMBEDDING_OPENAI_API_KEY=sk-...memorylayer serve
# Google GenAI embeddingspip install "memorylayer-server[google]"export MEMORYLAYER_EMBEDDING_PROVIDER=googleexport MEMORYLAYER_EMBEDDING_GOOGLE_API_KEY=...memorylayer serveServer Extras
| Extra | Installs |
|---|---|
openai | OpenAI embeddings and LLM provider |
anthropic | Anthropic Claude LLM provider |
google | Google GenAI embeddings and LLM provider |
embeddings | openai + google |
llm | openai + anthropic + google |
context | Context Environment sandbox executor (smolagents) |
pdf / office / documents | Document parsers: PDF, Word/PowerPoint, or both |
turso | Turso/libSQL storage backend |
observability | OpenTelemetry instrumentation |
all | embeddings + llm + context + documents |
pip install "memorylayer-server[all]"Removed in v0.1.x: the in-process
local(sentence-transformers),colpali, andqwen3-vlembedding providers were removed frommemorylayer-server. Self-hosted models now run inmemorylayer-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:
pip install memorylayer-server-rpgmemorylayer serveThe official server Docker image already includes the plugin. See Repository Planning Graph.
Start the Server
# HTTP server (default port 61001, bound to 127.0.0.1)memorylayer serve
# Custom host and portmemorylayer serve --host 0.0.0.0 --port 8080
# Debug loggingmemorylayer -v serveVerify Installation
curl http://localhost:61001/health{"status": "healthy"}Docker
Docker Compose (Recommended)
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:
git clone https://github.com/scitrera/memorylayercd memorylayerdocker compose upThe 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:
# Self-hosted embed-server peerdocker 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 OpenAIdocker 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.0Data is persisted in the /data volume. See Configuration for all environment variables.
The embed-server image ships in two variants under one repository:
| Tag | Contents |
|---|---|
scitrera/memorylayer-embed-server:<version> | CPU. sentence-transformers (384-d) + in-process ColPali. Runs anywhere. |
scitrera/memorylayer-embed-server:<version>-cuda13 | CUDA 13. Adds vLLM, OCR, and transcription. Needs an NVIDIA GPU. |
hashvsmock:hashis 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.mockhashes each whole string into an essentially random vector and carries no token-level signal. Usemockonly 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
pip install memorylayer-clientfrom 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
npm install @scitrera/memorylayer-sdkimport { 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
go get github.com/scitrera/memorylayer/memorylayer-sdk-goThe 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)
npm install @scitrera/memorylayer-mcp-serverSee MCP Server Integration for setup instructions.
Agent-Host Plugins
| Host | Guide |
|---|---|
| Claude Code | Claude Code Integration |
| OpenCode | OpenCode Integration |
| Codex | Codex Integration |
| OpenClaw | OpenClaw Integration |
LangChain
pip install memorylayer-langchainSee LangChain Integration for the usage guide.
LlamaIndex
pip install memorylayer-llamaindexSee LlamaIndex Integration for the usage guide.
System Requirements
| Component | Requirement |
|---|---|
| Server, embed server, RPG plugin | Python 3.12+ |
| Python SDK, LangChain, LlamaIndex | Python 3.12+ |
| TypeScript SDK, MCP server, Claude Code and OpenCode plugins | Node.js 18+ |
| OpenClaw plugin | Node.js 24.16+ |
| Go SDK | Go 1.25.14+ |
Development Installation
To contribute to MemoryLayer, clone the repository and install in development mode:
git clone https://github.com/scitrera/memorylayercd memorylayerpython -m venv .venv && source .venv/bin/activate
# Serverpip install -e "memorylayer-core-python[dev]"
# Python SDKpip install -e "memorylayer-sdk-python[dev]"
# TypeScript SDKcd memorylayer-sdk-typescriptnpm installnpm run build