Skip to content

feat: memory_drill_down tool and tiered recall depth config#322

Merged
win4r merged 2 commits intoCortexReach:masterfrom
AliceLJY:feat/tiered-storage
Mar 23, 2026
Merged

feat: memory_drill_down tool and tiered recall depth config#322
win4r merged 2 commits intoCortexReach:masterfrom
AliceLJY:feat/tiered-storage

Conversation

@AliceLJY
Copy link
Collaborator

Summary

Enables L0/L1/L2 lazy loading — auto-recall injects compact summaries, agent drills down on demand.

  • New tool: memory_drill_down(id, level) — get L1 overview or L2 full content
  • New config: recallDepthDefault: "l0" | "l1" | "full" (default: "full" for backward compat)
  • Storage layer already has L0/L1/L2 in metadata — this PR adds the READ side

Token savings

With recallDepthDefault: "l0", auto-recall injects ~100 tokens per memory instead of ~500+. Agent calls memory_drill_down only when it needs details.

Test plan

  • 11 unit tests for metadata parsing, level selection, config, format
  • Manual test: verify memory_drill_down returns correct levels

🤖 Generated with Claude Code

AliceLJY and others added 2 commits March 23, 2026 19:12
…lt config

Enables L0/L1/L2 lazy loading for auto-recall:
- L0 (abstract): one-line summary, ~100 tokens
- L1 (overview): structured summary, ~500 tokens
- L2 (full): complete text (existing behavior)

Storage layer already has L0/L1/L2 in metadata (smart-metadata.ts).
This PR adds the READ side:

1. New `memory_drill_down` tool: agent calls this to get L1 overview or
   L2 full content for a specific memory after seeing compact summaries
2. New `recallDepthDefault` config: "l0" | "l1" | "full" (default: "full"
   for backward compat). When set to "l0", auto-recall uses L0 abstracts
   from metadata, saving significant context budget
3. 11 tests (parsing, level selection, config, format constraints)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. [High] Add scope check to memory_drill_down — agent must have access
   to the memory's scope before reading deeper content
2. [High] Fix L2 content: use metadata.l2_content (true full text),
   not entry.text (which stores L0 abstract for smart-extracted memories)
3. [Medium] Wire recallDepthDefault into auto-recall — now controls
   whether L0/L1/full text is injected (was dead config before)
4. [Medium] Include short memory ID in auto-recall prefix format
   (e.g. [preference:global|a1b2c3d4]) so agent can call memory_drill_down

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@win4r win4r merged commit 59af091 into CortexReach:master Mar 23, 2026
3 checks passed
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