CP Memory

io.github.CJhuochai由 GitHub 帳號 CJhuochai 發布v1.8.1更新於 Oct 24, 2026

Local-first, governable long-term memory for AI coding agents

發布方自己的服務:Memory.fit

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

概覽

AI 產生的概覽

CP Memory 為 AI 程式助理提供本機、可治理的長期記憶,讓專案規則與決策能跨工作階段保留。

可以做什麼
它會把事實、偏好、進行中的工作、事件、決策與對話檢查點存入本機 SQLite 資料庫,並透過 MCP 工具與生命週期鉤子還原相關脈絡。它能從明確陳述中保守地自動擷取長期記憶候選,依 repo、project、workspace 範圍優先處理目前專案的記憶,並支援審查收件匣、摘要、衝突建議與更正狀態。記憶可被標記為錯誤、過期或限定範圍,而不是被靜默覆寫。
適用情境
當你希望程式助理跨工作階段記住專案規則、偏好與決策,而不依賴託管的記憶服務時使用。它適合想檢查、更正與治理記憶內容,而不是無差別累積一切的使用者。
執行需求
以本機 stdio 程序執行。通用方式需要 Python 3.10+ 與 uv,透過 uvx cp-memory-mcp 啟動。增強的 Codex 外掛方式在 Windows 上透過市集安裝,在 macOS/Linux 上使用原始碼安裝腳本建立私有 Python 執行環境。未宣告驗證、環境變數或標頭。
安裝前請注意
記憶會寫入本機 SQLite 資料庫,預設位於使用者家目錄下,自動擷取會依明確陳述產生記憶候選。不要提交記憶資料庫、日誌、私有摘要或環境檔案。審查提醒會注入助理脈絡,而不是以面向使用者的介面顯示,維護流程不會自動刪除記憶或自動解決衝突。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

[CP Memory logo]

CP Memory

Local-first, governable memory for AI coding agents.
Remember project rules across sessions, recall only what matters, and correct bad memory without hiding history.

简体中文 | English

[License: MIT] [Local first] [MCP server] [Cross-platform CI]


Why CP Memory

For reproducible package, protocol and recall checks, see verification evidence and limits.

  • Local first: memory stays in ~/.cp-memory/memory.db by default.
  • Governable: inspect, review, correct, scope, or retire memory instead of silently overwriting it.
  • MCP-ready, Codex-enhanced: the stdio MCP server is the portable baseline; the Codex plugin adds Skills and lifecycle Hooks.

[CP Memory 30-second demo]

Quick Start — Portable MCP

With Python 3.10+ and uv installed, any stdio MCP client can start CP Memory with:

text
uvx cp-memory-mcp

The public package passed a clean-cache MCP handshake with all 40 tools and a write/search/correct flow. See MCP client setup for Codex, Claude Code, Cursor, VS Code, and Gemini CLI examples.

For the enhanced Codex integration with lifecycle Hooks and Skills, install the plugin:

powershell
codex plugin marketplace add CJhuochai/cp-memorycodex plugin add cp-memory@cp-memory

Restart Codex after installation and approve the lifecycle Hooks if prompted.

See The Result In 30 Seconds

  1. Tell Codex a project rule, such as: “Releases must start on a branch, run tests, and merge through a PR.”
  2. In a later session, CP Memory restores the relevant rule from the local primary store so Codex can continue following it.
  3. If the rule is wrong, preserve correction history and mark the old record wrong, stale, or scoped instead of silently overwriting it.

CP Memory is a local-first memory plugin for Codex. It stores facts, preferences, ongoing work, episodes, decisions, and conversation checkpoints in a local SQLite database, then restores relevant context through MCP tools and lifecycle hooks.

The goal is not to remember as much as possible. The goal is memory that remains trustworthy after long-term use: explainable, reviewable, correctable, and governable.

[CP Memory architecture]

[CP Memory recall demo]

