Skip to content

MyrikLD/memlord

Repository files navigation

Memlord

Self-hosted MCP memory server with hybrid BM25 + semantic search, backed by PostgreSQL + pgvector.

Features

  • 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

Quickstart

# 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
memlord

Open http://localhost:8000 for the Web UI. The MCP endpoint is at /mcp.

Docker

cp .env.example .env
docker compose up

Configuration

All 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.

MCP Tools

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.

Development

pyright src/           # type check
black .                # format
pytest                 # run tests
alembic-autogen-check  # verify migrations are up to date

License

Memlord is dual-licensed:

About

MCP memory server with hybrid BM25 + vector search on Postgres.

Topics

Resources

License

AGPL-3.0, Unknown licenses found

Licenses found

AGPL-3.0
LICENSE
Unknown
LICENSE-COMMERCIAL

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages