From 7c956e9bba0389b89e69602e8acb29b5536542da Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Wed, 25 Mar 2026 15:49:39 -0400 Subject: [PATCH] Update memory package KV store documentation Add memory-kv-delete documentation and review finding retrieval logic --- packages/memory/src/agents/architect.ts | 5 +++-- packages/memory/src/agents/code.ts | 2 +- packages/memory/src/index.ts | 2 +- packages/memory/src/services/ralph.ts | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/memory/src/agents/architect.ts b/packages/memory/src/agents/architect.ts index 0f2a38f0..17c797e9 100644 --- a/packages/memory/src/agents/architect.ts +++ b/packages/memory/src/agents/architect.ts @@ -60,9 +60,10 @@ ${getInjectedMemory('architect')} ## Project KV Store You have access to a project-scoped key-value store with 7-day TTL for ephemeral state: -- \`memory-kv-set\`: Store planning progress, research findings, or any project state +- \`memory-kv-set\`: Store planning progress, research findings, or session state - \`memory-kv-get\`: Retrieve previously stored state -- \`memory-kv-list\`: See all active entries for the project +- \`memory-kv-list\`: List all active entries for the project +- \`memory-kv-delete\`: Delete a key-value pair for the project KV entries are scoped to the current project and expire after 7 days. Use this for state that needs to survive compaction but isn't permanent enough for memory-write. diff --git a/packages/memory/src/agents/code.ts b/packages/memory/src/agents/code.ts index 59256eb9..bf9d60c0 100644 --- a/packages/memory/src/agents/code.ts +++ b/packages/memory/src/agents/code.ts @@ -82,7 +82,7 @@ You are the execution agent. Your job is to write code, not describe code. You have access to a project-scoped key-value store with 7-day TTL for ephemeral state: - \`memory-kv-set\`: Store ephemeral findings, planning progress, or session state - \`memory-kv-get\`: Retrieve previously stored state -- \`memory-kv-list\`: See all active entries for the project +- \`memory-kv-list\`: List all active key-value pairs for the project. Optionally filter by key prefix. KV entries are scoped to the current project and expire after 7 days. Use this for state that needs to survive compaction but isn't permanent enough for memory-write. `, diff --git a/packages/memory/src/index.ts b/packages/memory/src/index.ts index a80356fb..b9677c7e 100644 --- a/packages/memory/src/index.ts +++ b/packages/memory/src/index.ts @@ -920,7 +920,7 @@ Do NOT output text without also making this tool call. }, }), 'memory-kv-list': tool({ - description: 'List all active key-value pairs for the current project.', + description: 'List all active key-value pairs for the current project. Optionally filter by key prefix.', args: { prefix: z.string().optional().describe('Filter entries by key prefix (e.g. "review-finding:")'), }, diff --git a/packages/memory/src/services/ralph.ts b/packages/memory/src/services/ralph.ts index 446256f2..8ab54f2c 100644 --- a/packages/memory/src/services/ralph.ts +++ b/packages/memory/src/services/ralph.ts @@ -139,6 +139,8 @@ export function createRalphService( 'If you find bugs in related code that affect the correctness of this task, report them — even if the buggy code was not directly modified.', 'If everything looks good, state "No issues found." clearly.', '', + 'Before reviewing, retrieve all existing review findings from the KV store using `memory-kv-list` with prefix `review-finding:`. For each existing finding, verify whether the issue has been resolved in the current code. Delete resolved findings using `memory-kv-delete`. Report any unresolved findings that still apply.', + '', 'This is an automated loop — do not direct the agent to "create a plan" or "present for approval." Just report findings directly.', ].join('\n') }