Current Capabilities

  • Context restore: restores relevant local-primary memory on startup and eligible prompts.
  • Automatic extraction: conservatively creates long-term personal memory candidates from explicit statements.
  • Project scope: prioritizes current-project memories with repo:, project:, and workspace: scopes.
  • Reviewable governance: supports review inbox, review digests, conflict suggestions, correction states, and startup reminders.
  • Safe maintenance: weekly maintenance runs health checks, governance preflight, and low-risk expiry cleanup only.

[CP Memory governance loop]

30-Second Example

You tell Codex:

text
Remember this: releases for this project must start on a branch, run tests, and merge through a PR.

In a later session, you ask:

text
What are the release rules for this plugin?

CP Memory restores the relevant memory from the local primary store first, and Codex follows that rule. If the memory is wrong, you can mark it wrong, mark it stale, or write a corrected version.

See more anonymized examples in docs/examples.md.

For a GIF, short video, or launch post, use the sanitized 30-second demo script.

Install

For any stdio MCP client, use the verified public package:

text
uvx cp-memory-mcp

Client-specific commands and JSON files are in docs/mcp-clients.md.

For Windows, the recommended path is GitHub Marketplace installation:

powershell
codex plugin marketplace add CJhuochai/cp-memorycodex plugin add cp-memory@cp-memory

Restart Codex after installation. If Codex asks you to trust hooks, approve the CP Memory lifecycle hooks in the hooks view.

For macOS/Linux, use the source installer. It creates a private Python runtime for the plugin and installs the MCP dependency:

sh
git clone https://github.com/CJhuochai/cp-memory.gitcd cp-memorysh ./install.sh

Restart Codex when it finishes. Do not treat GitHub Marketplace installation on macOS/Linux as an equivalently verified path: Marketplace does not run install.sh, so it does not create that private runtime.

Platform Support

PlatformRecommended installationVerified coverage
WindowsGitHub Marketplace; install.ps1 for local developmentUnit tests, isolated installation validation, and GitHub Actions CI passed
macOSSource installer: sh ./install.shGitHub Actions macOS CI passed unit tests and isolated install/MCP startup validation
LinuxSource installer: sh ./install.shGitHub Actions Ubuntu CI passed unit tests and isolated install/MCP startup validation

Manual smoke testing of real Codex desktop Hook injection on macOS/Linux is still pending access to physical devices. This release is accepted through three-platform CI; the boundary does not affect the installer and MCP-startup checks already covered, but it is not a substitute for full desktop manual acceptance.

Safety

  • Do not commit your real memory.db, logs, private summaries, or environment files.
  • Automatic extraction is intentionally conservative. Generated memories can be reviewed, corrected, marked stale, or marked wrong.
  • When memories need review, the current version injects a reminder into assistant context. It is not a user-facing popup or visible review panel, and it does not auto-delete memory or auto-resolve conflicts.
  • Weekly maintenance runs health checks, governance preflight, and low-risk expiry cleanup only; long-term personal memories, tasks, and decisions are protected by default.
  • Examples and screenshots use sanitized content, so you do not need to expose your real memory database.

Comparison

If you have seen other memory projects, start with docs/comparison.md. CP Memory's main difference is Codex lifecycle integration plus memory governance, not just storage and search.

Roadmap

See docs/roadmap.md for future directions. The roadmap prioritizes local-first behavior, explainability, correctability, and privacy safety.

See CHANGELOG.md for version history.

Local Development

Windows users normally do not need to run install.ps1. It is mainly for local development, refreshing the personal marketplace cache, and migrating old global hook wiring from earlier versions.

For local macOS/Linux development, run:

sh
sh ./install.shsh ./scripts/test-install.sh

Python 3 with python3 on PATH is required. The installer creates a private virtual environment in the plugin directory and installs runtime dependencies; this is the currently verified installation path for macOS/Linux.

Run the test suite:

powershell
python -m unittest discover -s tests -p test_cp_memory.py

Validate the installer in an isolated temporary profile without touching your real Codex configuration:

powershell
powershell -ExecutionPolicy Bypass -File .\scripts\test-install.ps1

License

MIT

來源:README.md,提交 a584f64

工具

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

版本歷史

1
  1. v1.8.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

其他 Memory 整合