rawmem

io.github.Liyuan1992由 GitHub 帳號 Liyuan1992 發布v0.7.1更新於 Oct 25, 2026

Read-only MCP access to a local append-only evidence ledger for AI agent sessions.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

rawmem 是一個本機唯讀 MCP 轉接器,用來查詢記錄 AI 代理工作階段、指令、檔案變更與網頁擷取的附加式證據帳本。

可以做什麼
讀取本機證據庫中不含路徑的狀態與健康資訊,預設不揭露檔案系統路徑或正文內容。取得有限數量的近期事件,預設只回傳摘要,只有在明確授予 read:full 範圍時才回傳原始文字。列出已封存唯讀歷史帳本的封存中繼資料。帳本本身由獨立背景守護程序寫入,它會追蹤 Claude Code、Codex、Cursor 等工作階段日誌、Shell 歷史、Git 鉤子、檔案監看以及受權杖保護的瀏覽器擷取端點;MCP 伺服器只負責查詢。
適用情境
適合希望助理回顧先前的程式工作階段、指令或專案變更,而不必重新閱讀原始日誌,且本機已在執行 rawmem 擷取守護程序的情境。它是查詢層,不是記憶提煉或摘要工具。
執行需求
以本機 stdio 程序在使用者電腦上執行(僅桌面端)。需安裝 MCP 附加元件,例如帶 mcp 附加項的 Python 套件或提供的 MCP 打包檔;README 說明原始碼安裝需要 Python 3.10+ 與 Git。需要有位於預設位置或明確指定路徑的既有帳本才能得到有意義的結果。未宣告 API 金鑰或環境變數。
安裝前請注意
帳本包含私密文字、路徑、指令輸出與工作脈絡,應視為敏感資料;README 說明 .rawmem 因此被 Git 忽略。原始事件正文僅在明確 read:full 範圍下揭露,應謹慎授予。背景擷取需主動開啟,剪貼簿輪詢預設關閉;瀏覽器擷取需要本機權杖。雜湊鏈僅用於發現竄改,並非安全邊界。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 rawmem,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

rawmem

English | 简体中文

rawmem is a tiny local-first evidence ledger for AI and human workflows.

The idea is deliberately small:

Store now, understand later.

AI memory systems often start by summarizing. rawmem starts one layer lower: append-only raw evidence. A chat turn, a 2px UI tweak, a bug fix, a command run, a git snapshot, a browser clip, or a coding-agent completion can all become the same kind of local event.

The hard boundary is simple: capture is not recall. The ledger is a source layer. Review, filtering, MemoryDSL conversion, preference mining, and project rules can be derived later.

Why This Exists

Small facts look noisy alone. Repeated across time and projects, they become patterns:

  • "This icon is too small; make it 2px bigger."
  • "The AI forgot to update the desktop package again."
  • "This project prefers append-only bug records."
  • "The same class of boundary bug appeared in three repos."

Disk is cheap. Missing history is expensive.

Install

New to programming? Choose the Windows app (EXE). An EXE is a Windows program you open by double-clicking. Running it requires no Python installation or terminal commands.

Who it is forChooseRequirements
Windows users who want a graphical appWindows EXE previewA built rawmem.exe; no Python required
Developers who want commands or integrationsPython CLIPython 3.10+ and Git for the source installation below

Choose one approach; you do not need both. There is currently no downloadable release of the new EXE preview. A developer must build it from source first. Users unfamiliar with programming can wait for an EXE release instead of following the Python commands below.

Windows app (EXE preview)

Once you have a built rawmem.exe, double-click it, choose a storage folder, decide whether to start at logon, and click to begin recording. Browser saving requires the optional extension. See Windows recorder for setup and build instructions. This preview is unsigned and the extension still requires manual developer-mode installation.

Python CLI (for developers)

EXE users can skip this section. With Python 3.10+ and Git installed, run these commands in PowerShell:

powershell
git clone https://github.com/Liyuan1992/rawmem.gitcd rawmempython -m pip install --user -e .

The core runtime has no third-party dependencies. DeepSeek Harness compressed session capture and the MCP server are optional extras:

powershell
python -m pip install --user -e ".[deepseek-harness,mcp]"

To install the published v0.7.1 wheel without cloning the repository:

powershell
python -m pip install "rawmem[deepseek-harness,mcp] @ https://github.com/Liyuan1992/rawmem/releases/download/v0.7.1/rawmem-0.7.1-py3-none-any.whl"

Make sure the user Scripts directory (e.g. %APPDATA%\Python\Python312\Scripts) is on PATH so rawmem works from any directory.

One-Time Setup

powershell
rawmem setup --global --install-startup --dry-run  # inspect first; writes nothingrawmem setup --global --yes           # global config + git hooks for all reposrawmem setup --install-startup --yes  # run the daemon headless at every logonrawmem setup --start-daemon           # start it right nowrawmem config --show-browser-token    # paste into the browser extension optionsrawmem doctor                         # verify the complete installation

After this the daemon passively tails Claude Code, Codex, and Cursor sessions, tails PowerShell history, watches configured directories, and serves the browser-capture endpoint — with zero per-event action from you. Clipboard polling is available but disabled by default; enable it explicitly in config or with rawmem config --include-clipboard. The guiding principle is passive over self-report: evidence is pulled from logs other tools already write, not pushed by agents remembering to report back.

See docs/SETUP.md for the full setup matrix and the browser extension.

For DeepSeek Harness capture plus bounded read-only MCP access, see docs/DEEPSEEK_HARNESS.md.

[rawmem DeepSeek Harness demo]

Commands

Background capture (the primary path):

powershell
rawmem daemon              # run all background surfaces in one processrawmem daemon --status     # task counters, errors, last run timesrawmem doctor              # config, storage, daemon, token, startup, hooks, eventsrawmem doctor --strict     # warnings also produce a nonzero exit coderawmem sync                # one manual tailer passrawmem sync --backfill     # first run: also ingest existing historyrawmem config --disable-clipboardrawmem config --rotate-browser-token

Preview or remove integrations:

powershell
rawmem setup --global --install-startup --dry-runrawmem uninstall --dry-runrawmem uninstall                    # disables integrations; keeps ~/.rawmemrawmem uninstall --remove-home --yes  # also deletes the ledger and local state

Inspect the ledger:

powershell
rawmem tail --limit 10rawmem tail --source claude-code --limit 5rawmem tail --project rawmem --type agent_user_turn --jsonrawmem verify --jsonrawmem export --cursor-file .rawmem\consumer-cursor.json --limit 100rawmem seal --yes --json            # unchanged read-only archive + linked active ledgerrawmem archives --json              # metadata-only derived archive registryrawmem export --archive .rawmem\archives\old.jsonl  # explicit; metadata-only default

rawmem export uses the stable rawmem.cursor.v1 contract and never needs to load the whole ledger. Cursors bind to a ledger identity plus a byte offset and boundary hash, so truncation, replacement, or rotation is reported explicitly instead of silently skipping or duplicating evidence. See docs/LEDGER_PROTOCOL.md.

rawmem verify is strictly read-only: it never creates or refreshes lock/state sidecars. rawmem seal keeps historical bytes unchanged, records the full verification report and every accepted previous_hash_mismatch, marks the old ledger ReadOnly on Windows, and creates a chain-complete active ledger at the same configured path. Archive reads require --archive; they hash the complete archive before returning results, default to a body-free metadata projection, and surface recorded integrity warnings.

Manual and scripted capture:

powershell
rawmem capture --source manual --type note --text "First rawmem event""The button should be 2px larger." | rawmem capture --source clipboard --type ui_feedback --stdinrawmem ingest --file event.json"Selected page text" | rawmem clip --stdin --url "https://example.com"rawmem run --source terminal -- python --versionrawmem git-snapshot

Current Coverage

Capture preserves complete supported text without a character cap, including when old configurations still contain max_chars. Source batch sizes are processing budgets and never split complete records. Browser capture saves only the loaded document on an explicit click; it does not fetch hidden history.

SurfaceHowWhat lands in the ledger
Claude Code sessionsdaemon tailer (zero friction)user/assistant turns, project, session, branch
Codex sessionsdaemon tailer (zero friction)user/assistant turns, project, session
Cursor agent transcriptsdaemon tailer (zero friction)user/assistant turns, workspace, session
DeepSeek Harness sessionsopt-in daemon tailer (zero friction after setup)direct user/model turns; tool name/id/status metadata only
WorkBuddy local historyopt-in daemon tailer (desktop setup enables it)5.1-style JSONL message text and source identity
OpenClaw local historyopt-in daemon tailer (desktop setup enables it)legacy JSONL and new SQLite transcript messages; shared identity dedupe
Shell commandsdaemon tailer of PSReadLine historyevery completed command line
Clipboarddaemon poller (deduped, opt-in)clipboard text changes
Git lifecycle, all repossetup --global --yes core.hooksPath hookscommit/checkout/merge/rewrite/push snapshots
File changesdaemon watcherbatched created/modified/deleted paths
Browser pagesMV3 extension (extension/) + token-protected localhost endpointselection or page text, title, URL
Any adapter/toolingest / POST /captureJSON event payloads
Manual notescapture / clip / runraw text, tags, artifacts, command results

Storage

By default, events are written to:

text
~/.rawmem/events.jsonl

Use --local to write to the current project's private ledger:

text
.rawmem/events.jsonl

Use --ledger <path> or RAWMEM_LEDGER for an explicit ledger path.

Capture policy is configured under privacy in ~/.rawmem/config.json. Optional project/path allowlists fail closed, common secret shapes are redacted before append, and artifacts default to metadata references rather than embedded content. Daemon status and rawmem doctor expose source coverage, skipped events, redactions, and cursor health without printing captured text.

.rawmem/ is ignored by Git because raw evidence can contain private text, paths, command output, and local work context.

Event Shape

Each line is JSON:

json
{  "schema": "rawmem.event.v1",  "event_id": "evt_...",  "ts": "2026-07-09T00:00:00Z",  "source": "codex",  "event_type": "task_note",  "project": "rawmem",  "cwd": "/workspace/fictional-rawmem",  "summary": "User asked for a local-first raw evidence ledger.",  "raw_text": "User asked for a local-first raw evidence ledger.",  "tags": [],  "artifacts": [],  "payload": {},  "privacy": {    "scope": "local_only",    "review_required": true  },  "previous_hash": null,  "content_hash": "..."}

The previous_hash / content_hash chain is a lightweight tamper-evidence mechanism. It is not a security boundary, but it makes accidental rewrites more visible.

Adapter Strategy

rawmem should not chase every AI tool with one giant integration. The stable piece is the ledger. Capture adapters can be small and optional:

  • CLI wrappers for Codex, Claude Code, shell commands, and build scripts.
  • Generic JSON ingest for tools like WorkBuddy, QWork, or custom scripts.
  • Git/file watchers for tools that ultimately change a repo.
  • Localhost browser capture, bookmarklets, and later browser extensions for web AI chats, issue pages, docs, and web clips.
  • App-specific adapters when a tool exposes logs, exports, plugins, or APIs.
  • Manual hotkey/clipboard capture as a low-friction fallback.

All adapters should emit the same event schema.

MCP is a query adapter, not a promotion path. rawmem-mcp exposes only path-free status, bounded recent events, and archive metadata. Summary access is the default; raw bodies require an explicit read:full scope.

Privacy Principles

  • Local first.
  • No upload by default.
  • No automatic memory promotion.
  • Background capture must be opt-in.
  • Clipboard polling is off by default.
  • Browser capture requires the local token created in ~/.rawmem/config.json.
  • The extension options page can test daemon connectivity and token acceptance.
  • Machine-wide Git hook setup requires --yes.
  • rawmem uninstall preserves captured data unless --remove-home --yes is explicit.
  • Store raw events separately from reviewed or derived memory.
  • Prefer allowlists for browser/app capture.

See PRIVACY.md and SECURITY.md before enabling background capture on a daily driver machine.

Development

powershell
$env:PYTHONPATH = "src"python -m unittest discover -s testspython scripts/open_source_audit.py

來源:README.md,提交 c8351d7

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.7.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分