
Cairn Remembers
io.github.CairnRemembers由 GitHub 帳號 CairnRemembers 發布v0.3.4更新於 Oct 28, 2026
Local memory your AI tools share: decisions, notes and corrections that carry across sessions.
發布方自己的服務:Cairn.ink Memory
概覽
為 AI 代理設計的本地優先情境記憶:把決策、筆記與更正存進單一 SQLite 記憶庫,任何支援 MCP 的助理都能檢索與寫入。
- 可以做什麼
- 在記憶庫中檢索、讀取與定位脈絡(orient、fetch、query、read、wander)
- 在對話中直接寫入筆記與結論(note)
- 接上擷取鉤子後,自動把對話輪次記錄成可檢索的節點
- 在本機執行維護流程:向量化、整併、裁剪並重建記憶圖譜
- 透過本機儀表板以及 Hub、Book、Index 等可讀檢視瀏覽紀錄
- 匯入並回填舊對話,整理成彼此關聯的結論節點
- 適用情境
- 適合希望助理跨工作階段、跨模型記住決策、走過的死路與未完成工作,並能接續另一個代理進度的情境。也適合偏好本機儲存、不想使用雲端記憶服務的人。
- 執行需求
- 以本機 stdio 程序在使用者電腦上執行,僅支援桌面端。需要 Python 3.11+ 與 cairn-remembers 套件,可用 pip 或 uvx 安裝;完整安裝會一併取得 PyTorch,嵌入模型首次使用時需下載約 80 MB 模型。每個 AI 用戶端都要各自接線(MCP 伺服器設定或擷取鉤子)。不需帳號、API 金鑰或宣告的環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Cairn Remembers,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Cairn
[License: BUSL-1.1] [Python 3.11+] [PyPI] [Patent pending] [Local-first]
Build knowledge. Leave signals. — Tools for modern explorers.
Local-first episodic memory for AI agents — and for you.
A cairn is a stack of stones that marks a trail. This one marks the trail of your thinking: every decision, dead end, and reason becomes a node you — and any model — can find again, across sessions and across model generations.
- Local-first — everything lives in one SQLite file at
~/.cairn/. No cloud, no account, no telemetry. - Model-agnostic — any agent that runs a shell command or speaks MCP: Claude, GPT/Codex, Gemini, local models.
- Append-only — memories are voided, never deleted. The record is the record.
- Yours — Cairn sends nothing off your machine. Your chat still goes to whatever model you chose, exactly as it would without Cairn — use a local model and nothing leaves at all.
Two ways in:
- 🧑 A person setting this up? Keep reading — Quick start takes about 5 minutes. Every option and fix: QUICKSTART.md.
- 🤖 An AI agent installing Cairn for someone? → SETUP_FOR_AGENTS.md is written for you (install, consent, attribution).
See inside Cairn
Keep the decisions, reasons and unfinished work you want to return to. Cairn stores them in a local vault that you and your connected AI tools can read and add to. Each AI keeps its own memory and context. These demos show the optional dashboard for exploring the record.
Explore all five demos and descriptions.
- Hub — 9 seconds
- Projects — 18 seconds
- Index — 6 seconds
- Live Feed — 14 seconds
- Connections — 8 seconds
Recorded in a local installation. Private text uses examples; controls and source attribution are retained. The filmed installation has not been verified against every control in release 0.3.3. Demo descriptions and recording notes.
Contents
- Quick start
- Wire up your AI
- What you get
- Advanced install
- Multiple accounts
- What to back up
- Common commands
- License
Quick start
Two places, never mixed up: 🖥️ Your terminal (PowerShell / Terminal) — every command on this page runs here, on your computer. Wiring is always a terminal command or a config-file edit — an AI can run those terminal steps for you (that's the fastest path below), but wiring is never something you paste into the chat box. 💬 The AI chat — where memory shows up, and where you test the wiring by asking the AI to use it.
Fastest — let your AI do it
Open Claude Code, Codex, or Cursor and paste:
Install and set up Cairn for me from https://github.com/CairnRemembers/cairn
Your AI runs the terminal steps and asks before switching memory on — one yes/no per AI on your machine, default No. Nothing records without your yes. (Using Codex? There's one extra paste after that — see Wire up your AI.)
Or do it yourself
1 — Install 🖥️ (installs software only — records nothing, the vault starts empty)
⚠️ Installing
[all]on Linux / WSL? Runpip install torch --index-url https://download.pytorch.org/whl/cpufirst, or pip pulls a multi-GB CUDA torch stack you don't need. Windows and macOS torch wheels are already CPU-only.
From source
Still the richer path — the installer handles the CPU-torch step for you:
Get the code 🖥️
Run the installer 🖥️
The installer finds Python 3.11+, installs everything (first run downloads PyTorch — the lean CPU build on Linux/Windows, a few minutes), and checks itself.
2 — Wire up your AI. This is where memory actually turns on, and each AI needs
different wiring — a y in setup finishes the job for Claude Code, but not for
Codex or Claude Desktop. Find your AI below and follow it to its ✅.
Wire up your AI
Cairn has two separate wires, and knowing the difference prevents every common surprise:
- Capture — your chats get remembered automatically (writes to the vault).
- Tools — the AI can search and note your vault from inside the chat (reads + on-demand writes).
Some AIs need one wire, some need both. Don't stop at the first ✓ — follow your AI to its ✅ line.
Claude Code — one command
🖥️ In the terminal:
That wires capture: every new Claude Code chat auto-orients (you'll see the
banner), records as you work, and compiles when it ends. Machine-wide, one-time,
reversible (cairn disconnect --global). Prefer one project only? Run cairn connect
inside that repo instead (global and per-project are mutually exclusive — doctor flags it).
✅ Done when: a new chat opens with a "CAIRN — inherited context" banner,
and 🖥️ python -X utf8 -m cairn doctor shows ✓ capture.
Optional — native tools: Claude Code can already read the vault by running cairn
commands in its shell. For native cairn_* tools instead, register the MCP server
user-wide, pointing at the Python that can import cairn (a bare python that can't
is the #1 failure — prove the path first, QUICKSTART §6a):
💬 Proof: ask the chat to "call cairn_orient". (doctor can't see this wire — the ask is the test.)
OpenAI Codex — three pieces, each does a different job
- Capture 🖥️ —
python -X utf8 -m cairn setup→yfor Codex (=codex-hook install). Captures turns live as Codex firesnotify(deduped by turn id). For a comprehensive sweep of everything on disk, run 🖥️python -X utf8 -m cairn import codex-sessions --applyanytime. - Tools 📄 — add to
~/.codex/config.toml, then fully restart Codex (full §6 walk-through):
- Habit 📄 — create
~/.codex/AGENTS.mdand paste the memory protocol from QUICKSTART §6c so Codex orients, fetches, and notes unprompted. (Needs piece 2 — the protocol calls those tools.)
✅ Done when: 🖥️ python -X utf8 -m cairn codex-hook status prints INSTALLED,
and 💬 a Codex chat answers "call cairn_orient" with a digest (with piece 3, its first
reply starts [cairn: oriented — N]).
⚠️ Honest note: cairn doctor structurally detects Codex MCP registration (the
[mcp_servers.cairn] block), but it does not prove the server launches or that the notify
hook captures — the checks above are the real proof of those.
Claude Desktop / Cursor — one paste
📄 Add to claude_desktop_config.json (or Cursor's MCP settings), then restart the app:
That's the tools wire — search, fetch, wander, note from inside the chat. These
surfaces have no ambient capture; what you ask the AI to cairn_note is what lands.
(If the app can't find Python, use the full path of the Python that installed Cairn.)
✅ Done when: doctor shows ✓ MCP — registered in Claude Desktop config
(Desktop), or 💬 the "call cairn_orient" smoke test answers (Cursor).
Applies to every AI above:
- Wiring is one-time. New chats just remember — you never activate per chat.
orientreads memory; it never switches anything on. Scope varies by wire: Claude Code hooks are machine-wide (or one project viacairn connect); Desktop/Cursor and Codex live in each app's own config, per account. - Only NEW chats pick up new wiring — finish wiring, then open a fresh chat. (Long-lived MCP clients re-read the tools only on a full restart.)
- Privacy controls: skip one chat —
CAIRN_CAPTURE=0in that shell (PowerShell$env:CAIRN_CAPTURE="0"· cmdset CAIRN_CAPTURE=0· bashexport CAIRN_CAPTURE=0) · pause everywhere:cairn capture off/on· secrets scrubbed before write (append-only, fail-closed). - Undo:
cairn disconnect [--global]·cairn codex-hook uninstall· re-runcairn setupto review.
What you get
- One vault, every model. Any agent that speaks MCP or can run
cairnreads and writes the same memory — so one agent builds on what another wrote, even across rival vendors. - Keep your place across a usage cap. Hit a limit on one model, continue on another, and point it at where you left off — the trail is in the vault, not in one model's context.
- Captured as you work — decisions, dead ends, tool calls, and turns become searchable nodes, from the moment you wire it.
- Nothing worth keeping disappears. Every captured turn stores its complete text: search results are gists — an index —
cairn read <id>prints any node in full, and MCPcairn_readpulls it whole with a raisedmax_chars. - A local maintenance pass you run —
cairn sleep, nightly by habit or on your own scheduler (it doesn't schedule itself): embed → consolidate → prune → rebuild the graph → compile, all on your machine. One exception to "no network": the very first embed downloads the ~80 MB model, once. - A map of your thinking — the dashboard galaxy (
cairn dashboard→ http://127.0.0.1:7331), plus a human-readable Hub / Book / Index. - Backfill — distill old conversations into sharp, connected
claimnodes.
Advanced install
Manual install, lighter builds, and venvs
By hand (what the installer runs):
Lighter builds:
Base install is stdlib + numpy. Extras add the embedder (sentence-transformers — the ~80 MB model downloads once, on first use) and the dashboard (fastapi + uvicorn).
PEP-668 "externally-managed-environment" (Ubuntu/Debian/Homebrew/WSL): install into a venv first —
Multiple accounts
One login per AI? Skip this — it just works. Each AI signs in with its own account, and Cairn files that AI's work under its own galaxy automatically — Claude and GPT never mix, with zero setup.
Read on only if you run two accounts of the same AI (two Claude logins, two ChatGPT/Codex logins — say, personal and company). Galaxies are keyed to each login's stable id and never merge — but with two same-AI logins on one machine, Cairn can't always prove which one is active. The rule that keeps it clean:
Declare, don't detect: set
CAIRN_ACCOUNTper account, up front.
Name and manage them anytime:
Honest limits — so you're never surprised:
- Claude Desktop proves the active account per session automatically. Claude Code CLI and Codex can't — they follow the machine's current login file, so an account switch mid-stream can label sessions with the previous account, silently.
CAIRN_ACCOUNTis the guarantee; detection is not. account doctorverifies what's provable (Claude Desktop sessions); it can't audit pure-CLI or Codex history.- Append-only applies here too: renames change display labels only; nothing merges, nothing deletes.
What to back up
One folder: your vault at ~/.cairn/ (that's cairn.db — your actual memories). Back that up. Everything else is replaceable — the code lives here on GitHub, and reinstalling never touches your vault.
Common commands
orient · note · fetch · wander · query · read (any node in full) · dashboard · doctor · setup · connect / disconnect / capture · account · backfill · sleep (the maintenance cycle — you run it) · edges · book · import
Full reference with every option: QUICKSTART.md.
License
Free for personal and non-commercial use under the Business Source License 1.1 — read it, run it, modify it, self-host it. Commercial or business use requires a commercial license — email [email protected]. Source-available (not OSI "open source"); each release converts to the permissive MIT License on the Change Date in its LICENSE.
Patent pending — a U.S. provisional patent application covering Cairn's core mechanisms was filed 2026-07-07. Cairn Remembers™ is a trademark of James Wescott Maitland IV.
Knowledge is a trail, not a destination.
來源:README.md,提交 53a0d1c
工具
0版本歷史
1- v0.3.4最新Sep 25, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。
其他 Cairn 整合

Cairn.ink Memory
ink.cairn官方發布者
Cairn.ink Memory 是託管的 MCP 端點,讓助理儲存、回想、檢視、更正與遺忘跨工作階段的記憶,每筆記憶都附有來源憑證。

Cairn Commons (read-only)
由 GitHub 帳號 cairncommons 發布
唯讀的遠端 MCP 伺服器,讓程式設計助理依錯誤文字、套件名稱與版本查詢經核實、鎖定版本的相依性缺陷紀錄。

Cairn
由 GitHub 帳號 luckyjackluo 發布
Cairn 為 AI 助理提供本機工具,用來列出、讀取、搜尋、加上標籤、編輯、移動並語意檢索指定資料夾中的檔案。

Cairn
由 GitHub 帳號 jasondostal 發布
自架的持久記憶伺服器,讓助理跨工作階段、跨專案儲存、搜尋與回想決策、事實與模式。

Cairn
由 GitHub 帳號 cybort360 發布
把 Claude Code 的工作工作階段、檔案編輯與任務記錄到 Cairn 帳號,讓助理能登記活動與專案筆記。