Skip to main content
Glama
Lyellr88

marm-memory

许可证 Python FastAPI Docker拉取量 PyPI下载量 PyPI版本 MCP注册表

Discord 发布 CodeQL marm-memory MCP服务器

欢迎贡献!浏览开放问题参与贡献,或加入MARM Discord分享工作流、获取设置帮助并与其他构建者交流。

目录

Related MCP server: Memory Crystal MCP Server

快速开始

  1. 安装并使用你偏好的代理配置文件进行初始化:

pip install marm-mcp-server
marm-memory init --g-claude --g-codex --g-gemini

也可使用:--g-qwen 和 --g-kiro。不带标志运行则安装到当前项目文件夹而非主目录

  1. 交给你的AI伙伴。告诉你的代理:

"使用 marm-init 技能来设置 MARM。"

  1. 交互:你的代理将直接在聊天中交互式地处理整个设置过程(Python/Docker、HTTP/STDIO、密钥和客户端配置)。

手动设置

更倾向于自己动手配置:

将 "agent" 替换为你客户端的CLI命令(例如 claude、gemini 或 qwen)。对于 Codex,请使用 codex mcp add marm-memory --url http://localhost:8001/mcp

如果你是...

启动服务器

连接你的MCP客户端

独立开发者/研究人员

marm-memory start

"agent" mcp add --transport http marm-memory http://localhost:8001/mcp

私有本地STDIO用户

marm-mcp-stdio

"agent" mcp add --transport stdio marm-memory-stdio marm-mcp-stdio

多个代理共享记忆

marm-memory start --profile swarm

"agent" mcp add --transport http marm-memory http://localhost:8001/mcp

私有高吞吐量集群

marm-memory start --profile swarm-max

"agent" mcp add --transport http marm-memory http://localhost:8001/mcp

受信任的私有实验室/服务器

marm-memory start --profile trusted

"agent" mcp add --transport http marm-memory http://localhost:8001/mcp

  • ⚡ 最快HTTP启动:运行 marm-memory fast-start-http 以启动本地运行时、启动控制台并在浏览器中立即打开。

  • 🖥️ 网页控制台:运行 marm-memory console 以立即查看本地UI应用(无需Node.js)。

  • ⚙️ 生命周期管理:使用 status、logs --follow、restart 和 stop 管理后台守护进程。

  • 💡 快速标志:使用 --no-console 或 --no-browser 限制启动。运行 marm-memory --help 查看完整命令列表。

为什么选择MARM记忆

你的AI会忘记一切。MARM记忆不会。

marm-memory 为你的代理提供了一个私有的、共享的记忆,用于存储那些通常在对话间丢失的上下文:决策、研究、修复、笔记和项目历史。从 Claude Code 切换到 Codex 或 Gemini 时,无需丢失已收集的上下文。

它整合了三件事:

  • 🧠 核心记忆(7个工具) 存储对话、笔记、笔记本条目和摘要,使其保持可搜索。

  • 💻 代码图谱(5个工具) 映射你的仓库,使代理能够查找符号、追踪代码路径并理解项目,而无需重新阅读所有内容。指向一个仓库一次,它就会在你工作时保持自身更新。

  • 🧩 概念图谱(2个工具) 连接来自你存储记忆的人员、决策、错误和想法,并在可用时链接回相关代码。它在你存储记忆时自行构建。

所有14个工具均可通过HTTP和STDIO工作。你的代理共享相同的本地记忆,跨会话使用,而不是每次都从头开始。内置控制台让你可以查看和管理已保存的内容。

工作原理

功能

重要性

记忆模型

会话、结构化日志、笔记本、摘要和语义记忆

保持项目历史可搜索,而非困在单个聊天中

扩展层

SQLite WAL模式、连接池、序列化写入队列和HTTP速率限制预设

让一个服务器支持单人使用、多代理工作和集群式突发流量

智能层

FTS过滤器、语义重排序、有界语义回退、自动分类、写入时合并和压缩候选

随着记忆增长保持召回有用,而非让重复堆积

代码图谱层

仓库索引、符号查找、调用追踪、架构概览和变更影响分析

让代理无需重新阅读整个代码库即可了解项目结构

概念图谱层

从存储记忆中提取实体和关系,并链接回代码图谱

跨会话连接决策、错误、工具和人员,而非将它们作为纯文本保留

令牌层

轻量级7工具核心表面(含捆绑图谱工具共14个)、检索前语义重排序和写入时去重

每次召回时减少发送给模型的令牌,且成本随记忆扩展保持可预测

部署层

Pip、Docker、STDIO、HTTP以及托管的 swarmswarm-maxtrusted 配置文件

让你使用相同的MCP接口运行私有本地记忆或共享多代理记忆

请参阅性能与扩展基准测试了解检索延迟、并发性和写入成本数据,以及架构与内部机制了解每层背后的机制。

运行时CLI命令

marm-memory 是与Python包一起安装的本地运行时管理器。这些是常规操作命令;使用 marm-memory <command> --help 查看标志和特定命令的示例。

日常运行时工作

marm-memory fast-start-http                # start HTTP, Console, and open the browser
marm-memory start                          # start or reuse the managed HTTP runtime
marm-memory start --profile swarm          # shared multi-agent preset
marm-memory stop                           # stop the managed runtime safely
marm-memory restart                        # restart the managed runtime
marm-memory status                         # inspect runtime, database, queue, and graph status
marm-memory logs --follow                  # follow bounded runtime logs
marm-memory console                        # start or reuse the bundled local Console

传输与设置

marm-memory http                           # run HTTP in the foreground
marm-memory stdio                          # run the strict local MCP STDIO transport
marm-memory init                           # install the MARM skill into detected agents (project scan)
marm-memory init --g-claude                # install the skill into the home-folder claude directory
marm-memory doctor                         # diagnose the local install
marm-memory key init                       # create or reuse ~/.marm/.env without displaying the key
marm-memory key path                       # print the managed key-file path
marm-memory key reveal                     # explicitly display the managed key
marm-memory console --import-key           # open an authenticated local Console session
marm-memory upgrade --check                # compare the installed package with PyPI
marm-memory uninstall                      # preview package removal; always preserves ~/.marm

知识、项目与维护

marm-memory knowledge status               # Indexers, models, and how far behind automatic indexing is
marm-memory knowledge build --all          # Rebuild the whole concept graph (new memories index themselves)
marm-memory knowledge auto off             # Stop indexing memories automatically (on, off, status)
marm-memory projects list                  # List all tracked workspaces
marm-memory projects index <path>          # Add a repo to the code graph (kept current after that)
marm-memory projects status                # Inspect target repo graph readiness
marm-memory projects auto off              # Stop re-indexing repos automatically (on, off, status)
marm-memory maintenance status             # Check internal database optimization state
marm-memory maintenance embeddings migrate # Upgrade old 384-dim vectors to 512-dim
marm-memory maintenance chunks rechunk     # Recalibrate long memory text splits

Docker命令在下面单独记录,因为它们需要显式的数据挂载、网络暴露和密钥处理选择。

性能与扩展基准测试

MARM 首先针对快速召回进行了优化,即使记忆增长且长记忆在后台被分块处理。

这些测量使用基于 fastembed 的 jinaai/jina-embeddings-v2-small-en 编码器和一个临时的本地SQLite数据库。每个计时路径都调用已发布的 MARMMemory 代码,而非基准测试本地的重新实现。第1-4节是 scripts/benchmarking/performance/bench_hotpath.py 在本地硬件上单次运行的时间;绝对毫秒数因机器而异,因此请将扩展形态视为信号。第5节是一个独立的准确性基准测试(run_eval.py),并报告了两次运行,原因见该处。

1. 检索延迟扩展

端到端 recall_similar 延迟(包括查询编码)。

会话大小 ($N$)

最小延迟

中位延迟

p95延迟

N = 100

7.4 毫秒

7.9 毫秒

9.4 毫秒

N = 250

11.9 毫秒

13.5 毫秒

15.4 毫秒

N = 500

10.9 毫秒

11.8 毫秒

13.4 毫秒

N = 1,000

13.3 毫秒

13.5 毫秒

15.6 毫秒

N = 2,000

17.5 毫秒

18.2 毫秒

19.6 毫秒

N = 4,000

23.8 毫秒

25.9 毫秒

30.9 毫秒

小 $N$ 时运行间的方差大于相邻大小之间的差距,这就是为什么 N = 250 的读取速度比 N = 500 慢。请将从 N = 1,000 开始的趋势视为真实信号。

2. 编码器 + 并发性

  • 冷模型加载: 893毫秒

  • 热编码: 中位数 3.8毫秒,p95 4.3毫秒

  • 并发召回: 10个聚集召回在 151.5毫秒 内完成,而串行为 176.0毫秒聚集/串行 = 0.86)。不要将其解读为并行性:同一基准测试的重复运行结果在 0.630.86 之间,因此该比率不够稳定,无法声称加速。该路径在设计上围绕共享编码器和SQLite工作进行了序列化,任何明显的增益都是测量噪声。

3. 写入时摄取成本

  • 合并关闭: 中位数 6.5毫秒,p95 7.6毫秒

  • 合并开启: 中位数 58.1毫秒,p95 106.5毫秒

  • 权衡: 写入时去重/聚类增加了 9.0倍 的中位成本,因此召回保持快速,且存储随时间推移保持更清洁。合并默认关闭。

4. 召回扩展:全扫描 vs 生产混合

为什么召回率在记忆增长时保持稳定:生产环境中的召回并非扫描每个向量,而是使用 FTS 关键词预过滤器来缩小候选池,然后通过混合语义 + BM25 + 时间分数进行重新排序。两个基准列均代表使用预计算向量计时的真实异步代码路径,以隔离检索速度与原始编码开销。测试交替执行以确保完全无偏的缓存条件。

会话大小 ($N$)

全语义扫描

生产混合

加速比

FTS 候选数

N = 100

3.3 ms

6.6 ms

0.5x

85 / 200

N = 500

16.3 ms

11.6 ms

1.4x

200 / 200

N = 1,000

31.1 ms

14.7 ms

2.1x

200 / 200

N = 2,000

63.5 ms

19.0 ms

3.3x

200 / 200

N = 4,000

127.2 ms

29.1 ms

4.4x

200 / 200

N = 10,000

316.7 ms

53.8 ms

5.9x

200 / 200

全扫描大致随 $N$ 线性增长,而混合召回增长慢得多,因此优势随会话大小进一步扩大。在非常小的 $N$ 下,预过滤器的开销不值得,混合召回反而更慢。

5. LoCoMo 检索准确率

所有 10 个 LoCoMo 对话通过 marm_log_entry 摄入(5,882 条记忆),然后对前 5 个 marm_smart_recall 结果针对 1,977 个带证据标注的问题进行评分。不使用答案生成模型或 LLM 评判器。

配置

命中任意证据

命中全部证据

平均证据召回率

MiniLM 基线

37.5%

29.5%

未发布

Jina v2 Small (v2.29.0)

53.0%

43.4%

47.6%

近期 (v2.33.1)

62.9 - 63.5%

53.1 - 53.5%

57.4 - 57.9%

性能提升归因于混合检索流水线和局部向量空间,确保高多跳召回准确率,无需依赖云托管的 LLM 评判器。使用 scripts/benchmarking/accuracy/locomo/run_eval.py 重现完整基准测试。

6. 与竞品对比:架构

MARM 针对特定细分领域:面向 MCP 连接的编码智能体的本地优先记忆,而非通用个性化记忆或完整的智能体运行时。以下是其在架构上与 AI 智能体记忆领域知名产品的区别:

MARM

Mem0

Letta (MemGPT)

Zep / Graphiti

agentmemory

类型

记忆引擎,MCP 原生

记忆层 API

完整智能体运行时

时序知识图谱

记忆引擎,MCP 原生

所需基础设施

无需独立数据服务(嵌入式 SQLite)

向量数据库 (Qdrant/pgvector)

Postgres + 向量数据库

Neo4j

独立的 iii-engine 运行时

部署

默认本地优先;Docker 用于共享/远程

云 API 或自托管

自托管或云

云或自托管

本地优先

检索模型

混合:FTS5 BM25 精确通道 + 语义重排序

向量 + 图 + 键值

向量归档存储 + 智能体管理的核心记忆

时序知识图谱(事实有效性窗口)

BM25 + 向量 + 图 (RRF 融合)

写入捕获

来自连接智能体的显式工具调用

显式 add() 调用(部分集成自动提取)

智能体自行编辑其记忆

显式 API 调用

基于钩子,自动(无需显式调用)

代码结构感知

捆绑的代码图 + 概念图,与记忆融合

未内置

未内置

未内置

未内置(与独立项目配对)

框架锁定

无(任何 MCP 客户端)

高(必须在 Letta 内运行)

无(任何 MCP 客户端)

免责声明与准确性: 竞品格局变化迅速。上表反映了截至 2026 年第三季度基于公开文档和 README 的核心架构特征,并非对每个系统的内部测试。如果关于其他框架的任何数据点已更改或被错误表述,请提交 Issue 或 Pull Request 以更新表格。我们积极欢迎来自同行维护者的更正。

MCP 客户端设置:HTTP 与 STDIO

手动 pip 安装

pip install marm-mcp-server

使用此快速经验法则选择设置

  • 本地 HTTP/STDIO = 最快的单机设置。

  • Docker HTTP = 共享/始终在线服务器(需要密钥)。

  • Docker STDIO = 私有容器化本地使用(无需 HTTP 密钥)。

集群/多智能体说明: 写入队列默认启用,以通过一个工作线程序列化记忆写入。对于共享 HTTP 部署,使用 marm-memory start --profile swarm(200 RPM)或 --profile swarm-max(600 RPM)。--profile trusted 为私有部署禁用速率限制。STDIO 仍然是私有单智能体/本地使用的最佳选择。参见集群与多智能体预设获取完整表格。

“agent” 指 claude, gemini, grok, qwen 或任何 MCP 客户端。Codex 使用 --url 而非 --transport 来添加 MCP 工具。

pip install marm-mcp-server
marm-memory start
# Stuck on client setup? Open a Q&A thread: https://github.com/Lyellr88/marm-memory/discussions
# most agents use this --transport command
"agent" mcp add --transport http marm-memory http://localhost:8001/mcp
codex mcp add marm-memory --url http://localhost:8001/mcp

默认 pip/本地启动为零配置:MARM 绑定到 localhost,除非使用 SERVER_HOST=0.0.0.0 暴露,否则不需要密钥。

pip install marm-mcp-server
python -m marm_mcp_server.server_stdio
# most agents use this --transport command
"agent" mcp add --transport stdio marm-memory-stdio marm-mcp-stdio
codex mcp add marm-memory-stdio -- marm-mcp-stdio

如果使用虚拟环境或基于路径的设置,将 marm-mcp-stdio 替换为 python -m marm_mcp_server.server_stdio。适用于 Claude Code, Cursor, VS Code, Qwen 和 Gemini CLI。STDIO 保持为单个本地进程,无需端口和 API 密钥,并暴露与 HTTP 相同的 14 个工具。

当多个智能体需要共享一个实时 MARM 服务器时使用 HTTP。STDIO 仍然是私有单智能体使用的最佳选择,因为每个客户端拥有自己的本地进程。

# HTTP shared server, normal multi-agent use
marm-memory start --profile swarm

# HTTP shared server, heavier private swarm
marm-memory start --profile swarm-max

# HTTP trusted private lab/server, rate limiting disabled
marm-memory start --profile trusted

# STDIO remains keyless/private and does not use swarm flags
marm-mcp-stdio

Docker HTTP 需要 API 密钥,因为它将 MARM 暴露为网络服务器;STDIO 保持本地客户端进程,不需要密钥。

如果您通过 pip 安装了 MARM,产品 CLI 可以安全地预览或运行相同的设置。它默认使用回环端口,保留 ~/.marm,将生成的密钥存储在 ~/.marm/.env 而非 shell 历史中,并拒绝替换现有容器。

marm-memory docker command                 # preview the exact HTTP command
marm-memory docker run                     # create the managed HTTP container
marm-memory docker stdio-command           # print a Docker STDIO client command
marm-memory docker status
marm-memory docker logs --follow
marm-memory docker stop

# Optional: mount repositories read-only for code indexing.
marm-memory docker run --repo /absolute/path/to/repository

# Optional: preview or explicitly write a Compose configuration.
marm-memory docker compose
marm-memory docker compose --yes

HTTP 的 runcommandcompose 命令接受相同的操作标志:

标志

用途

--data-dir <绝对路径>

持久化主机目录,挂载到 /home/marm/.marm。默认为 ~/.marm;存储记忆、索引、日志和管理的密钥文件。

--env-file <路径>

显式 Docker 环境文件。必须已包含 MARM_API_KEY;无此标志时,MARM 使用 ~/.marm/.env,并仅在 docker rundocker compose --yes 需要时创建密钥。

--port <数字>

主机 HTTP 端口。默认:8001

--expose-network

将主机端口绑定到 0.0.0.0 而非回环。这是有意的网络暴露;请配置防火墙和 TLS 代理。

`--profile standard

swarm

swarm-max

trusted`

选择与原生 HTTP 启动相同的写入队列和速率限制预设。

--rate-limit-rpm <数字>

覆盖所选配置文件的 HTTP 速率限制。0 禁用速率限制。

--repo <绝对路径>

可重复的只读仓库挂载,用于代码索引。MARM 报告容器内每个对应的 /workspace/repo-N 路径以供索引。

--tag <标签>

官方镜像标签。默认:latest

--pull

在创建新 HTTP 容器前拉取所选镜像。

--name <名称>

管理的容器名称。MARM 拒绝替换具有该名称的现有容器。

--memory <限制> / --cpus <限制>

可选的 Docker 资源限制。

--dry-run

docker run 仅:打印计划命令而不创建容器或密钥文件。docker command 始终是预览。

例如:

# Shared local server with a custom data path and two repositories for indexing.
marm-memory docker command \
  --profile swarm \
  --data-dir /srv/marm-data \
  --repo /srv/projects/api \
  --repo /srv/projects/web

# Execute the reviewed command, pulling the image first.
marm-memory docker run --profile swarm --data-dir /srv/marm-data --pull

Docker STDIO 与 Docker HTTP 是分开的:marm-memory docker stdio-command 使用 docker run -i --rm,没有端口和 bearer 密钥,但仍会挂载数据目录,以便 SQLite 内存数据在短生命周期容器退出后持久化。需要时,可对该命令使用 --data-dir--tag。没有单独的 docker keydocker mount 命令;--env-file--data-dir 使这些选择在生成的 HTTP 命令中显式化。

marm-memory docker pull 仅下载镜像。marm-memory docker maintenance embeddings migrate 针对同一数据挂载运行,并在托管 HTTP 容器运行时拒绝执行。该辅助工具仅适用于通过 pip 安装的 marm-memory 命令;仅使用 Docker 的用户可以使用下面的原始命令。

# Step 1: generate key (do not add < > around the key)
docker run --rm lyellr88/marm-mcp-server:latest --generate-key

# Step 2: run server
docker pull lyellr88/marm-mcp-server:latest
docker run -d --name marm-mcp-server \
  -p 127.0.0.1:8001:8001 \
  -e SERVER_HOST=0.0.0.0 \
  -e MARM_API_KEY=your-generated-key \
  -v ~/.marm:/home/marm/.marm \
  lyellr88/marm-mcp-server:latest

# Step 3: connect client
"agent" mcp add --transport http marm-memory http://localhost:8001/mcp --header "Authorization: Bearer your-generated-key"

# PowerShell: set this before starting/restarting Codex
$env:MARM_API_KEY="your-generated-key"
codex mcp add marm-memory --url http://localhost:8001/mcp --bearer-token-env-var MARM_API_KEY

# Quick auth smoke test
curl -i -H "Authorization: Bearer $env:MARM_API_KEY" http://127.0.0.1:8001/mcp

--bearer-token-env-var 接受环境变量名,而非原始密钥。在设置 $env:MARM_API_KEY 后,从同一 shell 启动或重启 Codex。对于本地 Docker 冒烟测试,MARM_API_KEY=test 即可,并可避免 shell 转义问题;实际部署请使用生成的密钥。冒烟测试 GET /mcp 返回 406 Not Acceptable 表示认证已到达 MCP 端点;401 Unauthorized 表示密钥缺失或不匹配。

# --swarm: write queue on, 200 RPM - recommended for multi-agent shared servers
docker run -d --name marm-mcp-server \
  -p 127.0.0.1:8001:8001 \
  -e SERVER_HOST=0.0.0.0 \
  -e MARM_API_KEY=your-generated-key \
  -v ~/.marm:/home/marm/.marm \
  lyellr88/marm-mcp-server:latest --swarm

Docker 图谱工具在容器内运行,因此除非在 docker run 时挂载,否则无法看到主机路径。

$env:MARM_API_KEY="test"

# The second -v line mounts your repo; adjust the host path to your project
docker run -d --name marm-mcp-server `
  -p 127.0.0.1:8001:8001 `
  -e SERVER_HOST=0.0.0.0 `
  -e MARM_API_KEY=$env:MARM_API_KEY `
  -v ~/.marm:/home/marm/.marm `
  -v C:\Users\lyell\Desktop\marm-memory:/workspace/marm-memory `
  lyellr88/marm-mcp-server:latest

然后索引容器路径,而非 Windows 主机路径:

marm_graph_index(repo_path="/workspace/marm-memory")

图谱工具必须使用容器路径。无法向已运行的容器添加挂载;当需要 Docker 图谱索引时,请停止并重启容器并挂载仓库。

Docker STDIO 包含相同的内置 marm-graph 工具;无需额外镜像或安装步骤。

docker run --rm -i \
  -v ~/.marm:/home/marm/.marm \
  --entrypoint python \
  lyellr88/marm-mcp-server:latest \
  -m marm_mcp_server.server_stdio

  • Docker HTTP 需要密钥;Docker STDIO 不需要。

  • 如果收到 401,请验证密钥匹配以及环境变量更改后客户端重启。

  • 关于完整密钥设置、轮换和故障排除:请参阅 INSTALL-DOCKER.md

连接你的客户端

启动服务器(python -m marm_mcp_server),然后按下方配置你的客户端。每个代码块均假设默认本地安装(无密钥)。对于 Docker 或暴露的服务器,请添加每个客户端可折叠部分中显示的 Authorization: Bearer 标头。

claude mcp add --transport http marm-memory http://localhost:8001/mcp

Claude Code 通过 claude mcp add 支持 HTTP、SSE 和 STDIO;对于 MARM 请使用 HTTP。对于 STDIO:claude mcp add --transport stdio marm-memory-stdio marm-mcp-stdio

在工作区的 .vscode/mcp.json 中添加。对于直接 Python 安装,使用 marm-memory-local;对于 Docker 或暴露/密钥模式,使用 marm-memory-docker

{
  "inputs": [
    {
      "type": "promptString",
      "id": "marm-api-key",
      "description": "MARM API Key for Docker or exposed server mode",
      "password": true
    }
  ],
  "servers": {
    "marm-memory-local": {
      "type": "http",
      "url": "http://localhost:8001/mcp"
    },
    "marm-memory-docker": {
      "type": "http",
      "url": "http://localhost:8001/mcp",
      "headers": {
        "Authorization": "Bearer ${input:marm-api-key}"
      }
    }
  }
}

打开 .vscode/mcp.json,点击所需服务器上方的 启动,然后使用 Copilot Agent 或任何使用 VS Code 原生 MCP 注册表的扩展。

在工作区的 .cursor/mcp.json 中添加。Cursor 使用 mcpServers,而非 VS Code 的 servers 根。

{
  "mcpServers": {
    "marm-memory-local": {
      "type": "http",
      "url": "http://localhost:8001/mcp"
    },
    "marm-memory-docker": {
      "type": "http",
      "url": "http://localhost:8001/mcp",
      "headers": {
        "Authorization": "Bearer ${env:MARM_API_KEY}"
      }
    }
  }
}

对于 Docker/密钥模式,请在环境中设置 MARM_API_KEY 后启动 Cursor。

Codex 使用 codex mcp add 或位于 ~/.codex/config.toml(Windows 上为 %USERPROFILE%\.codex\config.toml)的 TOML 配置。

# Direct Python install - no key needed
codex mcp add marm-memory --url http://localhost:8001/mcp

# Docker or SERVER_HOST=0.0.0.0 - key required (set MARM_API_KEY in your shell first)
codex mcp add marm-memory --url http://localhost:8001/mcp --bearer-token-env-var MARM_API_KEY
[mcp_servers."marm-memory"]
url = "http://localhost:8001/mcp"
enabled = true
bearer_token_env_var = "MARM_API_KEY"
# Direct Python install - no key needed
gemini mcp add --transport http marm-memory http://localhost:8001/mcp

# Docker or SERVER_HOST=0.0.0.0 - key required
gemini mcp add --transport http marm-memory http://localhost:8001/mcp --header "Authorization: Bearer your-generated-key"

等效的 ~/.gemini/settings.json(用户范围)或项目 .gemini/settings.json

{
  "mcpServers": {
    "marm-memory": {
      "httpUrl": "http://localhost:8001/mcp",
      "headers": {
        "Authorization": "Bearer your-generated-key"
      }
    }
  }
}
# Direct Python install - no key needed
qwen mcp add --transport http marm-memory http://localhost:8001/mcp

# Docker or SERVER_HOST=0.0.0.0 - key required
qwen mcp add --transport http marm-memory http://localhost:8001/mcp --header "Authorization: Bearer your-generated-key"

等效的 .qwen/settings.json(项目)或 ~/.qwen/settings.json(用户):

{
  "mcpServers": {
    "marm-memory": {
      "httpUrl": "http://localhost:8001/mcp",
      "headers": {
        "Authorization": "Bearer your-generated-key"
      }
    }
  }
}

xAI 从其自身基础设施连接,因此 localhost 将无法工作。请将 MARM 暴露在 HTTPS 之后并设置 MARM_API_KEY

{
  "type": "mcp",
  "server_url": "https://your-marm-domain.example.com/mcp",
  "server_label": "marm-memory",
  "authorization": "Bearer your-generated-key"
}

完整平台指南、密钥设置和操作系统特定说明:Windows · macOS · Linux · Docker/密钥模式 · 其他平台

使用的客户端未列出?提交 issue 告诉我们;客户端适配器是一级功能请求。

要求

  • Python:3.10 或更高版本

  • SQLite3:随 Python 包含(无需单独安装)

  • 存储:初始设置约需 100MB,随内存数据库大小扩展

  • 内存:最低 512MB(因并发客户端和数据库大小而异)

  • 操作系统:Windows、macOS、Linux

数据位置

  • 位置~/.marm/(Linux/macOS)或 %USERPROFILE%\.marm\(Windows)

  • 内容:包含所有记忆、会话和笔记本的 SQLite 数据库;概念图谱位于其自己的 ~/.marm/index/ 数据库中

  • 备份:复制整个 ~/.marm/ 目录以保留所有数据

  • 隐私:所有内容保留在你的机器上,无云同步或外部存储

验证安装

使用 MCP 服务器健康端点进行最快的实时检查:

curl http://localhost:8001/health

预期输出包括服务器版本、功能可用性(语义搜索状态)、数据库连接状态和服务健康状态。

完整 MCP 工具套件(14 个工具)

💡 专业提示: 你无需手动调用这些工具!只需用自然语言告诉你的 AI 代理你想要什么:

  • "Claude,将会话记录为 'Project Alpha',并将此对话添加为 '数据库设计讨论'"

  • "将此代码片段记入你的笔记本以备后用"

  • "搜索我们昨天讨论的关于身份验证的内容"

AI 代理将自动使用适当的工具。高级用户可手动访问工具以获得直接控制。

🧠 核心记忆(7 个工具)

工具

功能

关键参数

marm_smart_recall

混合记忆召回,当存在兼容图谱时,附带一个可添加、有界的概念/代码图谱侧车

query, limit, session_name, search_all, detail=1/2/3, project, platform, exact_mode

marm_log_entry

添加结构化会话日志条目;每个条目也会嵌入语义记忆,以便 marm_smart_recall 能够找到

entry, session_name

marm_log_show

显示所有条目和会话,支持过滤

session_name

marm_delete

删除日志会话、日志条目或笔记本条目

type, target, session_name, project, platform

marm_summary

缓存、可粘贴的会话摘要,具有智能截断功能

session_name

marm_notebook

会话范围的草稿本,并可提升为永久、图谱链接的文档

`action="add"

"use"

"show"

"status"

"clear"

"save", name, data, session_name, project, platform`

marm_compaction

代理辅助的记忆清理,带有可审查的审计跟踪

`action="status"

"candidates"

"review"

"stage"

"apply"

"discard"`

🕸️ 代码图谱(5 个工具)

工具

功能

关键参数

marm_graph_index

将仓库索引到代码结构图谱中,检查状态,列出项目,或打开/关闭自动重新索引

repo_path, project, action

marm_code_lookup

查找符号、文本模式或符号的源代码;替代 grep/glob 使用

`kind="auto"

"symbol"

"text"

"snippet"`

marm_graph_trace

从函数追踪调用路径和数据流

direction, mode

marm_graph_architecture

架构概览:模块、节点/边分解、模式

project

marm_graph_impact

代码更改的影响范围:git diff → 受影响的符号 + 风险

since, base_branch, depth

🧩 概念图谱(2 个工具)

工具

功能

关键参数

marm_concept_build

重建图谱,或索引自动索引之前存储的记忆。新记忆会自动索引

session_name, project, 或 search_all=True(三者选一)

marm_concept_recall

显式查询实体、关系和链接的代码符号

query, depth (1-5), direction, project, platform

所有 14 个工具在 HTTP 和 STDIO 上均可用。在工具表面之下,服务器自动处理生命周期设置、协议刷新、文档索引、日期上下文、摘要缓存维护、写入队列处理、概念索引、仓库变更时的代码重新索引、项目/平台归属和健康检查;这些都不会消耗代理的注意力或令牌。两个图谱引擎在首次使用时惰性启动,如果启动失败,绝不会阻塞 7 个核心记忆工具。有关机制,请参阅 架构与内部原理

使用 MARM:对话,而非调用工具

MARM 内部处理生命周期工作。文档和会话状态在首次实际工具调用时初始化,打包的文档通过源文件哈希追踪索引到 marm_system 记忆命名空间中,因此你的代理可以从记忆本身回答 MARM 使用问题。

示例工作流:跨 AI 研究项目

一个展示 MARM 实际应用的真实工作流。场景: 你正在使用多个 AI 客户端为一个新项目研究身份验证模式。

阶段 1:路由会话(Claude)

You: "Claude, create a MARM session called 'auth-research-2025-01'"
Claude calls: marm_log_entry(entry="Session: auth-research")
Result: Session routed to auth-research-[today]. MARM lifecycle/docs initialize automatically.

阶段 2:捕获研究(Claude)

You: "Summarize OAuth2 vs JWT for API authentication and save it"
Claude calls: marm_log_entry(entry="Research: OAuth2 is token-based with refresh cycles, better for delegated access. JWT is stateless, good for microservices...", session_name="auth-research-2025-01")
Result: Research captured in the active session log and marked for summary-cache refresh

阶段 3:添加可复用参考(Claude)

You: "Save a JWT validation code snippet to my notebooks as 'jwt-validation-pattern'"
Claude calls: marm_notebook(action="add", name="jwt-validation-pattern", data="def verify_jwt(token):\n  # validation logic...")
Result: Reusable snippet stored for future projects

阶段 4:回忆上下文(Gemini)

You: "Gemini, what authentication approaches did we research? Activate the JWT pattern."
Gemini calls: marm_smart_recall("authentication patterns", search_all=True)
Gemini calls: marm_notebook(action="use", names="jwt-validation-pattern")
Result: Gemini sees previous research + has JWT code available as context

阶段 5:综合与总结(Qwen)

You: "Qwen, pull everything from the auth research and create a summary"
Qwen calls: marm_smart_recall("authentication", session_name="auth-research-2025-01", limit=20)
Qwen calls: marm_summary(session_name="auth-research-2025-01")
Result: Qwen generates an implementation guide from all captured research

阶段 6:结束会话(Claude)

You: "Log final decision - we're using JWT for APIs, and OAuth2 for user auth"
Claude calls: marm_log_entry(entry="DECISION: JWT for API auth, OAuth2 for user flows. Rationale: stateless APIs + delegated user access", session_name="auth-research-2025-01")
Result: Decision logged and searchable by all future AI clients

结果:三个不同的 AI 客户端协作研究了一个主题,分享了见解,并记录了决策。整个过程无需向每个新 AI 重新解释项目。

高级模式

Project Structure:
├── project-name-planning/          # Initial design and requirements
├── project-name-development/       # Implementation details
├── project-name-testing/           # QA and debugging notes
├── project-name-deployment/        # Production deployment
└── project-name-retrospective/     # Lessons learned

知识库循环:

  1. 捕获:使用 marm_log_entry 记录结构化的会话学习成果

  2. 组织:为知识领域创建主题会话

  3. 综合:定期使用 marm_summary 进行知识整合

  4. 应用:将摘要转换为 marm_notebook(action="add", ...) 条目

多 AI 协作:每个 AI 在专门的会话中发挥其优势,使用 marm_smart_recall 基于其他 AI 的工作进行构建,然后通过协作会话整合见解。

  • 会话命名:包含 LLM 名称以便交叉引用

  • 策略性日志记录:聚焦关键决策、解决方案、发现、配置

  • 全局搜索:使用 search_all=True 跨所有会话搜索

  • 自然语言搜索:"JWT 令牌的身份验证问题"优于"auth error"

  • 分层回忆深度detail=1 返回简短摘要视图(约 200 字符),detail=2 返回较大上下文视图(约 500 字符),detail=3 返回完整记忆内容

  • 笔记本堆叠:为复杂工作流组合多个条目

  • 压缩:让 MARM 呈现压缩候选,然后使用 marm_compaction 进行暂存、审查、应用或丢弃摘要

  • 会话生命周期:开始 → 工作 → 参考 → 当 MARM 提示时审查暂存的压缩

理解 MARM 记忆

两种搜索,两个截然不同的问题,一个工具:

User: "I discussed machine learning algorithms yesterday"
MARM Search: Finds related memories about "ML models", "neural networks", "AI training"

User: "What was the COMPACTION_TRIGGER_COUNT setting?"
MARM Search: Finds the exact config memory even if the rest of the text differs

第一个查询关乎含义,因此 MARM 使用本地向量嵌入对候选进行重新排序——无需托管向量数据库的 RAG 风格语义搜索。第二个查询是语法形状(一个配置键),因此 MARM 自动检测到这一点,并将其路由到确定性精确匹配。这个精确检索通道是记忆系统在演示中有效与能够回答开发者实际提出的问题(配置键、CLI 标志、文件路径、API 名称、错误字符串)之间的区别。纯语义记忆系统恰恰在这些查询上失败。

MARM 使用过滤→重新排序混合回忆加上一个精确检索通道:

  1. 精确通道exact_mode="auto",默认):配置键、CLI 标志、文件路径、API/工具名称、点分命名空间、HTTP 路由、URL 和引用的命令字符串被检测到并路由到确定性 FTS5 BM25,并带有 LIKE 回退。不涉及嵌入,因此结果稳定且字面匹配。

  2. 过滤→重新排序通道:自然语言查询首先从 FTS 索引中拉取一个有界的候选集(FTS_CANDIDATE_LIMIT,默认 200),然后语义嵌入根据含义对这些候选进行重新排序。保守的时间加权在匹配接近时给较新的记忆适度的提升。

  3. 有界语义回退:当 FTS 覆盖较弱或不可用时,MARM 回退到有界语义扫描(RECALL_SCAN_LIMIT)。如果响应包含 recall_scan_truncated=true,则回退达到了上限;缩小会话/查询范围或为更大的存储提高环境变量。

  4. 块感知评分:长记忆(大约 180 词以上)在内部被嵌入为重叠的块行,回忆使用最佳匹配块将块分数折叠回一个父记忆。重新排序通道和回退通道都是块感知的。

这就是为什么随着存储增长,回忆延迟几乎保持平坦(参见基准测试):语义重新排序始终对一个有界集进行评分,而不是扫描每个嵌入。

精确回忆控制exact_mode="auto" 通常是正确的。当查询必须匹配字面文本如 RECALL_SCAN_LIMIT--generate-keysettings.py 时,使用 exact_mode="exact"。当语法上看起来像查询但仍应被视为基于含义的回忆时,使用 exact_mode="semantic"

记忆类型与分类

  1. 上下文日志 - 自动分类的对话记忆

  2. 手动条目 - 显式保存的重要信息

  3. 笔记本条目 - 可复用的指令和知识

  4. 会话摘要 - 压缩的对话历史

MARM 在写入时自动对内容进行分类:代码(编程片段和技术讨论)、项目(工作对话和规划)、书籍(文学、学习材料、研究)和通用(其他所有内容)。

项目与平台归属

MARM 在记忆、日志条目和笔记本条目上存储可空的 projectplatform 列。项目从工作目录检测,平台从连接客户端(Claude Code、VS Code、Cursor 等)检测;MARM_PROJECTMARM_PLATFORM 覆盖检测。marm_smart_recall(project=..., platform=...) 限定回忆范围而不改变默认的未过滤行为,因此一个共享服务器可以容纳多个项目而不会交叉污染。

知识图谱:代码与概念

MARM 附带两个补充记忆存储的图系统:一个代码图,理解你的仓库结构;一个概念图,理解你存储的记忆是关于什么的。当两者为同一项目建立索引时,概念实体交叉链接到代码符号。

代码图:仓库索引与代码查找

marm-graph 捆绑到两种传输方式中。它一次性索引一个仓库,然后让代理能够提出代码结构问题,而无需重复扫描文件:

Use marm_graph_index to index this repository.
Then use marm_code_lookup when you need symbols, files, or source snippets.
Use marm_graph_trace for call paths, marm_graph_architecture for an overview, and marm_graph_impact for change-risk checks.

推荐的代理工作流:索引一次,然后在广泛的文件读取之前使用 marm_code_lookup,当调用者/被调用者或数据流上下文重要时使用 marm_graph_trace,用于方向定位时使用 marm_graph_architecture,在风险重构之前使用 marm_graph_impact。一个图查询替代了数十次 grep/read 循环,这就是节省令牌的地方。

