remem 标志

remem

社区
majiayu000

Local-first persistent memory for Claude Code & Codex CLI - Rust CLI, hooks, MCP server, SQLite/SQLCipher, auditable recall for long-running coding work.

发布者majiayu000
代码仓库remem
语言Rust
复刻数
3
星标数
32
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    remem 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 32 个 Star 和 3 个 Fork。

remem: Local-first memory for Claude Code and OpenAI Codex

MCP Toplist

Stop re-explaining your project every new coding-agent session.

Language: English | 简体中文

remem automatically captures, distills, searches, and injects engineering memory across Claude Code and OpenAI Codex CLI sessions. Decisions, bug-fix rationale, project patterns, and preferences stay available through hooks, MCP, CLI, and a localhost REST API.

CI Release crates.io npm License MIT

Remem recall demo showing a new session picking up an earlier bug fix

A new Claude Code session recalls the earlier root cause, commit, and open TODO with memory citations and no re-explaining.

What remem gives you

  • Automatic session capture and background LLM distillation.
  • Project-scoped recall across Claude Code and Codex using one local store.
  • Searchable decisions, bug fixes, architecture notes, preferences, and raw session evidence.
  • Source attribution, staleness labels, suppression, review queues, and injection audits.
  • SQLite with SQLCipher encryption by default for fresh installs.
  • MCP, CLI, and authenticated localhost REST access from one Rust runtime.

remem prioritizes memory quality. Automatic capture is the primary path; manual save_memory calls supplement it when a decision needs to be recorded immediately.

Install in five minutes

Homebrew

bash
brew install majiayu000/tap/remem
"$(brew --prefix remem)/bin/remem" install --target codex

Use --target claude for Claude Code. --target all configures every known host, including Cursor where its v1 renderer is supported.

Standalone installer

bash
curl -fsSL https://raw.githubusercontent.com/majiayu000/remem/main/install.sh | env REMEM_NO_CONFIG=1 sh
~/.local/bin/remem install --target codex

npm or Cargo

bash
npm install -g @remem-ai/remem
# or
cargo install remem-ai --bin remem

remem install --target codex

GitHub Releases: prebuilt binaries for macOS and Linux on x64/arm64, with published checksums. Use one canonical remem executable on PATH; remem doctor warns when hooks and terminals resolve different copies.

For channel-specific upgrades, platform boundaries, PATH drift, and manual install notes, read the installation and upgrade guide. The broader documentation guide links plugin and operational material.

Verify the installation

Restart the selected coding agent, then run:

bash
remem doctor
remem status
remem search "last decision"

A healthy Claude Code or Codex installation injects relevant project memory at SessionStart and queues durable session distillation at Stop. Codex also uses UserPromptSubmit to capture each prompt and surface compact optional memory candidates. remem doctor checks the schema, encryption key, database, hooks, MCP registration, worker, and common install-path drift.

Repository contributors can verify duplicate SessionStart suppression with the isolated executable smoke fixture.

For a focused, read-only view of current-memory truth:

bash
remem doctor truth --cwd .

Host support

CapabilityClaude CodeCodex CLICursor v1
MCP memory toolsYesYesYes on macOS/Linux
SessionStart injectionYesYesNot supported
Automatic session memoryYesYes, Stop-based and low-noiseNot enabled by the v1 installer
Tool-event captureInstalled hooksNo high-frequency Bash hook by defaultRuntime command exists; no installed hook
Compiled command-rule enforcementOptional warn/block on BashNot supportedNot supported
WindowsSupportedSupportedNot supported

Cursor's v1 installer registers MCP only. The verified observe and summarize runtime commands exist, but remem install --target cursor does not install automatic capture hooks or SessionStart injection.

The repository also includes a Codex plugin wrapper. See plugins/remem/README.md for local plugin runtime and explicit hook activation instructions.

Why use remem alongside built-in memory

Built-in MEMORY.md, CLAUDE.md, and agent instruction files are ideal for a small set of stable facts that should always be visible. remem covers the engineering history that is too large, dynamic, or evidence-heavy to maintain by hand.

NeedBuilt-in filesremem
Stable project rulesExcellentSupported
Automatic session captureManual upkeepHook-driven
Search older rationaleLimited by loaded textCurated and raw search
Branch, time, and staleness handlingManualBuilt in
Provenance and injection auditGit historyDatabase-backed audit
Review, suppression, and lifecycle governanceManual editsFirst-class commands

Use both. Keep concise rules in native files and let remem retain the long tail of decisions, failures, evidence, and changing project state.

The broader ecosystem comparison lives in the dated memory-tool survey.

How it works

text
Claude Code / Codex hooks
          |
          v
append-only captured_events ledger
          |
          v
coalesced background extraction and session rollup
          |
          v
