Skip to main content

Memcairn

Memcairn: self-hosted long-term memory for Claude, shared by all your machines

Long-term memory for Claude Code (and other MCP clients) that you host yourself, shared by all your machines.

A cairn is the pile of stones hikers leave to mark a trail. Every session adds a stone; the next one finds the way.

Claude Code already remembers how you like to work (CLAUDE.md, auto memory), but only on one machine, and only what fits into every session. Memcairn adds the rest: facts about your projects, servers, decisions and todos, searched when needed, the same on your laptop, your server and the Claude phone app.

Install

Paste this into Claude Code:

Install Memcairn for me, following https://github.com/shanislav/memcairn/blob/main/INSTALL.md

Claude asks whether the memory should stay on this computer or be shared through a server, sets it up and checks that it works. You never copy a token: machines connect with a one-time code. INSTALL.md is what Claude follows; you can follow it yourself just as well.

The short version:

# only this computer
uv tool install "memcairn[vector]"
memcairn connect --local

# several computers: run the server (Docker, see docs/setup.md), then connect each machine
docker compose up -d && docker compose exec memcairn memcairn login-link   # web UI
memcairn pair https://memory.example.com K7QM-42XD    # code from "Add machine"

What you get

  • A short overview at every session start: what memory covers (topics, documents), the facts you pinned and how many todos are open, ~200 tokens plus your pinned facts. Claude then recalls what the task needs.
  • Small context cost. About 1,650 tokens per session in all: the tool list (~980), the usage rules (~470) and the overview (~200). A recall returns five one-line hits (~190 tokens), full text only for what the model asks for.
  • Writes are instant: no LLM call when storing.
  • Nothing is lost silently: every change is versioned, outdated facts are superseded rather than overwritten, todos are closed as done or dropped.
  • Shared documents (a server inventory, plans) synced to the files you choose, with three-way merge; optionally Claude Code's own auto memory carried between your machines.
  • A web UI to browse, search, edit and clean up memory, add machines and revoke them.
  • claude.ai and the Claude apps through a built-in OAuth server (opt-in).
  • Any language: inflections, missing diacritics, Chinese and Japanese (no spaces), and with the local model, a query in one language finds a fact in another.
  • Only you pin: pinned facts reach every session on every machine, so an agent can only ask for a pin; you approve it in the web UI.
  • Credentials are refused on write; memcairn purge removes a leaked one for good.
  • One SQLite file, no LLM. Search by meaning uses a small local model (~0.6 GB of memory, optional: without it ~0.1 GB, words only); nothing goes to an external service.

How well it finds things

Three tests, all reproducible (method, numbers and caveats). "Found" means the right fact is among the five lines recall returns.

found compared with
998 real facts, 50 queries (the author's memory) 100%, ~190 tokens per query official server-memory: 24%, ~2,055 tokens
LoCoMo, 1,540 questions over long conversations 60% plain BM25: 54%, plain vector search: 38%
92 facts in nine languages, 101 queries 95% plain BM25: 88%

LoCoMo measures retrieval only (is the evidence among the results), not answers written by an LLM, so it can't be compared with the answer scores other systems publish.

Documentation

Development

uv venv && uv pip install -e ".[dev]"
uv run pytest
uv run python bench/multilingual.py      # recall in nine languages, no download

MIT license.

Metadata

Release files for memcairn 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memcairn 0.2.0
File Size Uploaded Provenance Actions
memcairn-0.2.0.tar.gz 127.0 kB With provenance Details for memcairn-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for memcairn 0.2.0
File Interpreter ABI Platform Actions
memcairn-0.2.0-py3-none-any.whl Python 3 none any Details for memcairn-0.2.0-py3-none-any.whl

Total release size: 237.8 kB

Release files / memcairn-0.2.0.tar.gz

Download URL memcairn-0.2.0.tar.gz
Size 127.0 kB
Tags Source
SHA-256 checksum
How to use checksums
463f5db463f492105c52cdc38454a2bd159f7a518805ce7abfee7d8a1bf2c6a5
BLAKE2b-256 checksum
How to use checksums
832923b70c7555da004a97723faaf060eab3ebc3f2aaae42a65e0e4062002ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / memcairn-0.2.0-py3-none-any.whl

Download URL memcairn-0.2.0-py3-none-any.whl
Size 110.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bd5a1fec530660a2b659abfff36f36f5c9a0e8e8767f79a6f9f8f255f220ccc
BLAKE2b-256 checksum
How to use checksums
4246c807968e734287e610e2fac5f76dd2fe83a9af4f2b9c0b8f72f02dfa2309
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for memcairn 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for memcairn-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page