一旦仓库被索引,MARM 会自动保持其最新。一个后台轮询器注意到仓库何时发生变化并重新索引它,因此提交后无需手动重新索引。当你有未提交的工作时,它每个周期刷新一次,因为没有廉价的检查能够看到对已修改文件的重复编辑。要仅在请求时索引:

marm-mcp-server projects auto off

代理可以使用 marm_graph_index(action="auto_off") 做同样的事情,action="auto_status" 报告正在监视什么以及每个项目上次索引的时间。该开关在重启后持续存在,并覆盖 GRAPH_AUTO_INDEX 环境变量。

在底层,引擎是 codebase-memory-mcp(MIT),一个零依赖的静态二进制文件,通过 tree-sitter 解析 158 种语言,并对主要语言进行混合 LSP 类型解析,平均在几秒内索引一个仓库,并在远低于一秒的时间内回答符号搜索和调用跟踪。在 MARM 持有的持久连接上对 149,107 个节点的图进行测量:符号搜索 146ms,调用跟踪 67ms,完整架构概览 1.23s,这是唯一一个非亚秒的查询。MARM 固定一个特定版本,在启动时验证其工具模式,并将上游工具集路由到 5 个聚焦的 MCP 工具,以保持模型表面较小。图后端在首次使用图工具时惰性启动,因此记忆、日志、笔记本和摘要工具仍然快速启动。在 Docker 中,引擎二进制文件被烘焙到镜像中;本地 pip 安装会在首次使用图时获取它(约 269MB,一次性)。

降级模式:如果图引擎无法启动(首次运行下载无网络、磁盘满、模式漂移)或设置了 GRAPH_ENABLED=false,图工具返回 {"status": "error", "message": "graph backend unavailable"},而其他 9 个工具继续正常工作。图故障永远不会导致记忆系统宕机。

概念图:你的记忆是关于什么的

MARM 从你存储的记忆中提取知识图谱,生成类型化实体(概念、决策、模式、错误、工具、人员、组织),由类型化关系(修复、实现、依赖、使用、导致、替换、扩展)连接。这是自动发生的:存储一个记忆会将其排队,后台工作器大约 30 秒后将其添加到图中。marm_concept_build 仍然可用于完整或限定范围的重建。一旦有了图,marm_smart_recall 会添加有界的相关实体、关系和链接代码作为 graph_context 侧车,而不改变主要记忆排名。marm_concept_recall 仍然可用于显式的图探索:

marm_concept_recall(query="write queue")            → the entity, its relationships, linked code symbols
marm_concept_recall(query="related to SQLite", depth=3) → multi-hop traversal of everything connected

如何使用它:

  • 默认自动:新记忆无需工具调用即可进入图谱。设置 CONCEPT_AUTO_INDEX=false 可恢复为仅手动构建,这会停止工作进程但保留队列记录,因此重新开启时会拾取关闭期间写入的所有内容;CONCEPT_INDEX_DEBOUNCE_SECONDS(30)和 CONCEPT_INDEX_BATCH_SIZE(20)控制处理节奏。

  • 同时安全运行于两种传输方式:内存数据库中的租约锁可防止一个进程在重建时删除图谱表,而另一个进程正在写入。发现图谱繁忙的构建会提示而非冲突。

  • 故障永不触及记忆:索引在写入路径之外的可持久队列上运行。提取问题会重试,反复失败的记忆会被暂停并附带错误信息,而记忆本身在存储和召回时始终正常。

  • 清除积压会牺牲部分召回速度:实体提取是CPU密集型操作,因此当工作进程处理队列时,在真实768条记忆语料库上,实测召回中位数从约8ms变为约16ms。写入不受影响。仅在积压排空期间生效,对大多数人来说,升级重建后仅发生一次。可通过 scripts/benchmarking/performance/bench_concept_worker.py --from-live 复现。

  • 为积压构建:限定于 session_nameprojectsearch_all=Truemarm_concept_build 会索引自动索引功能出现之前存储的记忆,并在需要重建的升级后重建。

  • 至今已升级两次:在平台归属功能之前,或压缩源替换摘要作为索引行之前构建的图谱,需要 marm_concept_build(search_all=True)。完整构建会备份并仅重置派生概念数据库;定向构建会拒绝猜测平台所有权。

  • 全范围分页:构建会读取范围内的所有记忆。CONCEPT_BUILD_ROW_CAP(默认500)是页面大小,因此降低该值会使构建读取更多、更小的页面,而非跳过剩余部分。

  • 压缩会话:原始记忆被索引,生成的摘要不被索引,因此概念仍归属于其实际陈述的位置。

  • 召回故障开放:缺失、为空、不兼容或不可用的概念图谱永远不会阻止正常记忆召回。响应会单独报告图谱状态。

  • 代码交叉链接:当代码图谱已索引同一项目时,与代码符号匹配的概念实体会被链接,将“我们决定的内容”与“代码中的位置”连接起来。

  • 捆绑提取运行时:spaCy运行时和英文提取模型随MARM一起提供,但仅在首次提取时加载,现在首次提取发生在第一条记忆存储后不久,而非运行构建时。如果安装损坏或不完整导致它们不可用,两个概念工具会优雅降级,而核心记忆仍可用;运行 marm-memory knowledge status,然后根据需要重新安装MARM。

  • 隔离存储:概念图谱位于自己的SQLite数据库(~/.marm/index/marm_index.db)中,拥有自己的连接池,因此概念图谱写入永远不会阻塞或损坏生产记忆数据库。

  • 控制台图谱:MARM控制台可渲染最多750个实体和6,000条存储关系的完整图谱。更大的图谱使用确定性连接的样本,最多600个实体和4,000条聚合视觉边,并清晰标注为采样。

这填补了平面记忆搜索留下的跨会话结构空白:会话组织记忆,但概念图谱连接它们,因此“什么依赖于写入队列?”这个问题即使答案跨越来自三个不同代理的五个会话也能回答。

架构与内部机制

以上所有功能都建立在少量精心设计的机制之上。本节提供完整地图,因此您(或您的代理)无需猜测服务器正在做什么。

存储引擎

  • WAL模式下的SQLite,位于 ~/.marm/marm_memory.db,带有连接池(5个连接)。WAL确保写入期间读取不被阻塞,这在多个代理写入时一个代理召回时很重要。

  • FTS5全文索引memories_fts)作为记忆表的外部内容表维护,为精确通道(BM25)和混合召回的过滤阶段提供支持。

  • 分块存储:超过约180个单词的记忆被分割为重叠的150个令牌块(50个令牌重叠),存储在 memory_chunks 表中,每个块有自己的嵌入。召回时对块进行评分并折叠到父记忆。

  • 嵌入来自fastembed支持的 jinaai/jina-embeddings-v2-small-en 编码器:3300万参数,512维,8192个令牌上下文窗口,Apache-2.0许可证。不需要单独的查询/文档文本前缀。编码器在首次语义使用时延迟加载,并在锁后序列化,以防止并发编码相互破坏。如果不可用,写入仍成功;记忆在编码器加载前无嵌入存储。语义评分作为单个NumPy批处理(矩阵余弦)运行,而非Python循环。

  • 概念图谱拥有自己的数据库~/.marm/index/marm_index.db)和自己的连接池,重用相同的池实现,但从不与记忆存储共享连接。刻意隔离:实验性图谱构建绝不能拖慢生产WAL。唯一的例外是指引队列,它故意位于记忆数据库中,以便记忆及其索引任务一起提交;图谱本身保持派生和可丢弃。

写入路径

  • 序列化写入队列(默认启用):所有记忆写入通过一个内部异步工作进程流动,消除了多代理负载下的SQLite写入器争用。队列是通用的;压缩应用也通过同一工作进程,因此无论哪个子系统写入,都只有一个写入器。MAX_QUEUE_SIZE 限制其大小。

  • 写入时合并(可选,CONSOLIDATION_ENABLED=1)在记忆落地前运行两层:

    • 第1层,精确去重:在会话内检查标准化内容的SHA-256哈希;哈希命中后与实际内容验证,然后去重,因此哈希冲突会存储新行而非静默合并不同内容。

    • 第2层,语义合并:高于 CONSOLIDATION_THRESHOLD 余弦相似度的近似重复会被合并而非累积。这从不阻塞写入;如果编码器不可用,写入会未经合并继续。

    • 权衡已测量并公布:中位数写入成本约9倍(58ms vs 6.5ms),但换来存储的整洁,因为读取主导记忆工作负载。请参见上述基准测试第3节。

  • 概念索引是持久化发件箱:写入在与记忆相同的事务中记录索引任务,因此记忆不能没有任务。后台工作进程排空该队列并写入概念图谱。写入路径上没有任何内容等待提取,且进程在提取中途被杀死不会丢失工作,因为任务是行而非内存作业。两种传输方式都运行工作进程,因此它们通过记忆数据库中的租约锁协调,而非进程内锁(后者无法跨越它们)。

  • 压缩(可选,COMPACTION_ENABLED=1)是第3层:在会话中足够多的写入后,后台过程使用余弦相似度加并查集连通分量检测相关记忆簇,受最小簇大小、最小年龄和活跃会话宽限期限制,因此永远不会压缩进行中的工作。然后MARM注入一个有限请求,要求连接的代理总结每个簇:candidatesstagereviewapplydiscard。应用时保留源记忆ID,因此压缩摘要可追溯到原始内容。暂存摘要会过期(COMPACTION_STAGING_TTL_HOURS),提示次数有限且冷却限制,注入有字节预算。设计诚实地说明了LLM的用途:MARM检测,代理总结,人类可审查的阶段/应用/丢弃循环控制破坏性步骤。

召回路径

已在理解MARM记忆中介绍:精确通道(FTS5 BM25 + LIKE回退)、过滤→重排序(有限FTS候选→批处理语义重排序→时间混合)、有限语义回退并带有显式截断标志,以及分块折叠评分。召回深度(detail=1/2/3)控制返回每个记忆的多少,每个MCP响应都通过1MB响应限制器,智能截断内容而非破坏协议。

代码图谱子进程协议

捆绑的图谱引擎作为受监督的子进程运行,而非导入:

  • 传输:通过子进程stdio的换行分隔JSON-RPC 2.0,带有验证握手(initialize → 捕获服务器版本 → initialized通知)。

  • 信封处理:扫描响应以查找第一个可JSON解析的内容项,而非假设索引0,因为上游二进制文件可能预先添加更新通知。工具错误以 result.isError 而非JSON-RPC错误形式到达,并转换为干净的 {"status": "error"} 字典,附带上游自己的修复提示。

  • 序列化:一个锁保护单个stdin管道上的每次写入+读取往返;异步调用者通过 asyncio.to_thread 进行,因此事件循环永远不会在子进程IO上阻塞。

  • 崩溃恢复:stderr在后台线程上排空,检测到子进程EOF/崩溃,并在下次调用时透明地重新生成进程。超时故意视为崩溃;长时间索引运行可能仍在工作,杀死它会破坏进行中的工作。

  • 监督:惰性单例监督者拥有进程生命周期的客户端。启动由首次图谱工具调用或自动索引轮询器触发(如果引擎二进制文件已下载),从不引发到MCP层,并验证固定二进制文件的工具模式,以便上游漂移在启动时而非调用中被捕获。

  • 自动重新索引是git签名轮询,而非文件系统监视:后台任务比较每个索引仓库的 HEAD 和脏状态,通过在引擎外部运行 git 计算,因此空闲检查不消耗引擎锁。提交触发重新索引。当树脏时,仓库在每个周期重新索引,因为 git status 报告哪些文件更改而非内容,因此对已修改文件的重复编辑会产生字节相同的输出,没有更便宜的指纹可以区分。Git以禁用 core.fsmonitor 和清理环境的方式运行,因为该设置命名了一个程序,git会从被监视的仓库中按定时器执行。

  • 每个存储变更的单一门控:所有三个表面上的手动索引、轮询器和项目删除都通过记忆数据库中的单个租约行。HTTP和STDIO是独立的进程,拥有独立的引擎子进程,共享一个引擎存储,因此进程内锁无法跨越它们。当引擎调用实际返回时,租约被释放,而非调用者停止等待时:取消的请求不能在引擎仍在写入时将存储交给另一个进程。

安全与速率限制

  • 双模式认证门:回环(127.0.0.1)上无密钥,MARM_API_KEY(Bearer)在服务器暴露于网络时(SERVER_HOST=0.0.0.0,Docker)强制要求。--generate-key 生成一个。默认安全,本地零设置摩擦。

  • 基于IP的速率限制,带有滑动窗口和临时封禁,通过CLI预设而非配置迷宫进行调整(下表)。

  • 本地优先:所有内容位于 ~/.marm/ 下;无云同步,无遥测,无外部存储。

  • 优雅关闭:SIGTERM/SIGINT处理程序干净地排空并关闭连接池,内部事件系统运行自动化回调,每个回调具有错误隔离和超时,因此一个坏钩子不会卡住服务器。

群体与多智能体预设

标志

速率限制

写入队列

使用场景

(无)

80 RPM

启用

常规本地使用及小型3-5智能体设置

