Product Memory
Product Memory
A what/why memory server for coding agents, over MCP. It answers what a piece of a system means and why it was built that way — down to the function level — so an agent (or you) stops re-deriving or re-breaking a decision someone already made. The current code stays the source of truth for how; this store never tries to replace it.
This repo ships with a small synthetic demo store (memory-store/) — two fictional services, orbitcart (checkout/payments) and beacon (notification dispatch) — so pm eval, the tests, and the MCP tools all run out of the box without pointing at anyone's real codebase. Point projects.yaml at your own repos to use it for real.
让它运行起来——无需编码经验
1. 下载。 选择任一更简单的方式:
如果你有 Git:打开终端并运行
git clone <this repo's URL>如果没有:在 GitHub 页面上,点击绿色的 Code 按钮 → Download ZIP,然后解压缩。
2. 在你刚刚下载的文件夹中打开终端。
Mac: 在 Finder 中找到该文件夹,右键点击它,选择 New Terminal at Folder(或打开 Terminal 并输入
cd,然后将文件夹拖入,再按回车)。Windows: 在文件资源管理器中打开该文件夹,按住 Shift 并右键点击内部空白处,选择 Open PowerShell window here。
Linux: 在文件管理器中右键点击该文件夹内部,选择 Open Terminal Here(因桌面环境而异)。
3. 运行设置脚本。
Mac / Linux: 输入
bash setup.sh并按回车。Windows: 输入
.\setup.ps1并按回车。如果提示脚本被阻止,先运行一次Set-ExecutionPolicy -Scope CurrentUser RemoteSigned,然后重试。
就这样——它会安装此项目所需的一切(不会安装到系统范围,无需管理员密码),构建附带的演示,并运行一次真实搜索以证明其有效。你会看到类似这样的内容:
✓ Python 3 found (3.13.5)
✓ uv found
✓ Dependencies installed
✓ Demo memory store indexed
Trying a real search against the demo store...
8.75 [adr/verified] adr-0004-idempotency-keys-generated-client-side
ADR-0004: idempotency keys are generated client-side, not server-side如果 Claude Code 已经在你的机器上,脚本会提供将 Product Memory 连接到它的选项——选择是,重启 Claude Code,它就会在每个项目中生效。如果没有,或者你使用不同的编码代理,请参阅下面的 MCP 工具,并将你的代理的 MCP 配置指向 uv run --directory <this folder> python -m product_memory.server。
运行起来后,试试:
uv run pm serve # a local web page to browse the memory
uv run pm search "your question here"当你准备真正使用它(而非演示)时,打开 projects.yaml,改为指向你自己的仓库。
Related MCP server: SyncContext
两个设计赌注
代理写入的任何内容在到达时都不会被信任。 通过 propose_memory 提出的每个事实都会获得 status: proposed——永远不会是 verified——直到有人运行 pm review。信任一个错误的记忆比错过一个正确的记忆代价更高,因此默认是“已写入”,而不是“为真”。
排名是实测出来的,而不是假设出来的。 pm eval 对关键词搜索(基于 SQLite FTS5 的 BM25)与语义向量索引在一组固定的、已知答案的真实问题上进行评分,并在每次运行时重新检查,而不是一次定论。这次运行中排名更好的一方就是排名更高的一方——在作者的私人语料库(1,192 条)中,关键词搜索的 MRR 为 0.785,而纯语义搜索为 0.436——向量索引仅作为额外召回追加在其下方,从不重新排序关键词的结果。在本仓库较小的 12 题演示集上,仅关键词搜索就已经能找到全部 12 题(pm eval → 0.819 MRR, 12/12);如果你想在比较中也包含语义/融合行,请先运行 pm embed。参见 eval/queries.json 和 product_memory/evaluate.py。
记忆如何被填充
绝不全量回填——那样在完成之前就已经过时了。有四种渠道:
# | 渠道 | 时机 | 落地的内容 |
1 | 文档导入 | 每仓库一次 | CLAUDE.md、CONVENTIONS.md、规划文档的指针/摘要——绝不复制副本 |
1b | 文档树导入 | 每个大型文档树一次 | 带硬过滤的批量导入(丢弃第三方文档、存根、重复项和“✅ Fixed!”会话报告) |
2 | 变更时捕获 | 每个完成的代理任务 | 代理调用 |
3 | 询问时回填 | 每当你问“为什么 X 像这样工作?”时 | 代理研究一次,回答你,并将答案作为记忆提出 |
布局
memory-store/ canonical store — markdown files in git, one fact each
_inbox/ agent proposals awaiting human promotion (or auto-approved, see below)
<project>/<repo>/ verified + promoted items
demo-repos/ tiny stub repos the demo store's code_symbol entries point at
projects.yaml registry: project -> repos -> disk paths
product_memory/
models.py data contracts (MemoryItem, TaskContext, WhyCard, ...)
store.py parse/iterate/propose store files
index.py SQLite FTS5 build + ranked search (disposable index)
semantic.py chunking + vector index, used for recall only
evaluate.py `pm eval` — MRR per retrieval mode, the ranking gate
conventions.py derive a repo's house style (declared + observed)
retrieval.py packet assembly (deterministic, no LLM)
staleness.py flags memories whose source code/doc changed since
server.py FastMCP stdio server — the MCP tools
webapp.py FastAPI local server (`pm serve`), loopback only
dashboard.py the review queue UI
ingest/ importers + secret redaction
cli.py `pm` — the commands below
eval/queries.json retrieval cases with known answers
tests/命令
pm serve # live local server: real search, feedback, persisted marks
pm dashboard --open # generate the standalone review-queue file
pm search "query" # ranked search from the terminal
pm eval # score retrieval against eval/queries.json — run before ranking changes
pm conventions --project beacon --repo beacon # derive a repo's house style
pm review # the only path from proposed to verified
pm index && pm embed # rebuild the keyword index and the chunked vector index
pm stale # notes whose source moved onMCP 工具
get_task_context · search_product_memory · get_project_overview · get_domain_rules · get_related_decisions · why_code(file, symbol) · get_recent_work · propose_memory(写入 proposed,或在脱敏后自动批准——参见 PM_REVIEW=1 强制隔离)
设置
刚接触这个并且只想让它跑起来?请改用 bash setup.sh(Windows 上为 .\setup.ps1)——参见上面的 让它运行起来。下面的手动步骤是相同内容的详细说明:
git clone <this repo>
cd product-memory
uv sync
uv run pytest
uv run python -m product_memory.cli eval # or: pm eval, once installed
# register for ALL repos (user scope):
claude mcp add --scope user product-memory -- \
uv run --directory "$PWD" python -m product_memory.server然后,将 projects.yaml 指向你自己的仓库,删除或保留演示用的 orbitcart/beacon 条目,并在工作中开始使用 propose_memory 捕获真实的记忆。
机密
写入存储的任何内容都会经过 redact_secrets——一个已知字面量列表(secret-literals.txt,已 gitignore,或 PM_SECRET_LITERALS)加上一个通用的凭据形状启发式规则(标签 + 邻近的高熵值)。演示存储不附带任何需要脱敏的内容;pm eval 的测试套件包含一个 CI 守卫(test_demo_store_is_clean),正是用来断言这一点。
许可证
MIT——参见 LICENSE。
Available Tools
9 toolsget_domain_rulesA
Verified invariants for a domain operation (e.g. 'wallet' / 'reverse transaction'). MANDATORY before money-path/auth/tenancy changes.
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | ||
| project | No | ||
| operation | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden of behavioral disclosure. It adds that the invariants are 'verified' and that the call is mandatory before sensitive changes, but it does not state whether the tool is read-only, whether it enforces anything, or what happens if invariants are violated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two terse sentences with no filler. It front-loads the core definition and then states the mandatory usage context, making it highly scannable and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description provides essential usage context and examples, and an output schema exists to cover return values. However, with no annotations and no schema-level parameter descriptions, the project parameter remains ambiguous and the tool's behavioral profile is incompletely specified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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. The examples give some semantics for 'domain' and 'operation', but the optional 'project' parameter is left completely unexplained, and valid values are not enumerated.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states that the tool returns verified invariants for a domain operation and gives concrete examples ('wallet' / 'reverse transaction'). This clearly differentiates it from sibling tools like get_recent_work or get_project_overview, though it does not explicitly name an alternative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says this is MANDATORY before money-path/auth/tenancy changes, providing a clear trigger condition. It does not mention when not to use it or point to alternative tools, so it stops 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.
get_project_overviewB
Product purpose, service map, boundaries, and critical rules for a project/repository. Call when entering a repo for the first time.
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | ||
| repository | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears the full burden. It discloses neither safety/side effects nor output format, authentication, pagination, or data volume. The 'get' name implies read-only behavior, but the description itself doesn't confirm this or any limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences with no filler. The content list is front-loaded, and the usage trigger is stated separately. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple 2-parameter read tool, the description is reasonably complete, but it doesn't define parameter semantics or distinguish itself from overlapping sibling tools. With no output schema and no annotations, an agent is left to guess the exact call shape and return style.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the schema only provides parameter titles. The description's phrase 'a project/repository' touches on the domain but does not explain the distinction between 'project' and 'repository', their optionality, or behavior when 'repository' is null.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names the resource ('project/repository') and enumerates the deliverable contents ('Product purpose, service map, boundaries, and critical rules'), which clearly distinguishes it from sibling tools. It lacks an explicit retrieval verb, but the tool name plus content list make the action clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives an explicit trigger: 'Call when entering a repo for the first time.' This is clear context but doesn't mention when not to use it or contrast it with overlapping siblings like get_domain_rules or read_memory.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_recent_workC
Worklog: what was done and why, newest first. since = ISO date.
| Name | Required | Description | Default |
|---|---|---|---|
| since | No | ||
| project | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses the result content and sort order, and hints that 'since' is an ISO date, but it does not explain that 'since' filters entries or describe the effect of omitting it. The read-only nature is implied by the verb 'get' but not made explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The definition is short and front-loaded with the core purpose, with no filler. The 'since = ISO date' note is terse but acceptable, so it loses a point only for being cryptic rather than explanatory.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value documentation is not required. However, the description fails to document the 'project' parameter and does not clarify what 'since' actually does. For a two-parameter read tool this is an incomplete guide.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 for both parameters. It only covers 'since' with a format hint (ISO date) but not its filtering semantics, and it omits the 'project' parameter entirely.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the resource (worklog), the content ('what was done and why'), and the ordering ('newest first'). It distinguishes itself as a worklog tool among memory/decision siblings, though it does not name a contrasting tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus the sibling tools. There are no alternatives named and no exclusions stated, so an agent must guess when a worklog lookup is appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_task_contextA
Compact task-specific packet: architecture, business rules, gotchas, code pointers, risks, verification steps. Call BEFORE planning.
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | ||
| paths | No | ||
| project | No | ||
| repository | No | ||
| incident_id | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| risks | No | |
| gotchas | No | |
| conflicts | No | |
| freshness | No | |
| architecture | No | |
| verification | No | |
| relevant_code | No | |
| business_rules | No | |
| integration_rules | No | |
| task_understanding | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the behavioral disclosure burden. It usefully reveals what the returned packet contains and that it should precede planning, but it does not explicitly state whether the operation is read-only, whether it has side effects, or what permissions/inputs beyond the obvious are needed. Some transparency is present, but the safety profile is left implicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single compact sentence with a colon-delimited list of contents followed by a direct, imperative usage rule. It is front-loaded, scannable, and contains no filler or redundant restatement of the tool name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema, the description does not need to explain return values, and it covers the main high-level contents and invocation timing well. It is slightly incomplete in that it omits guidance on optional scoping parameters and sibling-tool differentiation, but it is adequate for a task-context retrieval tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description provides no parameter-level guidance. The field names (task, paths, project, repository, incident_id) are partially self-explanatory, and 'task-specific' aligns with the required 'task' parameter, but the description does not clarify how optional parameters interact, which combinations are valid, or what values are expected. In a low-coverage situation, the description should compensate and does not.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description identifies a specific resource—a task-specific packet—and enumerates its contents (architecture, business rules, gotchas, code pointers, risks, verification steps), which makes the tool's purpose fairly clear. It stops short of a strong action verb like 'retrieve' or 'build', but the intent is unambiguous and distinct from broader sibling tools like get_project_overview.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The explicit 'Call BEFORE planning' gives clear temporal guidance, telling an agent when in the workflow this tool should be invoked. It does not explicitly compare against alternatives or state when not to use the tool, but the timing guidance is strong enough for a 4.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
propose_memoryA
Record a new memory. Auto-approved by default; set PM_REVIEW=1 to queue
it for pm review instead.
Auto-approve is the default because a proposal sitting in the inbox is a fact
the next session does not have — the queue was the thing between writing a
memory and being able to use it. Redaction and collision-safety are NOT
relaxed by it: secrets are still stripped before the write (the store is
committed to git) and an id clash still suffixes rather than overwrites.
Auto-approved entries record verified_by="auto", so a reader can tell a
machine-approved note from one a person checked.
Use at task completion: one type='code_symbol' entry per function you added
or meaningfully changed (body: WHAT: / WHY: / NEED: / WHY THIS WAY: /
GOTCHA:), passing refs with the PRD, spec or ticket that asked for it,
plus one type='worklog' entry for the task itself. Also use to record the
answer when the user asks "why does X work this way?".
Never include credentials, tokens, or passwords — this store is committed to git.
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| refs | No | ||
| tags | No | ||
| type | Yes | ||
| title | Yes | ||
| source | No | ||
| symbol | No | ||
| content | Yes | ||
| project | Yes | ||
| repository | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations present, the description carries the full burden and it delivers: it discloses auto-approval default, the PM_REVIEW=1 escape hatch, that redaction/collision-safety are NOT relaxed, that secrets are stripped because the store is committed to git, that id clashes suffix rather than overwrite, and that auto-approved entries carry verified_by='auto'. It also warns against credentials — comprehensive side-effect disclosure well beyond the minimum.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four dense paragraphs, front-loaded with the action and the one flag (PM_REVIEW=1) an agent must know first; the rationale sentence explains why auto-approve is the default, which prevents the agent from second-guessing the contract. Minor redundancy exists ('committed to git' appears twice) and the middle rationale paragraph could be tightened, but no sentence is wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 10-parameter write tool with no annotations and no output schema, the description covers the essential ground: purpose, approval behavior, safety constraints, usage recipes, and the required refs/content formats. The gaps are the unexplained parameters (symbol, source, file, repository, tags) and the absence of any statement about return values or success signals, though the behavioral contract is unusually complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate — and it does for the high-stakes parameters: type is given concrete values ('code_symbol', 'worklog'), refs is explained as PRD/spec/ticket references, and content gets a full WHAT/WHY/NEED/WHY THIS WAY/GOTCHA template. However, symbol, source, file, repository, and tags get no semantic explanation, leaving ambiguity around the symbol/file/repository distinction.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Opens with 'Record a new memory' — a specific verb plus resource — and immediately extends into the behavioral contract (auto-approved by default, PM_REVIEW=1 queue). All eight siblings are read/query tools (get_, search_, read_, why_), so the write verb clearly separates this tool; the concrete use cases (code_symbol per function, worklog entry, 'why does X work this way?' answers) make the purpose unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The third paragraph is a direct usage instruction: 'Use at task completion' with a precise recipe — one type='code_symbol' entry per changed function, the WHAT/WHY/NEED/WHY THIS WAY/GOTCHA body format, refs pointing at PRD/spec/ticket, plus a worklog entry — and a second trigger ('record the answer when the user asks why does X work this way?'). It doesn't name read-sibling alternatives explicitly, but the write-vs-read split plus the concrete triggers make when-to-use unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_memoryA
The FULL body of one memory, by the id a search hit returned.
The counterpart to snippet results: search gives you the passage that matched and enough to choose from, this gives you the whole note once you have chosen. Returns None when the id is unknown, which is the honest answer for a stale id from an older session rather than a guess at the nearest match.
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It clearly discloses that this returns the full note rather than a snippet, and that it returns None for unknown/stale ids instead of guessing a nearest match. This is precise and honest behavioral disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, each earning its place: the core behavior, the relationship to search, and the edge-case return behavior. The most important information is front-loaded, and there is no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple, has one parameter, and has an output schema. The description covers the source of the id, the return behavior, and the stale-id edge case, so nothing essential is missing for an agent to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema only provides a string type and parameter name, so the description must compensate. It does so by explaining that memory_id is specifically the id a search hit returned, and that stale ids from older sessions are possible. This adds essential meaning not present in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: it reads the FULL body of one memory by id. It also distinguishes itself from search_product_memory by positioning itself as the counterpart to snippet results.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says to use this tool after search has returned a hit and enough context to choose, then calls out that this retrieves the whole note. It names the alternative workflow (search gives the passage) and the correct sequencing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_product_memoryA
Ranked search over all verified product/architecture/incident memory.
Returns a SNIPPET of each hit — the passage that matched — plus store_path.
Read the file when a snippet turns out to be the thing; full=True returns
whole bodies, which costs roughly five times as much for a list you are
mostly scanning to choose from.
| Name | Required | Description | Default |
|---|---|---|---|
| full | No | ||
| limit | No | ||
| query | Yes | ||
| project | No | ||
| repository | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden and does well: it states the tool returns snippets plus `store_path`, explains the cost tradeoff of `full=True` ('costs roughly five times as much'), and implies read-only behavior through 'search' and 'returns.' It does not detail rate limits or authorization, but for a search tool the key behavioral aspects (output format, performance) are covered.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact (about 60 words), front-loaded with the core purpose, and each subsequent sentence adds vital operational detail (return format, follow-up action, cost tradeoff). There is no filler or repeated schema information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite the lack of parameter descriptions and annotations, the description covers the essential agent workflow: search by query, inspect snippets, read a file when relevant, or request full bodies at a known cost. The presence of an output schema excuses deeper return-value detail, but the intended meaning of project/repository filters remains under-specified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 the `full` parameter meaningfully (snippets vs. whole bodies, cost), but `query`, `limit`, `project`, and `repository` receive no elaboration—their meanings are left to inference from names and types. The description adds some semantic value but leaves significant gaps for filtering parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Ranked search over all verified product/architecture/incident memory,' naming a specific verb (search), a distinct resource (verified memory), and a clear scope. This differentiates it from siblings like read_memory (which reads files by path rather than searching content) without needing to reference them explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives actionable workflow guidance: 'Read the file when a snippet turns out to be the thing' and explains when to use `full=True` versus scanning snippets. This effectively contrasts the tool with file-read alternatives, though it does not explicitly discuss when to prefer search_product_memory over other sibling search-like tools such as get_related_decisions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
why_codeA
WHAT/WHY/WHY-THIS-WAY/GOTCHA card for a function or file. Call before rewriting existing code so past decisions aren't undone blindly.
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| symbol | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It communicates an informational purpose and implies a safe read-only operation, but it does not explicitly state that it has no side effects, what happens when no card exists, or any permission requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single front-loaded sentence that wastes no words. It packs the tool's purpose, output type, and usage timing into a compact, readable form.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given only two parameters, an output schema, and a clear usage directive, the description is largely complete for invocation. The main gap is not explaining how it differs from closely related siblings like get_related_decisions, but that is not required for a correct call.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. 'Function or file' loosely maps to the `file` and optional `symbol` parameters, but the description never explicitly connects those concepts to the parameter names or explains the optional/nullable behavior of `symbol`.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool as a 'WHAT/WHY/WHY-THIS-WAY/GOTCHA card' for a function or file, with the explicit purpose of surfacing past decisions before rewriting. This distinguishes it from sibling retrieval tools like read_memory or get_project_overview by anchoring it to code-specific rationale.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly states when to call: 'before rewriting existing code.' It does not list exclusions or name alternative sibling tools, but the when-to-use 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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
9 tool updates
v0.1.0- First observed
get_domain_rules - First observed
get_project_overview - First observed
get_recent_work - First observed
get_related_decisions - First observed
get_task_context - First observed
propose_memory - First observed
read_memory - First observed
search_product_memory - First observed
why_code
TDQS
Scored across 9 tools
The tools have mostly clear, distinct purposes: search vs. read, context retrieval vs. rule retrieval, and write vs. read. However, the context-retrieval tools (get_project_overview, get_task_context, get_domain_rules, get_related_decisions) overlap somewhat and rely on descriptions to tell them apart, and search_product_memory with full=True partially duplicates read_memory.
Most tools follow a consistent get_/search_/read_/propose_ verb pattern, which makes the set predictable. why_code breaks the pattern as a noun-style tool name, and the mix of get_ with search_/read_ is a minor deviation.
Nine tools is well within the ideal range for a product memory server, and each tool covers a distinct retrieval or write need. The count feels appropriately scoped without being bloated or thin.
The surface covers the core lifecycle well: search, read, targeted context retrieval, recent work, and recording new memories. There is no explicit update/delete/invalidation tool for memories, though the append-only/id-suffix design suggests this may be intentional; still, explicit correction would make it more complete.
Related MCP Connectors
An MCP memory server. One memory your agents share — across models, devices and apps.
Hosted MCP memory for coding agents: persistent across sessions, editable markdown, team sharing.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
- KogniteOAuthdev.kognite
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Related MCP Servers
- AlicenseBqualityAmaintenancePersistent memory MCP server that captures coding session context and automatically injects relevant memories into prompts using hybrid search for OpenCode and Claude Code.1473MIT
- AlicenseAqualityDmaintenanceMCP server that provides a shared semantic memory layer for AI coding agents, enabling teams to store, search, and sync context, decisions, and knowledge across projects with project-based isolation and multi-backend support.141MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that captures and recalls coding session memory (failures, decisions, diffs) for AI agents, enabling cross-agent continuity and preventing repeated mistakes.68 npmMIT
- AlicenseAqualityAmaintenanceMCP server that gives coding agents persistent, verified memory of codebase decisions, conventions, and skills, with evidence-based claims that are re-checked via git hooks and human-gated review. Enables memory search, propose/approve, chat harvesting, and critique across MCP-compatible tools.21294 npm1MIT