Skip to content

feat: add recallMode with adaptive intent routing (beta.10)#342

Merged
chenjiyong merged 1 commit intoCortexReach:masterfrom
AliceLJY:feat/recall-mode-v2
Mar 25, 2026
Merged

feat: add recallMode with adaptive intent routing (beta.10)#342
chenjiyong merged 1 commit intoCortexReach:masterfrom
AliceLJY:feat/recall-mode-v2

Conversation

@AliceLJY
Copy link
Collaborator

Summary

Replaces #313, rewritten for v1.1.0-beta.10 (before_prompt_build hook path).

  • Adds recallMode config: full (default) | summary (L0 only) | adaptive (intent-based) | off
  • Adaptive mode: zero-LLM-cost pattern matching analyzes query intent → routes to relevant memory categories with depth-aware char budgets
  • Plugin schema + UI field added to openclaw.plugin.json

How adaptive mode works

Query type Example Category boost Depth
Preference "What's my coding style?" preference, decision L0 (80 chars)
Decision "Why did we choose Postgres?" decision, fact L1 (default)
Entity "Who is the auth team lead?" entity, fact L1 (default)
Event "What happened last deploy?" entity, decision Full (3x budget)
Fact "How does the API work?" fact, entity L1 (default)
Ambiguous "Write a sort function" No boost L0 (compact)

Automatic fallback: if category boosting still yields zero results, no filtering is applied.

New files

  • src/intent-analyzer.tsanalyzeIntent(), applyCategoryBoost(), formatAtDepth()
  • test/intent-analyzer.test.mjs — 23 tests (all passing)

Test plan

  • 23 unit tests for intent analysis, category boost, and tiered formatting
  • Full test suite passes (zero regressions)
  • Manual test with OpenClaw agent: verify adaptive recall injects correct depth
  • Verify backward compat: existing configs without recallMode unchanged

🤖 Generated with Claude Code

Add recallMode config (full/summary/adaptive/off) for granular control
over auto-recall injection depth. Adaptive mode uses zero-LLM-cost
pattern matching to analyze query intent and route to appropriate
memory categories with depth-aware formatting.

- New: src/intent-analyzer.ts — analyzeIntent(), applyCategoryBoost()
- New: test/intent-analyzer.test.mjs — 23 tests (all passing)
- Modified: index.ts — integrate intent analysis into before_prompt_build
- Modified: openclaw.plugin.json — add recallMode schema + UI field

Rewritten for v1.1.0-beta.10 (replaces PR CortexReach#313 which was based on beta.9).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chenjiyong chenjiyong merged commit afabe21 into CortexReach:master Mar 25, 2026
5 checks passed
AliceLJY added a commit to AliceLJY/memory-lancedb-pro that referenced this pull request Mar 25, 2026
Combines the following rebased changes onto latest cortexreach/master:
- feat: add session compression and adaptive extraction throttling
- fix: disable extraction throttle and session compression in smart-extractor-branches test
- fix: address Codex review for session compression
- fix: address PR CortexReach#318 review — align opt-in defaults, CJK-aware scoring, rate limiter docs

Session compression scores conversation texts before auto-capture and
drops low-signal content; extraction throttling adds a sliding-window
rate limiter and a low-value conversation skip gate.

Both features default to opt-in (disabled) to avoid surprising existing
users. Resolves merge conflicts with memory-compaction (CortexReach#343) and
recall-mode-v2 (CortexReach#342) that landed on master since the original branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants