-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement tool-based memory retrieval injection strategy #207
Copy link
Copy link
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:memoryDESIGN_SPEC Section 7 - Memory & PersistenceDESIGN_SPEC Section 7 - Memory & Persistencespec:toolsDESIGN_SPEC Section 11 - Tool & Capability SystemDESIGN_SPEC Section 11 - Tool & Capability Systemtype:featureNew feature implementationNew feature implementationv0.6Minor version v0.6Minor version v0.6v0.6.1Patch release v0.6.1Patch release v0.6.1
Description
Summary
Memory injection Strategy 2: agent has recall_memory / search_memory tools it calls on-demand during execution. Currently only Strategy 1 (context injection) is implemented.
Design Spec Reference
- §7.7 Memory Injection Strategies — Strategy 2: Tool-Based Retrieval
Scope
recall_memoryandsearch_memorytool implementationsMemoryInjectionStrategyprotocol complianceget_tool_definitions()returns tool schemas for LLM- Integration with
ToolRegistry
Research Context
Four independent sources provide implementation blueprints:
1. Memex (arXiv:2603.04257) — CompressExperience/ReadExperience tool pair:
CompressExperience: archives current context into KV store, replaces working context with structured summary + index tableReadExperience: dereferences an index to reinject archived block (deterministic lookup, not semantic search)- Index-description pairs as compact context representation
- Results: 24.2%→85.6% success, 43% context reduction
2. NeMo Retriever (NVIDIA) — Tool triad blueprint:
recall_memory(query, top_k)+search_memory(query, keyword_weight)+compact_context()- Agent decides when to retrieve and when to compress
- 760k tokens/query cost warning — only for complex retrievals
3. Agentic RAG (TDS) — Three agentic patterns:
- Query rewriting: agent reformulates queries for better retrieval
- Sufficiency checking: agent evaluates results and iterates if insufficient
- Dynamic weighting: tool accepts
keyword_weightparam to shift BM25-vs-vector per query
4. LangChain Context Compression — /compact manual trigger:
- Agent-triggered compaction at clean task boundaries
- Conservative tuning (agents rarely trigger, but choose good moments)
See research/agentic-retrieval-patterns.md and research/memex-indexed-experience-memory.md in project memory.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:memoryDESIGN_SPEC Section 7 - Memory & PersistenceDESIGN_SPEC Section 7 - Memory & Persistencespec:toolsDESIGN_SPEC Section 11 - Tool & Capability SystemDESIGN_SPEC Section 11 - Tool & Capability Systemtype:featureNew feature implementationNew feature implementationv0.6Minor version v0.6Minor version v0.6v0.6.1Patch release v0.6.1Patch release v0.6.1