--swarm

200 RPM

启用

共享HTTP服务器,约15-30个智能体(取决于写入风格)

--swarm-max

600 RPM

启用

较重负载的本地/私有群体,约50-100个智能体(取决于写入风格)

--trusted

禁用

启用

仅限私有/可信部署

--rate-limit-rpm N

N RPM

不变

自定义覆盖;0表示禁用限制

写入队列会序列化内存写入,不受预设影响;群体标志在此基础上调整HTTP速率限制。队列控制写入顺序;合并与压缩是独立的内存维护层。此堆栈(WAL + 池化 + 单一序列化写入器 + RPM预设)有意限定在“SQLite、多智能体、单机”范围内;分布式多节点内存不在当前设计范围内。

自维护文档

打包的文档在启动时索引到marm_system内存命名空间,每50次工具调用刷新一次,通过源文件哈希跟踪,未更改的文档跳过,更改或删除的行重新索引。连接的智能体可以使用marm_smart_recall回答MARM使用问题,无需您手动粘贴文档。

配置参考

变量

默认值

控制内容

SERVER_HOST

127.0.0.1

绑定地址;0.0.0.0 暴露服务器并使 MARM_API_KEY 成为必需

SERVER_PORT

8001

HTTP 端口

MARM_API_KEY

(空)

网络暴露部署的 Bearer 密钥

MARM_DB_PATH

~/.marm/marm_memory.db

记忆数据库位置

MARM_CONCEPT_DB_PATH

~/.marm/index/marm_index.db

概念图数据库位置

MARM_PROJECT / MARM_PLATFORM

(自动检测)

覆盖项目/平台归属

MARM_RATE_LIMIT_RPM

80

每 IP 每分钟请求数(预设会覆盖)

WRITE_QUEUE_ENABLED

1

通过一个工作线程序列化写入

FTS_CANDIDATE_LIMIT

200

在语义重排序前获取的 BM25 候选数;对于关键词重叠较弱的存储器请增大,对于希望收紧到最接近关键词匹配结果的情况请减小

RECALL_SCAN_LIMIT

10000

语义回退扫描的上限;响应中的 recall_scan_truncated=true 表示已触及上限

FTS_QUERY_MODE

or_nostop

语义召回如何构建其关键词查询:or_nostop 忽略填充词然后匹配剩余任意词,or 匹配任意词,and 要求每个词(2.31.0 之前的行为)。精确/词汇通道始终要求每个词。

FTS_EXTRA_STOPWORDS

(空)

逗号分隔的额外忽略词,用于构建关键词查询时忽略那些在你的存储器中过于常见而无法携带信号的词

HYBRID_SEARCH_TEXT_WEIGHT

0.05

关键词得分对排序的影响程度。根据基准扫描设定;准确率在 0.04-0.08 之间达到峰值,超过 0.10 后急剧下降。设为 0.0 时,关键词匹配仅缩小考虑的记忆范围,但不会重新排序它们。

FTS_LONE_HIT_SCORE

1.0

当只有一条记忆匹配,或所有匹配得分相同时使用的关键词得分。在小型存储中,如果单次关键词匹配不应视为完美匹配,可降低此值。

SEMANTIC_SEARCH_ENABLED

1

设为 0 以在不加载嵌入模型的情况下运行:不加载任何模型,不写入任何嵌入,召回回退到关键词匹配。适用于低内存主机,或观察模型不可用时召回的行为。marm-memory doctor 在其关闭时会报告。

TEMPORAL_WEIGHT / TEMPORAL_HALF_LIFE_DAYS

0.1 / 30

时间衰减增强的强度和衰减速度

CONSOLIDATION_ENABLED

0

写入时去重 + 语义合并

CONSOLIDATION_THRESHOLD

0.92

合并近似重复所需的余弦相似度。仅与意义相似度比较,而非混合排序得分

COMPACTION_ENABLED

0

后台聚类检测 + 代理辅助压缩

COMPACTION_TRIGGER_COUNT

5

每次会话的写入次数,之后触发一次压缩

COMPACTION_SIMILARITY_THRESHOLD / COMPACTION_MIN_CLUSTER_SIZE / COMPACTION_MIN_AGE_HOURS

0.88 / 3 / 24

聚类检测门控

COMPACTION_STAGING_TTL_HOURS

168

暂存摘要过期前的等待时间(小时)

GRAPH_ENABLED

true

5 个代码图工具的全局开关

GRAPH_AUTO_INDEX

true

代码图中已有仓库的自动重新索引。来自 projects auto offmarm_graph_index(action="auto_off") 的已保存开关会覆盖此设置,因此此处设置的值无法重新启用用户已关闭的功能

GRAPH_AUTO_INDEX_INTERVAL

30

每个仓库的 Git 签名检查间隔(秒)。最小 5

GRAPH_AUTO_INDEX_FULL_INTERVAL

300

对于非 Git 仓库目录(不存在廉价的变更检查)的重新索引间隔(秒)。最小 60

GRAPH_AUTO_INDEX_MODE

moderate

自动重新索引的索引深度:fullmoderatefast。其他值会发出警告并回退

GRAPH_AUTO_INDEX_LEASE_SECONDS

120

索引门控在没有续租的情况下保持占有的时间。正在运行的索引会续租自己的租约,因此此参数限定了被终止进程阻止索引的时间,而非索引本身可能花费的时间

GRAPH_AUTO_INDEX_PROJECT_TTL

300

监控项目列表在被从引擎重新读取之前的信任时间(秒)

CONCEPT_BUILD_ROW_CAP

500

概念图构建过程中每页读取的记忆行数。并非构建的上限:范围内的每条记忆无论哪种方式都会被读取

CONCEPT_AUTO_INDEX

true

新记忆的自动概念索引。false0nooff 会停止工作线程并使构建变为手动。写入仍会记录队列行

CONCEPT_INDEX_DEBOUNCE_SECONDS

30

写入后开始索引前的静默期(秒),以便突发写入成为一次处理

CONCEPT_INDEX_BATCH_SIZE

20

每批索引的记忆数,上限 500。降低该值不会减少争用;实测会略微变差

CONCEPT_INDEX_BATCH_PAUSE_MS

250

在清除积压时批次之间的暂停时间(毫秒)。将索引期间的召回最坏情况从约 270ms 降低到约 80ms,但会延长约 18% 的耗用时间。0 表示禁用

CONCEPT_INDEX_LEASE_SECONDS

300

已认领的索引任务在没有续租的情况下保持占有的时间。进行中的工作会续租自己的租约,因此此参数限定了被终止进程持有任务的时间,而非一批任务可能花费的时间。被回收的任务不会耗费尝试次数

CONCEPT_INDEX_MAX_ATTEMPTS

3

失败尝试次数,之后记忆将被搁置并记录错误,不再重试

故障排除

Jina v2 Small 默认使用 512 维嵌入;旧的 all-MiniLM-L6-v2 数据是 384 维,必须重新嵌入。停止所有 MARM HTTP 和 STDIO 进程,然后运行:

marm-memory maintenance embeddings migrate

它会重新嵌入记忆、块以及任何现有的概念图向量(笔记本草稿条目不再携带嵌入),报告进度,验证两个数据库,并且可以在中断后恢复。它会拒绝针对正在运行的 HTTP 服务器启动;STDIO 进程无法可靠检测,必须手动停止。

修复分块记忆

超过 500 个单词的记忆也会存储为更小的块。不同版本间块大小发生了变化,上述迁移仅重新嵌入块而不重新拆分,因此旧的块会保留过时的边界。停止所有 MARM 进程,然后运行:

marm-memory maintenance chunks rechunk

它会重新拆分过时的块,填充因写入中断而丢失的块,并删除现在低于阈值的记忆对应的块。已经正确的记忆会跳过而不加载编码器,因此重新运行不会消耗资源。与上述相同的实时服务器保护,此外当存储的向量与配置的嵌入模型不匹配时它会拒绝:在这种情况下请先迁移。即使没有此操作,回忆功能也能工作,只是对长记忆的准确性较差。

服务器无法启动

  • 检查 Python 版本:python --version(必须是 3.10+)

  • 确认端口 8001 未被占用:lsof -i :8001(macOS/Linux)或 netstat -ano | findstr :8001(Windows)

  • 检查主目录的权限错误(~/.marm/ 必须可读可写)

  • 查看平台特定的故障排除:INSTALL-DOCKER.mdINSTALL-WINDOWS.mdINSTALL-MACOS.mdINSTALL-LINUX.md

STDIO 连接失败

  • 确认 pip 安装后 marm-mcp-stdio 在您的 PATH 中:marm-mcp-stdio --help

  • 或者使用:python -m marm_mcp_server.server_stdio

  • 查看 AI 客户端文档了解 STDIO 传输要求

  • 尝试直接执行以查看错误信息:python -m marm_mcp_server.server_stdio

AI 客户端无法连接到 MARM

  • 使用 curl http://localhost:8001/health 验证服务器是否正在运行

  • 检查防火墙是否阻止了端口 8001

  • 对于 STDIO:使用 marm-mcp-stdio(控制台脚本)或 python -m marm_mcp_server.server_stdio

  • 重新启动服务器和 AI 客户端

工具在 AI 客户端中未显示

  • 使用 curl http://localhost:8001/health 验证 HTTP 模式

  • 检查服务器日志中的初始化错误

  • 断开并重新连接 AI 客户端以刷新工具列表

  • HTTP 和 STDIO 都暴露 14 个工具:7 个核心记忆/日志/笔记本/压缩工具,5 个捆绑代码图工具,以及 2 个概念图工具

图工具返回 graph backend unavailable

  • 确认 GRAPH_ENABLED 未设置为 false(影响 HTTP 和 STDIO;图工具在两个传输上完全一致)

  • 首次使用图可能需要更长时间,因为固定的代码库记忆引擎启动或本地下载

  • 在 Docker 中,图引擎二进制文件已内置到镜像中;本地 pip 安装可能在首次使用图时获取它

  • 即使图启动失败,核心记忆工具仍能继续工作

概念工具返回 entities_extracted: 0

  • 首先确认特定作用域的概念构建确实包含具有可提取实体的记忆。

  • 运行 marm-memory knowledge status;如果报告缺少运行时或模型,请使用 python -m pip install -U --force-reinstall marm-mcp-server 修复安装。

新记忆未显示在图中

  • 运行 marm-memory knowledge statusindex_queue.pending 表示等待中的记忆数量;index_queue.parked 表示放弃的数量。auto_index: false 表示索引已关闭。

  • 等待防抖间隔(默认 30 秒)加上提取时间。批量写入会被视作一次处理,而不是每条记忆单独处理。

  • 检查 CONCEPT_AUTO_INDEX 是否未设置为 false0nooff

  • 等待重建的图不会被索引。如果控制台或 marm-memory knowledge status 报告 rebuild_required,请运行一次 marm_concept_build(search_all=True);之后已排队的记忆会被拾取。

  • 自动索引仅覆盖升级后写入的记忆。运行一次构建以引入所有更旧的记忆。

  • 提取失败三次的记忆会被停放而非无限重试。原因会与任务一起记录。

代码更改未显示在代码图中

  • 运行 marm-memory projects auto statusenabled: false 表示自动重新索引已关闭;source: override 表示是保存的开关关闭了它,而非环境变量。

  • 仓库必须先被索引一次才能被监视。marm-memory projects list 显示已注册的仓库。

  • 等待间隔(默认 30 秒)加上索引时间。提交会在下一次检查时被拾取。

  • 从控制台删除的项目会被有意抑制,因此过时的监视列表无法重新创建它。显式索引它会重新注册。

  • 自动索引需要图引擎,该引擎在引擎二进制文件下载完成前保持休眠状态。任何图工具调用都会下载一次。

索引返回 index_in_progress

  • 另一个 MARM 进程持有索引门控,通常是另一个传输的轮询器或控制台索引作业。删除项目也会报告相同情况,因为索引期间的删除会被其撤销。稍后再试一次。

构建返回 build_in_progress

  • 另一个 MARM 进程正在写入图,通常是另一个传输的索引工作器。构建通常很快,除非是完整重建;稍后再试一次。

构建返回 lock_lost

  • 构建停滞时间过长,另一个进程接管了图,因此它中途停止而不是并行写入。通常是机器挂起或调试器暂停。它在停止前索引的任何内容都会保留,重新运行构建会完成剩余部分。

记忆未保存

  • 确认 ~/.marm/ 目录存在且具有写入权限

  • 检查可用磁盘空间

  • 使用简单记忆测试:让 AI 保存一行并用 marm_log_show 检查

  • 对于 HTTP 模式,使用 curl http://localhost:8001/health 验证服务器健康状态

搜索无结果

  • 确认存在记忆:使用 marm_log_show 列出条目

  • 使用 search_all=True 搜索所有会话

  • 尝试更简单、更通用的搜索查询

  • 等待几秒钟;首次语义搜索会加载机器学习模型

