Cairn.ink Memory

ink.cairn由 cairn.ink 发布官方发布者v0.1.0更新于 Oct 24, 2026

Cross-session memory for AI agents with a Source Receipt for every memory, over MCP.

已验证Streamable HTTP可网页运行知识与记忆AI 与机器学习

概览

AI 生成的概览

Cairn.ink Memory 是一个托管 MCP 端点,让助手保存、召回、查看、更正和遗忘跨会话记忆,每条记忆都附带来源凭证。

可以做什么
  • 显式保存一条记忆及其提交的原文
  • 在模型引导下召回当前记忆与来源凭证
  • 列出记忆,或按 ID、修订版本和凭证查看某条记忆
  • 在已查看的修订版本上更正记忆内容
  • 遗忘某条记忆,使其不再参与主动召回
适用场景
适合希望偏好、项目决策等上下文在多次 AI 会话之间延续,并且想核对或修改已存内容而不是盲目信任的场景。托管端点适合使用 Claude Code 或 Codex、偏好显式记忆工具而非自动捕获的用户。
运行要求
通过 streamable HTTP 连接 cairn.ink 的远程 MCP 端点。需要身份验证:支持 OAuth 的客户端会自动发现,或使用 Authorization 头携带在 Cairn 账户设置中创建的 bearer 个人访问令牌。托管方式需要 Cairn 账户和兼容的托管服务。
安装前请注意
托管插件方式安装后会默认自动捕获白名单内的对话文本,提示召回还会把经过脱敏、限长的当前提示发送到服务端,脱敏只是尽力而为。产品遥测默认开启,可以关闭。来源凭证只是提交的原文,不能证明内容真实或出自本人意图。遗忘是逻辑删除,并非安全擦除磁盘数据,改写后的表述仍可能作为新记忆被重新收录。令牌不要放进代码仓库或提交的配置文件。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Cairn.ink Memory,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/ink.cairn%2Fmemory/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

{
  "mcpServers": {
    "cairn-ink-memory": {
      "type": "http",
      "url": "https://cairn.ink/api/mcp"
    }
  }
}

README

[Cairn Memory — AI memory you can inspect and change. Official Cairn stacked-stone logo. Open-source developer preview.]

Cairn Memory

Keep important context between AI sessions. Change it when things change.

[CI] [Apache-2.0] [Hosted by Cairn.ink]

English · 繁體中文

See an example · Where to start · Local setup · Hosted setup · Limitations · Privacy

Cairn Memory is Cairn.ink's open-source AI memory toolkit for Claude Code and Codex, with local MCP tools or cloud automatic memory. Visit Cairn.ink, install @cairn-ink/memory on npm, or view the Cairn Memory GitHub repository.

Starting a new AI session often means repeating your preferences and project decisions. Cairn provides memory tools to save that context between sessions, inspect the submitted text behind each memory, and update it when things change.

A preference changes

Suppose you save “Keep my reports short.” Later, you decide you need detailed reports. You can inspect the old memory and its source text, correct the saved preference, or forget it so it is no longer available for active recall.

[Illustrated example: save a short-report preference with its submitted source text, then correct it to detailed reports or forget it to remove it from active use.]

This is an illustrated explicit-tool example, not a chat-client screenshot. The local preview uses tools to save, inspect, correct and forget; it does not automatically read your conversations.

  • Inspect the source. Read the source text stored with a memory. A receipt does not prove that the memory is true or correctly interpreted.
  • Correct what changed. Update the memory at the revision you inspected.
  • Forget what should go. Remove a memory from active recall. Deletion and backup boundaries apply.

A Source Receipt is the submitted text attached to a memory. It helps you check what was supplied when the memory was saved or corrected. It is not a verified transcript of the whole conversation or proof of human intent.

Cairn Memory and Cairn

Cairn Memory is the open-source toolkit in this repository for saving, inspecting and changing AI memory. Cairn is the hosted shared memory map for people and AI, where people organize, review and share knowledge.

This repository includes local memory tools and connectors to the hosted Cairn service. Each path has its own setup and feature boundaries. Local use does not require a Cairn account; hosted connections require a compatible service and authentication.