governed candidates -> curated memories + workstreams + raw archive
          |
          v
FTS, entity, temporal, vector, graph, and optional local rerank retrieval
          |
          v
budgeted, source-attributed SessionStart context

Hooks return quickly after durable capture or queueing. Background workers perform extraction, candidate governance, compression, retrieval enrichment, and lifecycle cleanup. MCP, CLI, REST, and SessionStart share the same local store and governance model, but apply surface-specific eligibility policies. Explicit search is an inspection and recovery surface, so it may return labeled legacy_unverified memories; default SessionStart and CurrentTruth exclude those rows and record the reason.

Generated memory is treated as untrusted until it passes source-support, secret, instruction-pattern, scope, and lifecycle checks. Unsafe content is dropped or routed to review with a diagnosable reason.

For module ownership and current data flow, read docs/ARCHITECTURE.md.

The experimental MCP context_bundle tool exposes the versioned, budgeted compiler to explicit callers. The experimental remem context-plan command prints a request-specific retrieval plan. These opt-in interfaces are tracked by the Context Bundle and retrieval-router contracts.

The default Codex integration stays low-noise: SessionStart provides stable context, UserPromptSubmit provides a compact candidate index, and Stop queues background summarization. Prompt candidates contain IDs, titles, state, retrieval reason, estimated read cost, and a detail lookup hint, but no memory bodies. They are optional leads that Codex may ignore, open, or search beyond. The first prompt may also receive up to two continuity anchors so a prompt such as continue does not depend on lexical overlap. Existing hybrid RRF ranks memory candidates; no final confidence threshold decides relevance for the model. Automatic extraction asks for short, specific candidate titles without a redundant project-name prefix; existing stored titles remain intact.

For your own Codex sidebar, an optional rename convention is MMDD|TYPE|Topic, such as 0903|FIX|FTS5 tokenizer mismatch. If you use a separate host-supported rename workflow, preview its proposed names before applying a batch. This is host-sidebar organization only: Remem does not rename host conversations or import those names as intent overrides. Remem's structured session/workstream fields remain authoritative, and a host title does not change memory types or workstream identity. See the session intent contract and implementation epic #1065.

Everyday workflows

Recall and inspect

bash
remem search "database encryption"
remem search "deployment decision" --branch main --explain
remem show <memory-id>
remem why <memory-id>
remem current <state-key>

remem search keeps the terminal clean: per-query [INFO] [search-perf] diagnostics are written to the log file, not stderr, in normal use. Set REMEM_DEBUG=1 to mirror them to stderr while debugging.

Agents can use MCP search for compact results, then get_observations for selected details. Use raw recall only when curated memory misses exact transcript evidence:

bash
remem raw search "exact phrase" --since 2026-06-01 --json

List complete host-bound sessions before reading an exact transcript:

bash
remem raw sessions --latest 20 --json
remem raw messages --host codex-cli --source-root local \
  --project "/path/to/project" --session-id SESSION_ID --json
remem ingest-sessions --root codex-cli:archive=/path/to/sessions --json

Copy host, source_root, project, and session_id unchanged from one raw sessions summary into raw messages. Existing scripts must add the required --host selector and replace --root LABEL=PATH with --root HOST:LABEL=PATH; the same root format applies to raw reconcile. The JSON envelope reports excluded_legacy_rows, excluded_legacy_sessions, and excluded_legacy_identities when some archive rows cannot enter the host-bound session contract. Each listed session also carries additive nullable mmdd, session_intent, session_topic, display_label, and session_intent_source fields. mmdd is derived from the session created epoch in Asia/Shanghai; the full {MMDD}|{INTENT}|{topic} label is present only when both intent and topic are known. Stop summaries may fill those fields with source summary; unknown, empty, too-long, or redacted values abstain instead of blocking the rest of the summary. Automatic Stop rollups preserve manual label overrides, including explicit clears, across later turns. Listing still returns healthy sessions; --latest N fills that bound from healthy sessions only and does not let unresolved rows occupy those slots. Use the skipped identities (source_root, project, session_id, and host when known) to inspect or repair those rows. Exact raw messages for a skipped selector stays fail-closed. Do not re-ingest a skipped row unless ingest can actually claim it — many legacy rows have no trusted host provenance. HOST is claude-code or codex-cli, and LABEL becomes the persisted source_root. Cursor snapshot evidence requires a manually configured and verified remem summarize --host cursor Stop integration; filesystem --root ingestion and reconciliation reject cursor explicitly.

Review and govern

bash
remem review list
remem review approve <candidate-id>
remem memory suppress memory:<id> --reason "no longer relevant"
remem govern --action stale --dry-run --json <id>

Mutating governance commands expose previews, explicit confirmations, or review boundaries according to their risk. Run remem <command> --help for the current contract instead of relying on a copied command inventory.

