Conversation
- Add behavioral hook via before_prompt_build that fires every turn (~50 tokens) — agent now proactively saves and searches in all modes - Rename config: sessionContext, sessionDigest, digestMinInterval, maxContextResults (old names work as silent aliases) - Migrate session context from legacy before_agent_start to before_prompt_build Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sessionContext/sessionDigest/maxContextResults/digestMinInterval replace old names in operating modes table, config table, hook surface, and file descriptions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…est default true memory_search now includes relatedThreads (past conversation snippets) alongside memory results. Thread search is best-effort via GET /threads/search. sessionDigest default changed from false to true - negligible cost, conversations captured automatically. Version bumped to 0.6.4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two new tools for progressive conversation retrieval: - nowledge_mem_thread_search: search past conversations by keyword - nowledge_mem_thread_fetch: fetch full messages with pagination Memories distilled from conversations now include sourceThreadId in search results and individual lookups, enabling agents to trace any memory back to its source conversation and retrieve the full context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Per-turn flow, tool decision table, session lifecycle capture, and progressive retrieval chain diagrams. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add pre-save dedup check: skip saves when ≥90% similarity match exists - Behavioral hook adjusts for sessionContext mode (reduces redundant searches) - README: honest Design Decisions section with Q&A on retrieval, dedup, modes - CHANGELOG: document dedup + context-aware guidance in 0.6.5 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ter, docs accuracy - package.json version: 0.6.3 → 0.6.5 (sync with openclaw.plugin.json) - forget.js: require ≥0.85 score for auto-delete (was deleting single low-score results) - client.js: pass source filter to CLI in searchThreadsFull (was silently ignored) - README: add apiUrl/apiKey to Configuration table with valid ranges - CLAUDE.md: update capture.js and behavioral.js descriptions to match current code Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ad pagination - sourceThreadId in search/show/query results for thread provenance - Structured save: unit_type, event_start/end, temporal_context - Save dedup guard: blocks at >=90% similarity - Thread pagination: offset/limit in thread_show - Thread source filter in thread_search - Behavioral guidance: proactive save nudge + sourceThreadId awareness - Updated CLI args: --limit/--offset/--source (requires nmem-cli >=0.6) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add apiUrl/apiKey settings for connecting to a remote Mem instance. API key injected via env var only (never as CLI arg, never logged). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
deactivate() was creating NowledgeMemClient without apiUrl/apiKey, so auto-capture on quit would fail in remote mode (tried localhost). Also update CLAUDE.md to reflect v0.6.1 settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… labels - npx search-memory: add --unit-type filter, document source_thread field - npx distill-memory: add --unit-type and -l flags to options and examples - npx README: add unit_type + labels to create memory example - npx CHANGELOG: add 0.3.0 entry - codex distill.md: add --unit-type and -l to template and example - examples AGENTS.md: fix category names to match actual unit_type values Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reports connection mode (local/remote), API URL, API key configured (boolean), CLI availability, server connectivity, and current settings. Useful for verifying Access Anywhere configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…isposables
activate() now returns { dispose } per Alma API contract. Tool and event
registrations collect Disposable handles for proper cleanup on deactivation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ials Settings (apiUrl, apiKey, recallPolicy, autoCapture, maxRecallResults) were read once at activation and never updated. Changing Access Anywhere credentials in Alma settings had no effect until plugin reload. Now listens to settings.onDidChange() and recreates the client with fresh credentials immediately. All tool closures see the updated client via let-binding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR standardizes memory taxonomy to Changes
Sequence DiagramssequenceDiagram
participant User
participant Plugin
participant MemoryService
participant ThreadService
User->>Plugin: Save memory (text, unit_type, labels)
Plugin->>MemoryService: searchRich(query) — dedup check
alt Found ≥90% similar
MemoryService-->>Plugin: existing memory (id, similarity)
Plugin->>User: Return skipped save (duplicate, existingId)
else No duplicate
Plugin->>MemoryService: store(item with unit_type, temporal, labels)
MemoryService-->>Plugin: saved item (id, sourceThreadId)
Plugin->>User: Return saved summary
end
sequenceDiagram
participant Client
participant MemoryService
participant ThreadService
participant Plugin
Client->>MemoryService: searchRich(query, limit)
MemoryService-->>Client: memories (each may include sourceThreadId)
Client->>ThreadService: searchThreadsFull(query, {limit, source})
ThreadService-->>Client: threads metadata & matchedMessages
Client->>Plugin: Enrich memories with relatedThreads
Plugin->>Client: Return combined results
sequenceDiagram
participant Agent
participant Plugin
participant BehavioralHook
participant MemoryService
participant WorkingMemory
Note over Agent,Plugin: Per-turn prompt construction
Agent->>Plugin: before_prompt_build
Plugin->>BehavioralHook: buildBehavioralHook(sessionContext)
BehavioralHook-->>Agent: prepend guidance (session-aware)
alt sessionContext enabled
Plugin->>MemoryService: searchRich(context, maxContextResults)
MemoryService-->>Plugin: relevant memories
Plugin->>WorkingMemory: inject memories
end
Agent->>Agent: construct prompt
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
examples/AGENTS.md (1)
81-81:⚠️ Potential issue | 🟡 MinorUpdate agent instructions to use new unit-type taxonomy.
Line 81 still references the old category names (insight/experience) which are inconsistent with the new unit-type taxonomy (learning/event) introduced earlier in the document.
📝 Proposed fix to align with new taxonomy
-2. Categorize (insight/decision/fact/procedure/experience) +2. Categorize (learning/decision/fact/procedure/event)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/AGENTS.md` at line 81, Replace the outdated category names in the agent instruction string "2. Categorize (insight/decision/fact/procedure/experience)" to match the new unit-type taxonomy by changing the listed categories to the new terms (e.g., use "learning" and "event" where appropriate) so the instruction reads consistently with the taxonomy used earlier in the document; update any sibling occurrences of the old names in the same section to the new unit-type names to ensure consistency across the agent guidance.
🧹 Nitpick comments (3)
nowledge-mem-npx-skills/skills/search-memory/SKILL.md (1)
101-101: Clarify provenance field naming across surfaces (source_threadvssourceThreadId).At Line 101, consider a short note about field-name mapping (CLI snake_case vs tool/API camelCase) to prevent lookup mistakes when users switch contexts.
Based on learnings: Preserve thread metadata integrity by maintaining
external_id, session/source fields in memory operations.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nowledge-mem-npx-skills/skills/search-memory/SKILL.md` at line 101, Doc clarifies that provenance field names differ across surfaces and should map consistently: add a brief note near the sentence mentioning `source_thread` to state that the CLI uses snake_case (`source_thread`) while APIs/tools use camelCase (`sourceThreadId`), and remind readers to use the CLI command `nmem --json t show <thread_id>` to fetch the full conversation and that memory records retain `external_id` and session/source metadata during operations; ensure the note references `source_thread`, `sourceThreadId`, `nmem --json t show <thread_id>`, and `external_id` so users know which fields to look up in each context.examples/AGENTS.md (1)
86-88: Consider adding--unit-typeto the agent example for consistency.The memory-keeper agent example doesn't include the
--unit-typeflag, which is demonstrated as best practice in the earlier examples (lines 24, 29). For consistency and to reinforce the new taxonomy, consider adding it.♻️ Suggested enhancement for consistency
nmem m add "Root cause: API rate limiting missing exponential backoff" \ -t "API Rate Limiting Fix" \ - -i 0.7 + -i 0.7 --unit-type learning🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/AGENTS.md` around lines 86 - 88, The agent example using the "nmem m add" command is missing the --unit-type flag used elsewhere; update the example invocation of nmem m add (the line starting with nmem m add "Root cause: API rate limiting missing exponential backoff") to include a --unit-type value consistent with prior examples (e.g., --unit-type issue or --unit-type finding) so it matches the taxonomy shown in earlier examples and reinforces the expected flag usage.nowledge-mem-openclaw-plugin/README.md (1)
250-257: Add language specifier to fenced code block.The code block is missing a language identifier. Since this shows CLI-style output, consider using
textorplaintextfor syntax highlighting consistency.📝 Suggested fix
-``` +```text threadId: "openclaw-db-arch-a1b2c3" offset: 0, limit: 50 -> Thread: "Database architecture discussion" (128 messages)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nowledge-mem-openclaw-plugin/README.md` around lines 250 - 257, The fenced code block showing CLI-style output (containing "threadId: \"openclaw-db-arch-a1b2c3\"", offset/limit lines and the Thread line) in README.md is missing a language specifier; edit that fenced block to add a language identifier such as text or plaintext (e.g., ```text) so the snippet renders with consistent plaintext/CLI highlighting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/AGENTS.md`:
- Around line 7-16: Replace the outdated category names "insight" and
"experience" in the "Categorize" step with the current taxonomy by changing the
text to "Categorize (learning/decision/fact/procedure/event)"; update the
example command that creates memories to include the --unit-type flag and use
one of the new categories (e.g., add --unit-type learning or --unit-type
decision) so the example follows the "Creating Memories" pattern and matches the
Memory Types list.
In `@nowledge-mem-openclaw-plugin/src/tools/forget.js`:
- Around line 90-91: The code currently auto-deletes based only on
results[0].score >= 0.85 even when multiple candidates exist; change the
condition to only auto-delete when there is exactly one candidate with high
confidence (e.g., results.length === 1 && results[0].score >= 0.85) and
otherwise fall back to the existing disambiguation/confirmation path (do not
perform the delete operation in the "High-confidence match — delete directly"
block unless that single-candidate check passes), updating the if that
references results and results[0].score accordingly so ambiguous multi-candidate
cases require explicit confirmation.
In `@nowledge-mem-openclaw-plugin/src/tools/thread-search.js`:
- Around line 43-45: The current assignment of the local variable `source` uses
String(safeParams.source).trim() but leaves whitespace-only input as an empty
string, which behaves as an active filter; change the logic where `source` is
defined (the `source` variable near `safeParams.source` in thread-search.js) so
that after trimming you set `source` to undefined when the trimmed result is an
empty string (i.e., treat `""` as no filter), ensuring downstream code receives
undefined instead of an empty string.
---
Outside diff comments:
In `@examples/AGENTS.md`:
- Line 81: Replace the outdated category names in the agent instruction string
"2. Categorize (insight/decision/fact/procedure/experience)" to match the new
unit-type taxonomy by changing the listed categories to the new terms (e.g., use
"learning" and "event" where appropriate) so the instruction reads consistently
with the taxonomy used earlier in the document; update any sibling occurrences
of the old names in the same section to the new unit-type names to ensure
consistency across the agent guidance.
---
Nitpick comments:
In `@examples/AGENTS.md`:
- Around line 86-88: The agent example using the "nmem m add" command is missing
the --unit-type flag used elsewhere; update the example invocation of nmem m add
(the line starting with nmem m add "Root cause: API rate limiting missing
exponential backoff") to include a --unit-type value consistent with prior
examples (e.g., --unit-type issue or --unit-type finding) so it matches the
taxonomy shown in earlier examples and reinforces the expected flag usage.
In `@nowledge-mem-npx-skills/skills/search-memory/SKILL.md`:
- Line 101: Doc clarifies that provenance field names differ across surfaces and
should map consistently: add a brief note near the sentence mentioning
`source_thread` to state that the CLI uses snake_case (`source_thread`) while
APIs/tools use camelCase (`sourceThreadId`), and remind readers to use the CLI
command `nmem --json t show <thread_id>` to fetch the full conversation and that
memory records retain `external_id` and session/source metadata during
operations; ensure the note references `source_thread`, `sourceThreadId`, `nmem
--json t show <thread_id>`, and `external_id` so users know which fields to look
up in each context.
In `@nowledge-mem-openclaw-plugin/README.md`:
- Around line 250-257: The fenced code block showing CLI-style output
(containing "threadId: \"openclaw-db-arch-a1b2c3\"", offset/limit lines and the
Thread line) in README.md is missing a language specifier; edit that fenced
block to add a language identifier such as text or plaintext (e.g., ```text) so
the snippet renders with consistent plaintext/CLI highlighting.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (29)
examples/AGENTS.mdnowledge-mem-alma-plugin/CHANGELOG.mdnowledge-mem-alma-plugin/CLAUDE.mdnowledge-mem-alma-plugin/README.mdnowledge-mem-alma-plugin/alma-skill-nowledge-mem.mdnowledge-mem-alma-plugin/main.jsnowledge-mem-alma-plugin/manifest.jsonnowledge-mem-codex-prompts/distill.mdnowledge-mem-npx-skills/CHANGELOG.mdnowledge-mem-npx-skills/README.mdnowledge-mem-npx-skills/skills/distill-memory/SKILL.mdnowledge-mem-npx-skills/skills/search-memory/SKILL.mdnowledge-mem-openclaw-plugin/CHANGELOG.mdnowledge-mem-openclaw-plugin/CLAUDE.mdnowledge-mem-openclaw-plugin/README.mdnowledge-mem-openclaw-plugin/openclaw.plugin.jsonnowledge-mem-openclaw-plugin/package.jsonnowledge-mem-openclaw-plugin/src/client.jsnowledge-mem-openclaw-plugin/src/config.jsnowledge-mem-openclaw-plugin/src/hooks/behavioral.jsnowledge-mem-openclaw-plugin/src/hooks/capture.jsnowledge-mem-openclaw-plugin/src/hooks/recall.jsnowledge-mem-openclaw-plugin/src/index.jsnowledge-mem-openclaw-plugin/src/tools/forget.jsnowledge-mem-openclaw-plugin/src/tools/memory-get.jsnowledge-mem-openclaw-plugin/src/tools/memory-search.jsnowledge-mem-openclaw-plugin/src/tools/save.jsnowledge-mem-openclaw-plugin/src/tools/thread-fetch.jsnowledge-mem-openclaw-plugin/src/tools/thread-search.js
There was a problem hiding this comment.
♻️ Duplicate comments (1)
nowledge-mem-openclaw-plugin/src/tools/forget.js (1)
91-98:⚠️ Potential issue | 🟠 MajorPrevent auto-delete when multiple matches exist (destructive behavior mismatch).
At Line 97, deletion can still proceed with multiple candidates (
topScore - runnerUp > 0.2). That conflicts with the tool contract (“multiple matches → user confirmation”) and can still delete the wrong memory in edge cases.🔧 Proposed fix
- // Requires clear winner: top score >= 0.85 AND either only one result - // or a significant gap (>0.2) between top and second result + // Requires a single high-confidence match const topScore = results[0].score; - const runnerUp = results.length > 1 ? results[1].score : 0; - if ( - topScore >= 0.85 && - (results.length === 1 || topScore - runnerUp > 0.2) - ) { + if (results.length === 1 && topScore >= 0.85) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nowledge-mem-openclaw-plugin/src/tools/forget.js` around lines 91 - 98, The current auto-delete condition (using topScore, runnerUp, and results) still permits deletion when multiple matches exist if the score gap >0.2; change the logic so auto-delete only occurs when there is exactly one match. Update the if that references topScore, runnerUp, and results so it requires results.length === 1 AND topScore >= 0.85 for automatic deletion, and otherwise fall through to the user-confirmation path (i.e., do not rely on topScore - runnerUp > 0.2 to bypass confirmation).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@nowledge-mem-openclaw-plugin/src/tools/forget.js`:
- Around line 91-98: The current auto-delete condition (using topScore,
runnerUp, and results) still permits deletion when multiple matches exist if the
score gap >0.2; change the logic so auto-delete only occurs when there is
exactly one match. Update the if that references topScore, runnerUp, and results
so it requires results.length === 1 AND topScore >= 0.85 for automatic deletion,
and otherwise fall through to the user-confirmation path (i.e., do not rely on
topScore - runnerUp > 0.2 to bypass confirmation).
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
nowledge-mem-openclaw-plugin/src/tools/forget.jsnowledge-mem-openclaw-plugin/src/tools/thread-search.js
🚧 Files skipped from review as they are similar to previous changes (1)
- nowledge-mem-openclaw-plugin/src/tools/thread-search.js
Summary by CodeRabbit
New Features
Configuration
Documentation