Skip to main content

Cairntir

Persistent, local-first memory for AI coding agents. Claude Code, Codex, Cursor, Qwen Code, and other MCP clients share one searchable project history.

PyPI CI Python 3.11+ MIT

Cairntir stores decisions, facts, unfinished work, and outcomes as verbatim drawers in a SQLite database you own. A budgeted handoff restores complete drawers across sessions; semantic and file-anchored recall find deeper evidence.

Current release: 1.12.3. See the release evidence and changelog. Published downloads are on PyPI and GitHub Releases.

Install

pip install --upgrade cairntir
cairntir setup

Python 3.11+ is required. Setup initializes the store and configures supported hosts it detects. Restart your agent afterward.

cairntir version
cairntir doctor

The diagnostic changes below are unreleased; pip install currently selects published 1.12.3. That release's doctor/status/version may still run registration and update callbacks, and status may open the store for writing. See the change record before treating an installed diagnostic as read-only.

In this candidate, version reports this CLI's version. status and doctor inspect the store and configuration without registering hosts or checking for updates. A configured MCP entry does not prove a live connection. Setup's local write/read check does not prove host delivery or semantic retrieval: require an actual save receipt, then recover the exact task in a fresh chat using the verification steps.

The change and adoption record distinguishes candidate, released, installed and host-verified changes, with remaining checks and rollback boundaries. Source edits do not update an already-running host.

For one host or project, use cairntir init --host codex; add --user for user-scope configuration. Cursor's global User Rule requires a manual paste; setup prints the rule and reports that step.

Follow the getting-started guide for configuration, verification, recovery, and troubleshooting.

Use

Ask your agent to remember a decision in your project's wing, then start the next task with cairntir_handoff(wing="myproject"). A wing is a project, a room is a topic, and a drawer is one verbatim memory.

cairntir handoff myproject
cairntir handoff myproject --task "repair cache invalidation" --budget 8192
cairntir recall "why did we choose Postgres?" --wing myproject
cairntir recall-for-change src/auth.py
cairntir recover --host codex --wing myproject
cairntir cost myproject

Handoff returns whole drawers or names those omitted by its character budget. It includes recent default-layer writes, open predictions, and optional code anchors. Settlements append observed outcomes without rewriting predictions.

Portable evidence preserves source identities and relationships across stores. Evaluated procedures require holdout evidence and local approval; scoped sharing limits access with owner-issued grants.

Host support

Surface Support
Setup Claude Code, Cline, Codex CLI, Copilot CLI, Cursor, Gemini CLI, OpenCode, Qwen Code
Transcript recovery Claude Code, Codex, Qwen Code
Other MCP clients Configure the cairntir-mcp stdio command manually
Cursor transcripts Unsupported; an explicit receipt explains the limitation

Transcript recovery is opt-in, separately budgeted, read-only, and untrusted. It reads bounded host-owned transcript tails; it cannot recover text the host never persisted. Saving a recovered request requires explicit selection with cairntir recover ... --write N. Memory is not automatically made authoritative merely because it appeared in a transcript or imported file.

Data and safety

The authoritative store is local SQLite with sqlite-vec. Embeddings run locally; first use may download the embedding model. Optional update checks contact PyPI, and explicitly selected LLM adapters can contact their provider. Cairntir is not a sandbox for the agent using it.

Portable JSONL verifies content hashes and optionally HMAC signatures through the Python API. The CLI imports as untrusted and does not verify signatures. Version 1 cannot safely import source-local history references; use a database backup for linked history. Export/import also enforce the format's external-URL restriction. See data handling for backup and trust boundaries.

Build and integrate

The MCP server exposes 21 tools over stdio. Stable Python protocols support custom backends; see the integration guide.

src/cairntir/
├── memory/       # SQLite storage, embeddings, retrieval
├── mcp/          # stdio server and backend
├── reason/       # prediction, experiment, observation
├── recipes/      # composable workflows
└── cli.py        # cairntir setup | init | handoff | recover | recall | replay | hotfix | doctor | export | import
tests/            # unit, integration, contract, property, evaluation
docs/             # guides, architecture, recipes, release evidence

Contributing documents the locked development environment and required checks. Tests enforce at least 80% coverage of the measured surface; transport entrypoints are excluded and tested separately. The LongMemEval subset is a regression gate, not a general benchmark claim.

Documentation

Cairntir (CAIRN-teer) combines a cairn, a waypoint of stacked stones, with a seeing-stone. Maintained by Patrick McGuire. MIT licensed.

Metadata

Release files for cairntir 1.12.4

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

Source distribution (sdist)

Source distribution for cairntir 1.12.4
File Size Uploaded
cairntir-1.12.4.tar.gz 1.1 MB Details

Built distribution (wheel)

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

Total release size: 1.4 MB

Release files / cairntir-1.12.4.tar.gz

Download URL cairntir-1.12.4.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
ccb7e0dac6be2d23578fff9e5dc2d85dd67d73df13370dc6989d8c0db36574e0
BLAKE2b-256 checksum
How to use checksums
f6eec5fc8ef53219854244bee43380aaa725a054f99d619b081825a624449ccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 2, 2026.

Transparency log

Release files / cairntir-1.12.4-py3-none-any.whl

Download URL cairntir-1.12.4-py3-none-any.whl
Size 294.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f8bc623255b20bb4e5733cff964d6f1c610c68ab1f86d3c61b778e0e7eb9332
BLAKE2b-256 checksum
How to use checksums
528b731f3087e1f381fdd8a70d94cdd06a7c3e620bcfca90edbfd1f888041654
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.12.4 This release

2 release files

1.12.3

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.0

2 release files

1.0.0

2 release files

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