MCP tools share that store with stricter wire contracts. The canonical MCP contract is GH981, including the #1061 mutation and scope boundary:

  • save_memory: pass host when the calling host is known. An omitted host is recorded as unknown, never inferred as codex-cli.
  • govern_memory: dry-run first to preview IDs and current versions from that governance transaction. Non-dry-run mutations require expected_versions for every ID, confirm_destructive=true, and an explicit reason.
  • recall_user_context: supply project or cwd. The server does not infer this scope from its own process working directory.

The local Remem app shows session/workstream labels or explicit abstention. Sessions can be filtered by intent and created date in Asia/Shanghai. Operators can correct labels in batches with a Before/After preview, explicit confirmation, and an audit; workstream identity and host conversation titles stay stable.

Configure memory AI and retrieval

bash
remem config show
remem model current
remem model use balanced --dry-run
remem embedding status
remem embedding download --model multilingual-e5-small
remem embedding backfill --limit 1000

auto embedding mode stays local unless a remem-specific API key is selected. The verified local model is optional; the labeled feature-hash fallback remains available. The second-stage local reranker is also optional and disabled until configured.

Use the current configuration routes, the local embedding contract, and remem config, remem embedding, or remem reranker help for details.

Share or edit memory outside the database

bash
remem sync-memory --cwd .
remem export --markdown --output ./remem-memory
remem export --pack .remem-pack

Markdown mirrors are human-editable. Project memory packs are deterministic, git-committable exports with provenance-aware import and quarantine behavior. See the memory usage guide and project memory pack contract.

Evidence and benchmarks

The checked-in public suite separates memory-system capability evidence from coding-agent outcome evidence. Verify it locally with:

bash
cargo run -- bench verify --root eval/public --json-out /tmp/remem-bench-verify.json

Verification resolves claims/registry.json beside the parent of --root, so an external bundle keeps public/ and claims/ as siblings and is independent of the caller's working directory.

Public adversarial SQLite snapshots are capped at 64 MiB and must be canonical VACUUM images; verifier-consumed artifact targets must also resolve inside the declared public root.

The current public report does not support public benchmark claims and is deliberately labeled directional_only_no_public_claim. The historical isolated coding baseline is useful engineering evidence, but its preloaded-memory condition is not comparable with the current SessionStart retrieval path.

Reproduction commands, artifact schemas, claim boundaries, and current gates live in:

README claims intentionally exclude unsealed local metrics that have no checked-in report.

Security and privacy

  • Fresh installs create a SQLCipher-encrypted database and private key file.
  • The data directory and key use restrictive per-user permissions.
  • The REST API binds to 127.0.0.1 and requires a bearer token.
  • Hook-captured event previews are redacted before durable storage.
  • MCP and CLI workstream listings project redacted text: credential-like assignments, short inline secrets, and sensitive command options are replaced with [REDACTED] in returned fields (and CLI --json envelope project), while ordinary filesystem project paths stay readable. Stored workstream rows keep their canonical values for matching and scope checks, so queried output can differ from the database when secrets were present.
  • Memory candidates and injected content pass secret and poisoning defenses.
  • remem doctor reports encryption, plaintext residue, schema, and audit failures without printing memory payloads.

Read SECURITY.md for reporting and security policy. Operational contracts for SQLite tuning and memory-poisoning defense are kept outside the landing page.

REST API

bash
remem api --port 5567
TOKEN=$(cat ~/.remem/.api-token)
curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:5567/api/v1/health
curl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:5567/api/v1/capabilities

Clients should feature-detect through /api/v1/capabilities. The current endpoint and compatibility contract is maintained in docs/specs/SPEC-web-api.md.

Documentation

Use docs/README.md as the jump page for installation, configuration, memory lifecycle, retrieval, governance, API, plugin, operations, architecture, and benchmark material.

The most common destinations are:

Uninstall

Preview and remove host hooks and MCP registration without deleting memory:

bash
remem uninstall --dry-run
remem uninstall

The encrypted database remains in the configured REMEM_DATA_DIR. Back it up before manually deleting that directory if data removal is intended. Ordinary file deletion removes remem's local data but does not guarantee secure erasure from filesystem snapshots, backups, or the underlying storage media.

License

MIT

将 remem MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 remem 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 remem 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 remem MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "remem": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 remem MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 remem MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 remem 帮我完成这项任务吗?
remem
当然。我已阅读。
以下是我使用 remem 得到的结果。

常见问题

remem MCP 服务器有什么用途?

remem 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 remem MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 remem,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 remem MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 remem 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 remem MCP 连接到 TypingMind?

remem 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

remem MCP 在 TypingMind 中提供哪些工具?

remem 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 remem MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 remem 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