记忆出现后消失

  • 检查 MARM 是否重启或崩溃(数据持久化在 ~/.marm/

  • 确认磁盘空间未满

  • 检查系统日志中的数据库错误

数据丢失或损坏

  • 立即停止服务器

  • 检查 ~/.marm/ 目录中的备份副本(如果您创建过)

  • 从备份恢复:将备份的 ~/.marm/ 复制回主目录

  • 重新启动服务器

数据库锁定错误

  • 关闭所有 AI 客户端连接

  • 停止服务器:Ctrl+C

  • 备份整个数据库目录:cp -r ~/.marm ~/.marm.backup

  • 检查持有数据库的进程:lsof ~/.marm/marm_memory.db(macOS/Linux)或检查任务管理器(Windows)

  • 如果有进程持有锁,终止它

  • 验证数据库完整性:sqlite3 ~/.marm/marm_memory.db "PRAGMA integrity_check;"

  • 如果完整性检查失败,请从备份恢复

  • 如果完整性检查通过,锁应被释放;重新启动服务器

搜索结果慢

  • 首次搜索较慢(模型从磁盘加载);后续搜索更快

  • 大型数据库(1000+ 条记忆)可能需要几秒钟

  • 限制搜索:使用 limit=10 而非无限制结果

  • 使用 marm_summary 压缩旧会话

服务器占用过多内存

  • 包含许多条目的笔记本可能会累积;使用 marm_notebook(action="clear") 修剪活动条目

  • 关闭未使用的 AI 客户端连接

  • 启用压缩时,使用 marm_compaction(action="review") 检查暂存的压缩摘要

错误

原因

解决方案

address already in use

端口 8001 被占用

终止占用 8001 的进程或使用不同端口

permission denied: ~/.marm/

数据库目录不可写

chmod 755 ~/.marm/ 或检查所有权

module not found: core.memory

缺少依赖项

marm-mcp-server/ 重新安装:pip install -e ".[dev]"

database is locked

多个进程访问数据库

关闭其他连接,重新启动服务器

embedding model not found

语义搜索模型未下载

首次运行需要时间;请耐心等待,检查网络连接

有关记忆行为、传输方式、支持的客户端、压缩和备份问题,请参阅常见问题解答

Star 历史

贡献

MARM 欢迎各个层次的贡献者。代码有帮助,但文档、设置笔记、客户端测试、错误报告、基准测试以及来自日常使用 AI 工具的人的真实工作流反馈也同样重要。

适合提供帮助的地方:

  • 在更多 MCP 客户端、IDE 代理和操作系统上测试 MARM

  • 改进文档、截图、示例和特定平台的设置笔记

  • 报告错误或令人困惑的安装步骤,并附上清晰的复现细节

  • 分享基于真实使用的记忆工作流、代理习惯和工具想法

  • 查看开放的问题

💡 想让您的名字出现在这个列表中?请查看我们的 CONTRIBUTING.md 指南开始吧!

加入 MARM 社区

帮助构建 AI 记忆的未来——无需编码!

联系: MARM Discord | GitHub Discussions

许可与使用声明

版权所有 © 2026 Ryan A. Lyell。MARM 根据 Apache 2.0 许可证 发布(版权声明见 NOTICE),欢迎分支、实验和集成。MARM 还封装了第三方开源组件,例如基于 MIT 许可证的 codebase-memory-mcp;归属信息见 THIRD_PARTY_NOTICES.md。如果您在此基础上进行构建,请确保非官方版本易于与 官方 MARM 仓库 发布的版本区分,以便用户了解他们安装的内容。

项目文档

使用指南

  • README.md - 本文件:完整使用指南、工具参考、工作流程和架构

  • PROTOCOL.md - MCP 操作协议

  • FAQ.md - 关于使用 MARM 的常见问题解答

MCP 服务器安装

项目信息

Available Tools

14 tools
marm_code_lookupA
🔎 Find code: symbols/definitions, text patterns, or a symbol's source.

Use INSTEAD OF grep/glob. `kind=auto` picks: a qualified_name reads source;
otherwise it searches the graph by name/keyword. Set `kind=text` to grep code,
`kind=snippet` to read a symbol's source, `kind=symbol` to force graph search.

Parameters:
- query: symbol name, natural-language phrase, code/text pattern, or a qualified_name
- project: project name; omit to auto-resolve
- kind: auto | symbol | text | snippet (default auto)
- regex: for text search, treat query as a regex (default False)
- file_pattern: glob to scope search, e.g. "*.py" (optional)
- limit: max results, 1-200 (default 20)

Returns: graph lookup response, or a graph-unavailable error if the graph
backend is disabled or failed to start
ParametersJSON Schema
NameRequiredDescriptionDefault
kindNoauto
limitNo
queryYes
regexNo
projectNo
file_patternNo

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries the full burden. It discloses that the tool returns a 'graph lookup response, or a graph-unavailable error if the graph backend is disabled or failed to start.' It also explains the behavior of kind=auto based on query type. However, it does not detail the structure of the response or mention any authentication or rate limits, which would improve transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with an emoji, bolded key terms, a concise overview, and a bulleted parameter list. Every sentence adds value, and the length is appropriate for the complexity of the tool. It is front-loaded with the most important information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description effectively explains the tool's functionality and parameters, and it mentions the return type. Given the complexity (6 parameters, no output schema, no annotations, and many sibling tools), it is largely complete. However, it could briefly mention what a 'graph lookup response' contains or provide an example to further aid understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant meaning beyond the input schema. For each parameter, it explains its purpose and behavior: e.g., query can be 'symbol name, natural-language phrase, code/text pattern, or a qualified_name'; kind options are detailed; regex is for text search; project can be omitted for auto-resolve; file_pattern is a glob. With 0% schema coverage, the description fully compensates.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Find code: symbols/definitions, text patterns, or a symbol's source.' It distinguishes itself by saying 'Use INSTEAD OF grep/glob,' and explains the different modes (auto, symbol, text, snippet), making it easy to understand what the tool does and how it differs from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool and its alternatives: 'Use INSTEAD OF grep/glob.' It also explains the behavior of each kind value, e.g., 'kind=auto picks: a qualified_name reads source; otherwise it searches the graph by name/keyword. Set kind=text to grep code, kind=snippet to read a symbol's source, kind=symbol to force graph search.' This gives clear context for selecting the appropriate mode.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_compactionA
Compact related memories into a single summary to reduce context bloat.

Workflow: status/candidates → stage → review → apply/discard

action="status"     — check if compaction candidates exist (run first)
action="candidates" — get pending candidates with source previews; each includes a ready-to-use prompt
action="stage"      — submit your summary: {candidate_id, suggested_summary}; source_memory_ids optional
action="review"     — inspect staged summaries before committing
action="apply"      — commit a staged summary; source memories are marked compacted
action="discard"    — reject a staged summary without touching source memories
ParametersJSON Schema
NameRequiredDescriptionDefault
actionYes
summariesNo
candidate_idNo

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses key behaviors: apply marks source memories as compacted, discard leaves source memories untouched, and candidates include a 'ready-to-use prompt.' This is meaningful contextual information beyond the schema, though it does not mention all side effects or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and well-structured: a one-sentence purpose, a workflow arrow, and a bulleted action list. Every sentence provides useful information without redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has complexity (six actions, multiple parameters) and no output schema, so the description should clarify return values and expected behavior for each action. The workflow is explained, but the response/return format for actions like status or candidates is not described, leaving the user guessing about what data comes back. This is a significant omission for a stateful workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains action values (status, candidates, stage, etc.) and the candidate_id parameter in context. However, the summaries parameter is never explicitly described, leaving ambiguity about its structure and usage (likely for batch apply, but not stated). This is a noticeable gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence states the tool's exact purpose: 'Compact related memories into a single summary to reduce context bloat.' The verb (compact) and resource (memories) are clear, and the workflow action list distinguishes it from sibling tools like marm_log or marm_smart_recall.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear workflow (status/candidates → stage → review → apply/discard) and tells the user to run status first. It gives context for each action but does not explicitly name alternative tools or state when not to use this tool, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_concept_buildA
🕸️ Extract entities/relationships from memory content into the concept graph.

Scope with session_name or project for a targeted build, or pass
search_all=True for everything (row-capped). Links extracted entities to
marm-graph code symbols when available. Call this before marm_concept_recall
— there's no data until a build has run at least once.

Parameters:
- session_name: scope extraction to this session; omit with search_all=True
- search_all: extract across all sessions, row-capped (default False)
- project: scope extraction to this project (optional)
- run_id: optional Console build-run ID for status polling

Returns: entities_extracted, relationships_created, code_links_created, duration_ms
ParametersJSON Schema
NameRequiredDescriptionDefault
run_idNo
projectNo
search_allNo
session_nameNo

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Describes extraction of entities/relationships, code linking, row-capping for search_all, and return fields. Lacks details on overwrite/durability behavior, but overall informative for a build tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Concise and well-structured with bullet-like parameter list and clear action verb. The emoji is non-essential but not harmful. Could be slightly tighter by removing redundant phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, manually lists return values. Covers scoping options, linking behavior, and prerequisite ordering. Missing error conditions and permissions, but adequate for a build tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but description compensates fully by explaining the purpose and interaction of all four parameters (session_name, search_all, project, run_id) beyond their titles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the action (extract entities/relationships) and the resource (concept graph). Distinguishes from sibling marm_concept_recall by specifying the ordering dependency.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly explains scoping via session_name/project or search_all=True, and advises calling this before marm_concept_recall, providing clear when-to-use and when-not-to guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_concept_recallA
🔎 Search the concept graph: entities, their relationships, and linked code.

Query as a bare concept name for a lookup, or phrase it as "related to X"
to emphasize traversal — both route from query shape alone. Returns empty
lists (not an error) when marm_concept_build hasn't run yet or marm-graph
has no matching code symbols.

Parameters:
- query: concept name, or a "related to X" style ask
- session_name: scope to this session; omit to search across all (optional)
- limit: max entities/relationships returned, 1-100 (default 10)
- depth: max hop distance to traverse, 1-5 (default 1 = direct neighbors only)
- direction: outgoing | incoming | both (default both)
- project: scope to this project; entities with the same name in
  different projects are distinct nodes; omit to search across all (optional)
- platform: scope to this client/platform; omit to search across all (optional)

Returns: entities, related_entities, linked_code
ParametersJSON Schema
NameRequiredDescriptionDefault
depthNo
limitNo
queryYes
projectNo
platformNo
directionNoboth
session_nameNo

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations were provided, so the description must carry the full burden. It discloses that returns empty lists (not errors) when the graph hasn't been built or no matches exist, which sets correct expectations. It does not explicitly state read-only behavior, but that is implied from the search nature. This is adequate but could be improved.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a brief paragraph followed by bullet points for parameters. It uses formatting (emoji, bold) to aid readability. While it could be slightly more concise, it doesn't waste words and every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 7 parameters and no output schema, the description explains inputs well but the return structure is only briefly mentioned ('Returns: entities, related_entities, linked_code') without further detail on the shape or content. This is a gap, but the tool's purpose is still understandable. It meets minimum viability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema coverage is 0%, so the description must fully explain parameters. It does so for all 7 parameters: each has a clear purpose, default values, and acceptable ranges (e.g., limit 1-100, depth 1-5, direction enum). It adds meaning beyond the schema, which only defines types and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches the concept graph for entities, relationships, and linked code. It uses a specific verb (search, query) and resource (concept graph). However, it does not explicitly distinguish this tool from siblings like marm_smart_recall or marm_graph_trace, leaving ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides guidance on query styles ('bare concept name' vs 'related to X'), which helps with when to use each. However, it lacks explicit advice on when to choose this tool over siblings (e.g., vs marm_smart_recall for smarter retrieval, or marm_graph_trace for tracing). No exclusions or alternatives are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_deleteA
🗑️ Delete a log session, log entry, or notebook entry

type="log" + session_name: delete specific entry by id or topic
type="log" (no session_name): delete entire session and all its entries
type="notebook": delete notebook entry by name
ParametersJSON Schema
NameRequiredDescriptionDefault
typeYes
targetYes
projectNo
platformNo
session_nameNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description adequately discloses the destructive behavior and scope of deletion. It explains what gets deleted based on parameter combinations, but does not mention irreversibility or cascading effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description uses bullet points and emojis, which improves readability but adds length. It is clear but slightly verbose for the information conveyed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a delete tool, the description provides sufficient context about what can be deleted and how. However, missing details on the 'target' parameter and no output schema reduce completeness slightly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description clarifies the interaction between 'type' and 'session_name' parameters, but does not explain the 'target', 'project', or 'platform' parameters. With 0% schema coverage, the description partially compensates but leaves gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states that the tool deletes log sessions, log entries, or notebook entries. It distinguishes between different deletion behaviors based on the 'type' and 'session_name' parameters, making the purpose clear and specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear patterns for when to use each variation: deleting a specific log entry, deleting an entire log session, or deleting a notebook entry. It implicitly guides the agent to use other tools for non-deletion operations, but does not explicitly mention alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_graph_architectureA
🏛️ High-level architecture overview: node/edge breakdown, modules, and schema.

One-shot orientation for a project — the de-facto module clusters, package
structure, and the graph schema (node labels + properties) folded in.

Parameters:
- project: project name; omit to auto-resolve

Returns: graph architecture response, or a graph-unavailable error if the
graph backend is disabled or failed to start
ParametersJSON Schema
NameRequiredDescriptionDefault
projectNo

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the failure mode: 'graph-unavailable error if the graph backend is disabled or failed to start', and also notes that omitting the project parameter auto-resolves. This gives the agent useful expectations for both success and error cases.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Compact and well-organized: purpose in the first line, a clarifying sentence, then a parameter list and a returns line. Uses whitespace effectively and has no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers input, output (graph architecture response), and failure mode (graph-unavailable error). Without an output schema, it doesn't detail the response structure, but for an orientation tool this is a minor gap; the description is sufficient for basic invocation and expectation setting.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema only defines a nullable string with a default. The description adds critical meaning: 'project name; omit to auto-resolve' clarifies the parameter's purpose and the behavior when omitted, which is far beyond the schema's minimal info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States 'High-level architecture overview: node/edge breakdown, modules, and schema' – a specific verb+resource combination that clearly distinguishes this from sibling tools like graph_trace or graph_impact. The noun phrase 'architecture overview' leaves no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly frames itself as 'one-shot orientation for a project', implying use when a high-level understanding is needed. It doesn't explicitly name alternatives, but the context of sibling tools plus the 'orientation' wording makes the intended use case clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_graph_impactA
💥 Blast radius of code changes: git diff → affected symbols + risk.

Pass `since` (a git ref/date) or a `base_branch` to compare against. Returns
which symbols a change touches and how far the impact propagates.

Parameters:
- project: project name; omit to auto-resolve
- since: git ref or date to compare from, e.g. HEAD~5, v0.5.0 (optional)
- base_branch: base branch to diff against (default "main")
- depth: impact propagation depth, 1-5 (default 2)

Returns: graph impact response, or a graph-unavailable error if the graph
backend is disabled or failed to start
ParametersJSON Schema
NameRequiredDescriptionDefault
depthNo
sinceNo
projectNo
base_branchNomain

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It usefully mentions the 'graph-unavailable error if the graph backend is disabled or failed to start' and describes the output conceptually. However, it does not explicitly state whether the operation is read-only, whether any mutation occurs, or any authentication requirements, leaving some ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a bold purpose statement, followed by usage, a bulleted parameter list, and return value. Every sentence earns its place, and the structure is clean and scannable. There is no redundant filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Since there is no output schema, the description explains returns: 'graph impact response, or a graph-unavailable error.' It also clarifies in the opening that the response includes affected symbols and propagation distance. This covers the essentials, though a more structured breakdown of the response object would make it more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description must compensate. It does so thoroughly by listing all four parameters with meanings and examples: 'since: git ref or date to compare from, e.g. HEAD~5, v0.5.0', 'depth: impact propagation depth, 1-5', and defaults for base_branch and project. This adds significant semantic value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line 'Blast radius of code changes: git diff → affected symbols + risk' precisely states the tool's function with a specific verb and resource. It clearly distinguishes from sibling tools like marm_graph_trace (trace specific symbols) and marm_graph_architecture (architecture view) by focusing on impact propagation from a git diff.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear usage context: 'Pass `since` (a git ref/date) or a `base_branch` to compare against' and explains defaults for base_branch and depth. However, it does not explicitly name alternative tools or state when not to use this tool, relying on the purpose to differentiate from siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_graph_indexA
🕸️ Index a code repository into the graph, or check status / list known projects.

Pass `repo_path` to index a repo (returns the project name to use in every
other tool). Omit it to list indexed projects, or pass `project` to check
index status. Call this first — all other graph tools need an indexed project.

Indexed repos are re-indexed automatically in the background. Use
`action="auto_off"` to stop that, `auto_on` to resume, `auto_status` to check.

Parameters:
- repo_path: path to the repository to index; omit to list/status only
- project: existing project name for a status check; omit to auto-resolve
- mode: index depth — full | moderate | fast (default moderate)
- action: auto | index | status | list (default auto; infers from repo_path
  presence), or auto_on | auto_off | auto_status to control automatic
  re-indexing

Returns: graph index/status/list response, or a graph-unavailable error if the
graph backend is disabled or failed to start
ParametersJSON Schema
NameRequiredDescriptionDefault
modeNomoderate
actionNoauto
projectNo
repo_pathNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully carries the behavioral disclosure burden. It reveals auto-reindexing ('Indexed repos are re-indexed automatically in the background'), the effects of action options, and the possible graph-unavailable error on backend failure. It does not cover permissions or side effects on the repo, but covers the core behaviors well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with a summary, parameter list, and return note. It front-loads the main purpose and stays under 200 words, but includes an unnecessary emoji and slightly redundant phrasing. Still, every section earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (4 optional params, multiple actions, auto-reindexing), the description covers the purpose, parameter semantics, usage order, and return/error behavior. It lacks concrete examples or response shape, but no output schema exists, so the description is sufficiently complete for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It does by providing per-parameter explanations: repo_path as index vs list/status, project as status check, mode as depth, and action as explicit enum with inference rules. This adds substantial meaning beyond titles and enums.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear verb+resource statement: 'Index a code repository into the graph, or check status / list known projects.' It also differentiates itself from sibling graph tools by explicitly stating 'Call this first — all other graph tools need an indexed project,' establishing it as the prerequisite setup tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: 'Call this first' and explains when to pass vs omit repo_path and project. It outlines the three main action modes (index, status, list) and the auto-reindexing controls, but does not explicitly name alternative tools for other graph operations, relying on the prerequisite statement to imply exclusion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_graph_traceA
🧭 Trace call paths / data flow through the graph from a function.

`direction=inbound` finds callers, `outbound` finds callees, `both` for all.
`mode=data_flow` follows value propagation. `cross_service` attempts HTTP/async
boundaries but does not currently join a client call to its server handler, so
treat an empty result as unknown rather than as "nothing calls this".
Use for impact analysis, dependency tracing, "who calls this".

Parameters:
- function_name: function or method to trace from
- project: project name; omit to auto-resolve
- direction: inbound | outbound | both (default both)
- depth: max hops, 1-5 (default 3)
- mode: calls | data_flow | cross_service (default calls)
- risk_labels: add CRITICAL/HIGH/MEDIUM/LOW risk tiers by hop distance (default True)
- include_tests: also return callers in test files (default False)
- include_evidence: per-hop `strategy` (lsp | language_rule | heuristic | unresolved)
  and `confidence`, so a guessed edge is distinguishable from a resolved one
  (default True). Test callers typically come back heuristic at low confidence

Returns: graph trace response, or a graph-unavailable error if the graph
backend is disabled or failed to start
ParametersJSON Schema
NameRequiredDescriptionDefault
modeNocalls
depthNo
projectNo
directionNoboth
risk_labelsNo
function_nameYes
include_testsNo
include_evidenceNo

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden and does so well. It discloses the cross_service limitation that an empty result means 'unknown' and defines evidence strategies and confidence levels so guessed edges are transparently distinguishable. Error behavior for an unavailable graph backend is also explicitly documented.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The prepended emoji and short purpose line front-load the key operation. Parameters are grouped in a compact bullet-style list, and each sentence adds either setup, a limitation, or parameter behavior. It is information-dense without being bloated for a tool with 8 parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is thorough for a complex tool with no output schema or annotations: it covers behavioral caveats, direction/mode choices, evidence semantics, and backend failure. The main gap is that the return value is only described as a generic 'graph trace response', and it doesn't define the result graph shape or edge fields. Still, this is quite complete for an agent's invocation needs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, but the tool description covers all 8 parameters with meaningful semantics. It adds constraints like depth 1-5, auto-resolution for project, direction/mode meanings, risk-label behavior, and evidence strategy values. This fully compensates for the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description starts with a specific action: 'Trace call paths / data flow through the graph from a function,' which clearly identifies the tool's purpose. It also lists concrete use cases ('impact analysis, dependency tracing, who calls this') that help orient an agent. The only slight overlap with the sibling marm_graph_impact is minor because this tool centers on graph traversal from a function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives actionable direction/mode guidance (inbound vs outbound vs data_flow vs cross_service) and states 'Use for impact analysis, dependency tracing, who calls this.' However, it doesn't explicitly state when not to use it, nor name alternatives like marm_graph_impact, marm_code_lookup, or marm_graph_architecture. Clear context exists, but exclusion/alternative guidance is missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_log_entryA
📝 Write a log entry to the active session.

Entries are stored with a date, topic, and summary. If `entry` begins with
"Session: [name]" or "Topic: [name]", the active session switches to that name
and all subsequent entries route there automatically. Entries are also stored
as semantic memories so marm_smart_recall can find them.

Entry format: YYYY-MM-DD-topic-summary (date prefix is optional; auto-tagged if omitted)

Parameters:
- entry: the text to log; plain text or prefixed with "Session:" / "Topic:" to switch sessions
- session_name: override the target session explicitly (optional; active session used if omitted)

Returns: status, message confirming the entry or session switch, entry_id, memory_id
ParametersJSON Schema
NameRequiredDescriptionDefault
entryYes
session_nameNo

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses key behaviors: entries are stored with date/topic/summary, session switching via prefix, auto-tagging of date, and storage as semantic memories for recall. It also notes return values.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is somewhat lengthy but well-structured with bullet points and clear sections. Every sentence adds value, and the purpose is front-loaded. It could be slightly more concise, but it effectively communicates necessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and low schema coverage, the description fully compensates by explaining return values, complex session-switching behavior, and storage side-effects. It is complete enough for an AI agent to use correctly without additional references.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully define parameters. It explains that 'entry' is the text to log with optional prefixes for session/topic switching, and 'session_name' is an optional override. This adds significant meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool writes a log entry to the active session, specifying the resource (log entry, active session) and verb (write). It distinguishes from siblings like marm_log_show (read) and marm_smart_recall (recall), which have different verbs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the tool (to write a log entry) and gives detailed formatting and session-switching rules. However, it does not explicitly state when not to use it or mention alternatives, though the context from sibling names implies this.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_log_showA
📋 List log sessions or show entries for a specific session.

Two modes depending on whether `session_name` is provided:
- No session_name: returns a summary of all sessions with entry counts
- With session_name: returns all entries for that session, ordered by date descending

Parameters:
- session_name: name of the session to inspect (omit to list all sessions)

Returns (no session_name): status, sessions list with session_name/entry_count, total_sessions
Returns (with session_name): status, session_name, entries list with id/entry_date/topic/summary/full_entry, total_entries
ParametersJSON Schema
NameRequiredDescriptionDefault
session_nameNo

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so description carries full burden. Describes two modes and return structures. However, does not disclose if the operation is read-only, or any potential side effects. Since it's a log viewer, likely safe, but not explicitly stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is well-structured with bullet points and clear sections. Every sentence adds value without redundancy. Efficiently covers purpose, modes, parameters, and return formats.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 1 parameter, no output schema, and no annotations, the description fully covers both modes, parameter behavior, and expected return structure. No gaps in essential information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one parameter (`session_name`) with schema coverage 0%. Description fully explains that it's optional and its effect on output. Provides more semantic meaning than the schema alone, which only has type and default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it lists log sessions or shows entries for a specific session. Distinguishes two modes based on `session_name` presence. Action verb 'list' and 'show' combined with resource 'log sessions/entries' make purpose concrete.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explains which mode triggers when `session_name` is provided or omitted. Provides explicit context for each usage. Does not explicitly exclude scenarios or compare to sibling tools, but the guidance is clear and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_notebookA
📔 Unified notebook — add, use, show, status, clear, or save

action="add": save or update a scratch entry (name + data required)
action="use": activate entries as instructions (names required, comma-separated)
action="show": list scratch entries for this session with previews
action="status": show currently active entries
action="clear": clear the active entry list
action="save": promote a scratch entry (or new data) into the permanent docs store
ParametersJSON Schema
NameRequiredDescriptionDefault
dataNo
nameNo
namesNo
actionYes
projectNo
platformNo
session_nameNomain

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of behavioral disclosure. It does describe side effects: updating scratch entries, activating instructions, clearing the active list, and promoting to permanent docs. But it omits important behaviors like whether 'clear' also deletes scratch entries, whether 'save' removes the source entry, and session persistence semantics. This is partial transparency, not full.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is exceptionally well-structured: a single-line summary followed by a bulleted list of actions, each one sentence. There is no fluff, and the format makes the multi-action tool easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 7 parameters, multiple actions, no annotations, and no output schema, yet the description only explains a subset of actions and three of the seven parameters. It lacks the underlying conceptual model (scratch vs. active vs. permanent) and never mentions return values or session-specific behaviors. This is insufficient for an agent to fully anticipate tool behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning for action, name, data, and names by specifying their required status per action (e.g., 'name + data required' for add). However, it completely ignores project, platform, and session_name, which are present in the schema with zero documentation. Since schema coverage is 0%, the incomplete parameter guidance creates a significant gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as a unified notebook manager with six explicit verbs (add, use, show, status, clear, save). It distinguishes this from sibling tools like marm_log_entry or marm_smart_recall by framing it as a scratch/active entry management tool, making its purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Per-action instructions imply when to use each subcommand (e.g., 'add' for saving scratch entries, 'use' for activating instructions), and the 'notebook' context implies a general use case. However, it never explicitly contrasts with alternatives or states when not to use this tool, and there is no high-level guidance on sibling tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_smart_recallA
🧠 Recall memories by semantic similarity or keyword match.

Searches stored memories for the most relevant matches to `query`.
Returns a ranked list of results with similarity scores. When a compatible
concept graph exists, the response also includes bounded relationship and
linked-code context without changing memory ranking.

Parameters:
- query: natural language search term or phrase
- session_name: limit search to a specific session (default searches active session)
- limit: maximum number of results to return (default 5)
- search_all: if True, search across all sessions instead of just the active one
- include_logs: if True, include log entries alongside memory results
- detail: controls how much content is returned per result
    1 = summary only (~200 chars)
    2 = extended context (~500 chars)
    3 = full content
- exact_mode: retrieval lane to use
    'auto'     = automatically switch to exact/lexical for syntax-heavy queries
                 (config keys, file paths, CLI commands, API names, code snippets)
    'exact'    = always use deterministic FTS/BM25, no semantic re-ranking
    'semantic' = always use vector similarity regardless of query shape
- project: filter results to a specific project (e.g. "marm-memory"); omit to search all
- platform: filter results to a specific platform (e.g. "claude-code", "cursor"); omit to search all

Returns: status, ranked results, graph_context, and results_count
ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
detailNo
projectNo
platformNo
exact_modeNoauto
search_allNo
include_logsNo
session_nameNodefault

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses read-like behavior (search, return ranked results, graph context) but omits details like error handling, performance characteristics, or any destructive potential. Adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with a concise header, summary paragraph, and clear parameter list. Every sentence adds value without redundancy. Uses formatting (emojis, line breaks) for readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 9 parameters, no annotations, and no output schema, the description covers purpose, all parameters, and return fields (status, ranked results, graph_context, results_count). Missing details on result structure or graph_context, but largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description provides detailed explanations for all 9 parameters, including enumeration for 'exact_mode' and implications for 'detail' levels. This adds significant meaning beyond the raw schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool recalls memories by semantic similarity or keyword match, with a clear verb (searches/recalls) and resource (memories). It distinguishes from siblings like marm_concept_recall by mentioning similarity scores and graph context, but does not explicitly compare.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus siblings. It describes what it does but does not state when NOT to use it or provide alternatives for specific use cases like exact matching or code lookup.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

marm_summaryA
📊 Generate paste-ready context block for new chats

Reads log_entries for the session and returns a formatted markdown summary.
Equivalent to /summary: [session name] command
ParametersJSON Schema
NameRequiredDescriptionDefault
session_nameYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It states it reads log_entries and returns a markdown summary, suggesting a read-only operation. However, it does not disclose potential side effects, prerequisites (e.g., session existence), or limits (e.g., entry count). Adequate but not detailed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: a clear headline sentence, a brief explanation, and a command equivalence. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (single param, read-only), the description covers the core purpose and output format (markdown). It could mention if it only reads from the provided session or has size limits, but overall it is fairly complete for a straightforward tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description must add meaning. It mentions 'Equivalent to /summary: [session name] command', which hints that session_name is the session's name. This provides some context beyond the bare schema, but still lacks format details or examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool generates a 'paste-ready context block for new chats' by reading log entries and returning a formatted markdown summary. This distinguishes it from siblings like marm_log_show (raw logs) and marm_log_entry (adding entries).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by equating to a /summary command, indicating it should be used to get a compact summary. However, it does not explicitly state when to use vs. alternatives like marm_log_show or marm_smart_recall, nor provide when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev2.40.0
    • Changedmarm_graph_trace2 fields changed
      • addedInput schema / properties / include_evidence
        Added value: +{
        +  "default": true,
        +  "title": "Include Evidence",
        +  "type": "boolean"
        +}
      • addedInput schema / properties / include_tests
        Added value: +{
        +  "default": false,
        +  "title": "Include Tests",
        +  "type": "boolean"
        +}
  2. 1 tool updatev2.37.0
    • Changedmarm_graph_index1 field changed
      • changedInput schema / properties / action / enum
        Previous value: -[
        -  "auto",
        -  "index",
        -  "status",
        -  "list"
        -]New value: +[
        +  "auto",
        +  "index",
        +  "status",
        +  "list",
        +  "auto_on",
        +  "auto_off",
        +  "auto_status"
        +]
  3. 5 tool updatesv2.35.0
    • Addedmarm_compaction
    • Addedmarm_graph_architecture
    • Addedmarm_graph_impact
    • Addedmarm_graph_index
    • Addedmarm_notebook
  4. 7 tool updatesv2.25.0
    • Removedmarm_compaction
    • Changedmarm_concept_recall1 field changed
      • addedInput schema / properties / platform
        Added value: +{
        +  "anyOf": [
        +    {
        +      "type": "string"
        +    },
        +    {
        +      "type": "null"
        +    }
        +  ],
        +  "default": null,
        +  "title": "Platform"
        +}
    • Changedmarm_delete2 fields changed
      • addedInput schema / properties / platform
        Added value: +{
        +  "anyOf": [
        +    {
        +      "type": "string"
        +    },
        +    {
        +      "type": "null"
        +    }
        +  ],
        +  "default": null,
        +  "title": "Platform"
        +}
      • addedInput schema / properties / project
        Added value: +{
        +  "anyOf": [
        +    {
        +      "type": "string"
        +    },
        +    {
        +      "type": "null"
        +    }
        +  ],
        +  "default": null,
        +  "title": "Project"
        +}
    • Removedmarm_graph_architecture
    • Removedmarm_graph_impact
    • Removedmarm_graph_index
    • Removedmarm_notebook
  5. 2 tool updatesv2.21.0
    • Addedmarm_concept_build
    • Addedmarm_concept_recall
  6. 12 tool updatesv2.17.1
    • Addedmarm_code_lookup
    • Changedmarm_compaction6 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • addedInput schema / properties / action / title
        Added value: +"Action"
      • addedInput schema / properties / candidate_id / title
        Added value: +"Candidate Id"
      • addedInput schema / properties / summaries / title
        Added value: +"Summaries"
      • addedInput schema / title
        Added value: +"marm_compactionArguments"
      • changedOutput schema / (root)
        Previous value: -{
        -  "additionalProperties": true,
        -  "type": "object"
        -}New value: +null
    • Changedmarm_delete6 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • addedInput schema / properties / session_name / title
        Added value: +"Session Name"
      • addedInput schema / properties / target / title
        Added value: +"Target"
      • addedInput schema / properties / type / title
        Added value: +"Type"
      • addedInput schema / title
        Added value: +"marm_deleteArguments"
      • changedOutput schema / (root)
        Previous value: -{
        -  "additionalProperties": true,
        -  "type": "object"
        -}New value: +null
    • Addedmarm_graph_architecture
    • Addedmarm_graph_impact
    • Addedmarm_graph_index
    • Addedmarm_graph_trace
    • Changedmarm_log_entry5 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • addedInput schema / properties / entry / title
        Added value: +"Entry"
      • addedInput schema / properties / session_name / title
        Added value: +"Session Name"
      • addedInput schema / title
        Added value: +"marm_log_entryArguments"
      • changedOutput schema / (root)
        Previous value: -{
        -  "additionalProperties": true,
        -  "type": "object"
        -}New value: +null
    • Changedmarm_log_show4 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • addedInput schema / properties / session_name / title
        Added value: +"Session Name"
      • addedInput schema / title
        Added value: +"marm_log_showArguments"
      • changedOutput schema / (root)
        Previous value: -{
        -  "additionalProperties": true,
        -  "type": "object"
        -}New value: +null
    • Changedmarm_notebook8 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • addedInput schema / properties / action / title
        Added value: +"Action"
      • addedInput schema / properties / data / title
        Added value: +"Data"
      • addedInput schema / properties / name / title
        Added value: +"Name"
      • addedInput schema / properties / names / title
        Added value: +"Names"
      • addedInput schema / properties / session_name / title
        Added value: +"Session Name"
      • addedInput schema / title
        Added value: +"marm_notebookArguments"
      • changedOutput schema / (root)
        Previous value: -{
        -  "additionalProperties": true,
        -  "type": "object"
        -}New value: +null
    • Changedmarm_smart_recall12 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • addedInput schema / properties / detail / title
        Added value: +"Detail"
      • addedInput schema / properties / exact_mode / title
        Added value: +"Exact Mode"
      • addedInput schema / properties / include_logs / title
        Added value: +"Include Logs"
      • addedInput schema / properties / limit / title
        Added value: +"Limit"
      • addedInput schema / properties / platform / title
        Added value: +"Platform"
      • addedInput schema / properties / project / title
        Added value: +"Project"
      • addedInput schema / properties / query / title
        Added value: +"Query"
      • addedInput schema / properties / search_all / title
        Added value: +"Search All"
      • addedInput schema / properties / session_name / title
        Added value: +"Session Name"
      • addedInput schema / title
        Added value: +"marm_smart_recallArguments"
      • changedOutput schema / (root)
        Previous value: -{
        -  "additionalProperties": true,
        -  "type": "object"
        -}New value: +null
    • Changedmarm_summary4 fields changed
      • removedInput schema / additionalProperties
        Removed value: -false
      • addedInput schema / properties / session_name / title
        Added value: +"Session Name"
      • addedInput schema / title
        Added value: +"marm_summaryArguments"
      • changedOutput schema / (root)
        Previous value: -{
        -  "additionalProperties": true,
        -  "type": "object"
        -}New value: +null
  7. 1 tool updatev2.15.2
    • Changedmarm_smart_recall3 fields changed
      • addedInput schema / properties / exact_mode
        Added value: +{
        +  "default": "auto",
        +  "type": "string"
        +}
      • addedInput schema / properties / platform
        Added value: +{
        +  "anyOf": [
        +    {
        +      "type": "string"
        +    },
        +    {
        +      "type": "null"
        +    }
        +  ],
        +  "default": null
        +}
      • addedInput schema / properties / project
        Added value: +{
        +  "anyOf": [
        +    {
        +      "type": "string"
        +    },
        +    {
        +      "type": "null"
        +    }
        +  ],
        +  "default": null
        +}
  8. 7 tool updatesv2.14.1
    • First observedmarm_compaction
    • First observedmarm_delete
    • First observedmarm_log_entry
    • First observedmarm_log_show
    • First observedmarm_notebook
    • First observedmarm_smart_recall
    • First observedmarm_summary

TDQS

A3.9/5.0

Scored across 14 tools

Disambiguation4/5

Tools are mostly distinct: memory recall, logging, session listing, deletion, notebook, summary, compaction, and graph operations each have clear purposes. Minor overlap exists between smart_recall and log_show (both retrieve stored content) and between code_lookup and graph_trace (both explore code), but the descriptions differentiate them well.

Naming Consistency3/5

All tools share the 'marm_' prefixaine, but the naming convention is inconsistent: some use noun phrases (marm_smart_recall, marm_log_entry, marm_graph_architecture), some use bare verbs (marm_delete), and some combine verb+object (marm_code_lookup, marm_log_show). The pattern is not uniform, making it slightly harder to predict tool names.

Tool Count4/5

The stated count is 14, but only 11 tools are documented, which is a notable discrepancy. Even so, the 11 visible tools cover memory management and code-graph analysis without feeling bloated; a handful of tools for each subdomain is reasonable.

Completeness4/5

The surface covers search, logging, notebook CRUD, summaries, compaction, and code-graph analysis (index, lookup, trace, architecture). Missing explicit update operations and a dedicated session-management tool, but these are partially handled via log_entry parameters. Overall well-rounded for a memory + code context server.

Maintenance

ActivityActive
ResponsivenessWithin a week

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    MCP server for persistent, compounding memory that automatically captures corrections and insights across AI sessions, enabling agents to learn and improve over time.
    5
    371
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to maintain persistent memory across sessions by capturing conversations, extracting durable knowledge, and injecting relevant context, supporting various MCP-compatible platforms.
    12
    MIT
  • A
    license
    B
    quality
    A
    maintenance
    MCP server providing persistent memory and context for AI tools, including semantic memory, knowledge graph, and session history to avoid starting from scratch in every conversation.
    35
    14
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server that provides AI agents with persistent memory, cross-agent sharing, and context management, enabling them to remember conversations, track complex tasks, and evolve skills across tools.
    2
    MIT