Skip to content

Commit b6bf292

Browse files
Revert "Give librarian agent KV store cleanup responsibilities"
This reverts commit fd634c9.
1 parent fd634c9 commit b6bf292

1 file changed

Lines changed: 2 additions & 36 deletions

File tree

packages/memory/src/agents/librarian.ts

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ export const librarianAgent: AgentDefinition = {
55
role: 'librarian',
66
id: 'ocm-librarian',
77
displayName: 'librarian',
8-
description: 'Expert agent for managing project memory - storing and retrieving conventions, decisions, context, and session progress. Also cleans up stale KV store entries.',
8+
description: 'Expert agent for managing project memory - storing and retrieving conventions, decisions, context, and session progress',
99
mode: 'subagent',
1010
temperature: 0.0,
1111
tools: {
12-
exclude: ['memory-plan-execute', 'memory-plan-ralph', 'memory-health', 'memory-kv-set'],
12+
exclude: ['memory-plan-execute', 'memory-plan-ralph', 'memory-health', 'memory-kv-set', 'memory-kv-get', 'memory-kv-list'],
1313
},
1414
systemPrompt: `You are a memory management agent. Your purpose is to capture, organize, and retrieve knowledge that persists across sessions.
1515
@@ -142,31 +142,6 @@ Maintain quality over quantity:
142142
- If asked about something with no memories, say so clearly
143143
- "No memories found about testing strategy—would you like to create one?"
144144
145-
## KV Store Cleanup
146-
147-
In addition to managing permanent memories, you are responsible for cleaning up stale entries in the project KV store. The KV store holds ephemeral data like audit findings (prefixed with \`review-finding:\`) and Ralph loop state (prefixed with \`ralph:\`).
148-
149-
When invoked for curation or cleanup:
150-
151-
1. **List all KV entries**: Call \`memory-kv-list\` to see all active entries. Optionally use prefix filters like \`review-finding:\` to narrow results.
152-
153-
2. **Identify stale entries**: An entry is stale if:
154-
- The file referenced in the key no longer exists in the project
155-
- The branch referenced in the value has been merged or deleted
156-
- The finding describes code that has been significantly refactored (line no longer matches the described issue)
157-
158-
3. **Verify before deleting**: For each candidate:
159-
- Read the full KV value with \`memory-kv-get\` to understand the finding
160-
- Check if the referenced file still exists (use Glob or Read)
161-
- If the file exists, check if the code at the referenced line still matches the described issue
162-
- Check if the branch still exists: \`git branch -a | grep <branch>\`
163-
164-
4. **Delete confirmed stale entries**: Use \`memory-kv-delete\` for entries confirmed as stale.
165-
166-
5. **Report what was cleaned**: In your response, list deleted entries and the reason each was removed.
167-
168-
Do NOT delete entries that are still valid — when in doubt, leave them. The 7-day TTL provides a safety net for anything you miss.
169-
170145
## Response Format
171146
172147
When responding to memory queries, use this structure:
@@ -225,15 +200,6 @@ You are NOT needed for:
225200
4. **memory-delete**: Remove memories by ID
226201
- id: The memory ID to delete
227202
228-
5. **memory-kv-list**: List all active KV entries for the project
229-
- prefix: Optional prefix filter (e.g., "review-finding:")
230-
231-
6. **memory-kv-get**: Retrieve a KV entry by key
232-
- key: The exact key to retrieve
233-
234-
7. **memory-kv-delete**: Delete a KV entry by key
235-
- key: The exact key to delete
236-
237203
${INJECTED_MEMORY_HEADER}
238204
239205
- **[convention]**: Rules the project follows — verify these are current when encountered

0 commit comments

Comments
 (0)