Choose your starting point

You want to…Start hereWhat you need
Understand the idea before installing繁體中文 or the recorded walkthroughNo installation or account
Try the open-source tools on your computerLocal preview setup or Windows guideTerminal setup; Linux x64 and a bounded native Windows x64 check; no Cairn account
Use the documented hosted Claude Code or Codex connectionHosted setupA compatible hosted service and authentication; separate from local-preview client support
Build on the memory layerArchitecture and MCP toolsJavaScript or MCP integration work

If you use Claude or Codex but do not usually install tools from a terminal, start with the example and recorded walkthrough. This preview requires setup; check the tested client paths before connecting your AI tool.

Current preview

Cairn's open-source memory layer stores memories in your own SQLite file and exposes them through MCP or JavaScript. No Cairn account is needed for local use.

Developer preview. Installed persistence and a narrow real-model memory loop have retained evidence. Default extraction still fails our source-support bar; see known limitations. Save, inspect, correct and forget work without a model key. Semantic recall requires your OpenAI key and sends selected context to that provider.

Watch the recorded walkthrough

Watch the 36-second model-free demo (MP4). This records the memory tools running, rather than a conversation in Claude or Codex. “Model-free” means no AI model is called during the walkthrough.

For long-conversation results, see the four-case real-model pilot. It is an opt-in diagnostic with one failed Cairn answer, not a measurement of long-term default-client recall reliability. Known limitations

Open the recorded tool walkthrough (GIF)

The demo below records the model-free loop: save, restart, inspect, correct and forget. Its recall step reports model_not_configured.

[Recorded model-free memory loop: save, inspect the source, restart, correct and forget]

Recorded responses and regeneration instructions · Verified capabilities and client support

Install

For Claude Code and Codex, run the one-command installer:

sh
npx @cairn-ink/memory setup

A fresh interactive install asks once: local MCP memory tools on this computer, or cloud automatic memory with cairn.ink sign-in; choose directly with setup --local or setup --cloud. Fresh non-interactive runs need --local or --cloud; local mode has no automatic capture or recall in 0.6.3.

This checkout contains installer 0.6.3, including Codex 0.164.0–0.166.0 format requalification. Run it with node packages/setup/bin/memory.mjs setup. The plugin is 0.3.3; npm publication is a separate release step. Requires Node ≥22.16 and at least one CLI on PATH. Cloud setup asks about new tools, updates connected tools, and uses one browser sign-in when connecting both. The default server is cairn.ink. Conflicting servers or memory IDs present a choice; non-interactive conflicts change nothing. Codex must pass format qualification before automatic memory is enabled. Automated codex exec runs skip capture and prompt recall by default; opt in with npx @cairn-ink/memory config --codex-capture-exec on.

Choose the mode that fits your workflow:

  • Local preview: your SQLite database, explicit MCP memory tools, no Cairn account. Start here to try the open-source memory layer. Semantic recall uses your OpenAI key.
  • Hosted integration: memory on cairn.ink, with automatic capture and recall through the Claude Code plugin. Requires a Cairn account, token and compatible service. Explicit hosted MCP is also available.

Try the local memory layer

Prerequisites: Git, Node >=22.16, npm and tar. Recorded checks cover Linux x64 and a bounded native Windows x64 installation. On Windows, use the PowerShell setup and walkthrough; the commands below use Linux/WSL paths. Other platforms are unverified. Install from this repository: the unscoped npm and PyPI packages named cairn-memory are unrelated projects. The local archive is not published to npm yet.

1. Install into a new directory. Replace the path below with a new absolute directory beneath an existing parent you control.

sh
git clone https://github.com/Cairn-ink/cairn-memory.gitcd cairn-memorynpm run install:preview -- --directory /absolute/new/cairn-local --owner local-user

The installer builds this checkout and downloads pinned public npm dependencies without install scripts. It creates app/, data/ and a private installation-receipt.json containing the executable path and MCP settings. It makes no model calls. Keep the receipt private: it contains local paths and identity. Installation details, recovery and backup

2. Run the model-free check. From the source checkout, use the same installation path. No chat-client setup or model key is needed.

