Self-hosted MCP memory server with hybrid BM25 + semantic search, backed by PostgreSQL + pgvector.
- Hybrid search — BM25 (full-text) + vector KNN (pgvector) fused via Reciprocal Rank Fusion
- Multi-user — each user sees only their own memories; workspaces for shared team knowledge
- 10 MCP tools — store, retrieve, recall, list, search by tag, get, update, delete, move, list workspaces
- Web UI — browse, search, edit and delete memories in the browser; export/import JSON
- OAuth 2.1 — full in-process authorization server, always enabled
- PostgreSQL — pgvector for embeddings, tsvector for full-text search
# Install dependencies
uv sync --dev
# Download ONNX model (~23 MB)
uv run python scripts/download_model.py
# Run migrations
alembic upgrade head
# Start the server
memlordOpen http://localhost:8000 for the Web UI. The MCP endpoint is at /mcp.
cp .env.example .env
docker compose upAll settings use the MEMLORD_ prefix. See .env.example for the full list.
| Variable | Default | Description |
|---|---|---|
MEMLORD_DB_URL |
postgresql+asyncpg://postgres:postgres@localhost/memlord |
PostgreSQL connection URL |
MEMLORD_PORT |
8000 |
Server port |
MEMLORD_BASE_URL |
http://localhost:8000 |
Public URL for OAuth |
MEMLORD_OAUTH_JWT_SECRET |
memlord-dev-secret-please-change |
JWT signing secret |
OAuth is always enabled. Set MEMLORD_BASE_URL to your public URL and change MEMLORD_OAUTH_JWT_SECRET before deploying.
| Tool | Description |
|---|---|
store_memory |
Save a memory (idempotent per workspace by content) |
retrieve_memory |
Hybrid semantic + full-text search |
recall_memory |
Search by natural-language time expression |
list_memories |
Paginated list with type/tag filters |
search_by_tag |
AND/OR tag search |
get_memory |
Fetch a single memory by ID |
update_memory |
Update content, type, tags, or metadata by ID |
delete_memory |
Delete by ID |
move_memory |
Move a memory to a different workspace |
list_workspaces |
List workspaces you are a member of (including personal) |
Workspace management (create, invite, join, leave) is handled via the Web UI.
pyright src/ # type check
black . # format
pytest # run tests
alembic-autogen-check # verify migrations are up to dateMemlord is dual-licensed:
- AGPL-3.0 — free for open-source use. If you run a modified version as a network service, you must publish your source code.
- Commercial License — for proprietary or closed-source deployments. Contact sergey@memlord.com or dmitry@memlord.com to purchase.