跳到正文
DEV Community· Jarvis Nelson Osorio·· 23 分鐘前AI 評分57

Ambient Memory:Cursor 和 Claude Desktop 的零設定本地記憶實作指南

Zero-config local memory for Cursor and Claude Desktop: a walkthrough of Ambient Memory

AI 導讀

Jarvis Nelson Osorio 介紹 Ambient Memory 0.3.0 的安裝與 MCP 接入方式,這個本地優先上下文層會記錄檔案、螢幕工作階段和瀏覽器歷史,供 Cursor 和 Claude Desktop 使用。

正文

If you use a coding agent for more than an afternoon, you already know the tax: the model does not remember which file you had open, which doc you skimmed, or which page you read twenty minutes ago unless you paste that context back in.

I built Ambient Memory to remove that tax without sending your working session to someone else's cloud. I'm Jarvis Nelson Osorio, a tech entrepreneur and AI builder. Ambient Memory is a local-first context layer that passively remembers files, screen sessions and browser history, then exposes that memory to Cursor and Claude Desktop over the Model Context Protocol.

This walkthrough follows the public README for version 0.3.0. The package is not on the npm registry yet, so everything below installs from the GitHub repository — not from npx.

What you get

A background daemon is the only process that opens the SQLite vault. The CLI and the MCP server are clients over a Unix socket (~/.ambient-memory/ambient.sock) or a Windows named pipe. That single-owner design avoids seal races and keeps the CLI from touching the database directly.

On Node.js 22 or later the store uses the built-in node:sqlite module. On Node 20 it falls back to sql.js compiled to WebAssembly, so you do not need better-sqlite3 or a node-gyp toolchain. Search is FTS5 with BM25 ranking.

Privacy is documented rather than advertised as theater:

  • Entity fields are encrypted with AES-256-GCM.
  • When the daemon stops, the database is sealed to memory.db.enc.
  • While the vault is unlocked, the full-text index is redacted plaintext. That is a search tradeoff, and the README says so.
  • Version 0.3 has no telemetry and no network sync.

Noise control matters in practice. The daemon can ignore apps such as Slack and Spotify, dedupe focus churn, and summarize a session so memory_context is closer to "what I was working on" than "every window I glanced at."

Install from source

You need Node.js 20 or later (22+ preferred).

git clone https://github.com/JarvisOsorio/ambient-memory.git
cd ambient-memory
npm install
npm test
node ./bin/ambient.js init
node ./bin/ambient.js start --screen auto   # headless: --screen simulated

Useful CLI commands after that:

node ./bin/ambient.js status
node ./bin/ambient.js doctor
node ./bin/ambient.js search "auth middleware" --type file --since-mins 60
node ./bin/ambient.js recent
node ./bin/ambient.js context --minutes 30
node ./bin/ambient.js forget "query" --yes

forget --all --yes wipes the vault when you want a clean slate.

Hook it to Cursor or Claude Desktop

Point the MCP config at the repo binary — not at a registry package that is not published yet:

{
  "mcpServers": {
    "ambient-memory": {
      "command": "node",
      "args": ["/absolute/path/to/ambient-memory/bin/ambient.js", "mcp"]
    }
  }
}

The mcp command starts the daemon if needed. You then get six tools:

  • memory_search — full-text search with type, path and time filters
  • memory_recent — recently seen entities and events
  • memory_get — one entity by id, including links
  • memory_context — a "what was I doing" summary for the last N minutes
  • memory_relate — a typed relation between two entity ids
  • memory_status — store counts, integrity, key backend and daemon state

memory_context is the one that changes the feel of a session. Instead of pasting a recap into the chat, the agent can ask the local vault.

Why I shipped it this way

Most memory features for assistants live behind an account. I wanted the opposite: a memory you can inspect, encrypt at rest, and delete on command. Ambient Memory is MIT licensed. It is one of six agent tools I published in mid-November 2026; the others cover MCP scanning, transcript scrubbing, tool-path replay, side-effect verification and agent-to-agent deal flow.

If you try this, start with npm test and doctor before you point an editor at it. And please install from the repository until the package is actually on npm.

A longer, canonical write-up lives on my site: https://jarvis-nelson-osorio.pages.dev/blog/jarvis-osorio-ambient-memory-local-first-context-layer/

The rest of the open-source tools are at https://jarvisosorio.com/open-source/.

來源:DEV Community · dev.to