sh
npm ci --prefix adapters/mcpnode adapters/mcp/walkthrough.mjs --executable /absolute/new/cairn-local/app/node_modules/.bin/cairn-memory

Expect status: "passed". The check uses a fresh synthetic database and verifies the five tools, receipts, process-restart persistence, correction and forgetting. It strips the model key from the child process; model_not_configured is the expected recall result. Steps and expected results

3. Connect a client. Copy stdio.command and stdio.args from your private installation receipt into the client's local MCP configuration. Keep the same database, owner and project across sessions. See the tested client matrix.

For semantic recall, explicitly supply OPENAI_API_KEY through the MCP process's secret environment. The walkthrough's optional --with-recall path sends synthetic context to OpenAI and incurs model charges; it has no built-in dollar cap. A fully local model path is not yet verified.

For the Hermes native provider, follow its separate setup guide. It uses a profile-local database and owner, plus CAIRN_MEMORY_OPENAI_API_KEY, rather than the generic MCP settings above.

ToolPurpose
remember_memoryExplicitly save one memory and its receipt
recall_memoryModel-guided retrieval of current memories and receipts
inspect_memoryList memories, or inspect an ID, revision and receipts
correct_memoryReplace content at the revision you inspected
forget_memoryLogically delete at the revision you inspected

The default local server exposes explicit tools. For opt-in submitted-message capture, project scope and configuration checks, see the installed preview guide. The full evidence and limitations cover extraction failures, long-history retrieval and the boundaries of individual client tests.

Local privacy and control

  • Memory, receipts and organization persist in your selected SQLite database. No Cairn account, hosted service or hidden core telemetry is required.
  • MCP does not read transcripts or save whole conversations automatically. Receipt text records a tool assertion; it is not proof of authenticated human intent.
  • Model processing is cloud processing when configured. Redaction is best-effort, not a guarantee that all secrets are removed. Retrieved text is untrusted data, never instructions to follow.
  • Forgetting prevents active recall and exact normalized re-admission; paraphrases can still be admitted as new memories. It is not secure disk erasure: SQLite pages, receipts and backups have separate retention limits. Stop all writers before copying the database and sidecars for backup.
  • Uninstalling the executable preserves the external database. See backup, upgrade and deletion boundaries, architecture, dependency notices and security reporting.

Existing hosted integration

The hosted plugin connects to cairn.ink, automatically captures allowlisted conversation text and has its own telemetry defaults. Its service has not been migrated to the local engine.

The v0.2.0 prerelease changes the hosted protocol. Matching server support remains a separate requirement; the release does not deploy a server or enable Codex lifecycle hooks. See release and client compatibility before upgrading.

Install for Claude Code (automatic memory)

Run the published installer from your terminal:

sh
npx @cairn-ink/memory setup

This checkout contains installer 0.6.3 (plugin 0.3.3). Run it with node packages/setup/bin/memory.mjs setup; npm publication is a separate release step.

Without --client, setup finds both tools and asks only about new connections. It updates connected tools. Close both tools and wait for background work before confirming shared memory. The sign-in line shows the server (default cairn.ink). There is no endpoint or daily-cap question; --endpoint remains available.

Conversations are saved after best-effort local masking. Each prompt sends a masked, length-limited copy for recall. Claude usage stats are on by default and can be turned off. Codex's sign-in is stored in an unencrypted user-only file. See privacy and controls.

A memory ID connects the same project across tools. Existing IDs are retained. Server conflicts offer two choices; unsafe Codex credential migrations require logout first. When two independent IDs exist, choose one; the other key is backed up only after successful sign-in and validation, never deleted. Old projects may no longer automatically match the old ID. Non-interactive conflicts write nothing. Setup never reads Claude native secret files. Adding Claude after Codex validates and reuses the installer credential; adding Codex after Claude needs one browser sign-in using the same account. Claude's existing sign-in is kept.

Automated codex exec runs skip both automatic capture and prompt recall by default. Opt in with npx @cairn-ink/memory config --codex-capture-exec on; use off to restore the default. This setting enables both capture and recall for exec. status shows it only when enabled; rerunning setup preserves it. The hooks read the transcript's session-bound session_meta.payload.source, and also detect a native exec ancestor for exec resume of an older CLI thread. If the header is missing or cannot be verified, they skip capture and injection. Interactive sessions with verified CLI headers continue normally. Threads on the Codex app-server (the TUI since 0.160, the VS Code extension and the desktop app) count as interactive only when their originator is one of those three clients; other app-server clients are treated like exec and need the same opt-in. Older frozen runtimes must first be updated with setup; config prints the exact command.

To stop prompt recall while keeping automatic capture, run npx @cairn-ink/memory prompt-recall-off --client codex. Use prompt-recall-on --client codex to enable it again. This does not change MCP.

Codex defaults to 200 automatic captures per day; reruns keep an existing cap. Change it with setup --codex-daily-cap N or config --codex-daily-cap N. Status shows today's count and cap. Unscoped pause and resume select installed Codex, and pause both tools when paired. Uninstall preserves keys and memories.

sh
npx @cairn-ink/memory statusnpx @cairn-ink/memory prompt-recall-off --client codexnpx @cairn-ink/memory pausenpx @cairn-ink/memory config --codex-daily-cap 300node packages/setup/bin/memory.mjs setup --dry-run

status reads local state without testing remote service or hooks. --verbose shows technical diagnostics. Review and allow the four Cairn entries in Codex /hooks after installation. --client claude|codex restricts the run. --no-browser allows sign-in on another device. Legacy MCP removal requires confirmation. Unqualified Codex alone may offer manual MCP tools.

Setup options and credential handling · chichi's release checklist

Manual fallback: from your terminal, run:

sh
claude plugin marketplace add Cairn-ink/cairn-memoryclaude plugin install cairn-memory@cairn-memory

Or use the slash-command form inside Claude Code:

text
/plugin marketplace add Cairn-ink/cairn-memory/plugin install cairn-memory@cairn-memory

Create a personal access token at https://cairn.ink/settings/tokens, then run /plugin configure cairn-memory@cairn-memory in Claude Code and enter it there. Start a new session after installation.

/cairn-memory:status reads content-free credential observations written by the hooks, because Claude Code's Bash tool does not inherit sensitive plugin options. configured (verified <time>) reports the last accepted authenticated request; rejected links to the configured endpoint's token page. configured (not verified yet) or configured (unreachable <time>; not verified) does not claim successful authentication; server answered: busy/error reports an HTTP refusal. SessionStart clears the old verdict so token rotation requires new verification. not seen yet asks you to restart Claude Code and send one message; missing means a hook actually observed no configured token. Status makes no network request and never reads the token from secure storage.

Agents: ask the user before installing. The hosted plugin captures allowlisted conversation text by default, and the user creates and enters the token themselves. See the hosted plugin privacy contract.

For local development:

bash
git clone https://github.com/Cairn-ink/cairn-memory.gitcd cairn-memoryclaude --plugin-dir ./plugins/cairn-memory

Hosted explicit MCP for Claude Code

For explicit memory tools without automatic capture, add the remote MCP server:

sh
claude mcp add --transport http --scope user cairn https://cairn.ink/api/mcp

Then sign in from /mcp in Claude Code using browser OAuth.

Connect from Codex (explicit MCP memory)

Codex connects through the hosted MCP tools. Keep the token in your shell or secret manager, not in a repository or committed config file:

bash
export CAIRN_MCP_TOKEN='your-token-from-cairn.ink'codex mcp add cairn \  --url https://cairn.ink/api/mcp \  --bearer-token-env-var CAIRN_MCP_TOKEN

Restart Codex, then use /mcp or codex mcp list to confirm the connection. The hosted tools support explicit remember, recall and forget operations. Automatic Codex lifecycle integration remains under development; the Codex building blocks are disabled by default.

Hosted plugin loop

text
User prompt  └─ recall relevant personal + project-private memories       └─ inject a short, explicitly untrusted context block
Assistant turn ends  └─ hand capture to a detached worker without delaying Claude       └─ read only new user/assistant transcript text            └─ redact likely credentials locally                 └─ send an idempotent capture batch                      └─ store durable memories with Source Receipts

The bundled MCP connection also exposes explicit remember_memory, recall_memory, and forget_memory tools. Clients without lifecycle hooks can use those tools manually; passive capture is never claimed where the host does not expose a hook.

Hosted plugin privacy contract

  • Installation is explicit. Automatic capture begins only after installation and is on by default.
  • Only textual user and assistant message blocks are allowlisted.
  • Tool-result and tool-use blocks are excluded; the plugin does not read arbitrary project files. Ordinary user/assistant text can still contain pasted file contents, terminal output, paths, or repository names and is eligible for processing.
  • Supported credential shapes are replaced with [REDACTED] locally in both capture text and automatic recall queries before transmission. Redaction is best-effort, not a guarantee that every secret is recognized. The hosted service redacts again as defense in depth.
  • Automatic recall sends a redacted, bounded version of the current prompt to the configured service. This occurs before capture and is a separate processing path.
  • Prompt recall sends the host conversation id when it matches the 1–200 character ASCII allowlist (A–Z, a–z, 0–9, ., _, :, -). Trusted hooks supply it, never model text; the server stores only an owner-scoped SHA-256 hash. An older strict server gets one exact-schema retry without the optional field.
  • Project scope is a keyed opaque identifier. Its derivation key never leaves the device and is separate from the anonymous telemetry id.
  • Automatically inferred memories remain personal or project-private. They cannot publish into a team or community.
  • Product telemetry is content-free, defaults on, and can be disabled. Its schema accepts only lifecycle event, client version, platform, and a random installation id.
  • Hooks fail open: Cairn outages and timeouts do not block normal Claude Code work.
  • Capture workers are detached so headless claude -p sessions cannot cancel them during teardown; the allowlisted handoff is piped directly to the worker and is not written to a queue file.

Use /cairn-memory:pause, /cairn-memory:resume, and /cairn-memory:status to control capture and recall.

Paused text is not automatically backfilled. After resume, each session's first capture hook skips its current unprocessed history (including any early resumed text); later complete messages are captured. Requests already started before pause may finish. See the detailed pause boundaries in the privacy guide.

Read the full privacy and threat model. Security reports belong in the private channel described in SECURITY.md, not a public issue.

What is open

This repository is the source of truth for:

  • the Claude Code plugin and marketplace manifest;
  • local transcript filtering, redaction, and project identity derivation;
  • the public HTTP/MCP wire contract and JSON Schemas;
  • a local SQLite core with receipts, namespace isolation, capture orchestration, MOC organization, model-guided recall, correction and deletion suppression;
  • an optional OpenAI adapter, thin local MCP host and inspected install artifact;
  • conformance tests and self-host implementation guidance.

The Cairn.ink hosted extraction service, user database, auth, billing, abuse controls, and production operations live in a separate private repository. See Architecture and Self-hosting for the public service boundary.

Status

The released hosted plugin and local developer preview have different readiness levels. The local install lifecycle is verified, but source-support quality still fails; broad promotion is not yet cleared. No first-ten-user result or star target is presented as achieved. See Known limitations, ROADMAP.md and the proposed adoption experiment.

Star the repository to follow the local preview and upcoming integrations.

Development

The dependency-free plugin runtime and test suite require Node.js 20 or newer. Maintainer-only Claude plugin validation requires Node.js 22 and is isolated under tools/plugin-validation so it is never installed with the plugin.

bash
npm testnpm run test:setupnpm run validatenpm ci --prefix tools/plugin-validationnpm run validate --prefix tools/plugin-validation

For the local store on Node >=22.16 (no dependency installation required):

bash
npm run test:corenpm run demo:store

Contributions are welcome after reading CONTRIBUTING.md and the privacy invariants in docs/protocol.md.

来源:README.md,提交 28acfad

工具

0
该服务器需要登录,因此 SourceWeft 无法在没有账号的情况下读取其工具,也未收录。已连接账号所能看到的内容可能因账号及其权限而异。

版本历史

1
  1. v0.1.0最新Sep 25, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Cairn 集成