Repository navigation
feat(#181): agent recall optimization with caching and context output - #307
Merged
Merged
Conversation
Recall cache: - LRU cache (256 entries, 5min TTL) avoids redundant embedding computation - Auto-invalidation on remember/forget mutations - Cache metrics exposed in uteke stats (hits, misses, hit rate) - Effective for server/MCP mode where process is long-lived Context output: - uteke recall --context formats results for AI prompt injection - Compact structured summary: score, content, tags, importance markers - recall_context() library API for direct prompt injection Closes #181
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (2)
Review powered by cora-cli · BYOK · MIT |
- Cache key now includes RecallStrategy (vector/fts5/hybrid) to prevent wrong results when strategy differs between calls - min_score is intentionally NOT in cache key: cached results store unfiltered results and caller re-applies threshold - Renamed from 'LRU' to 'FIFO' — eviction uses insert-time, not access-time (accurate documentation) - forget() now uses targeted namespace invalidation instead of full cache clear, preventing cross-namespace regression
…rget - Cache moved from recall() to recall_hybrid() — strategy-aware key ensures Hybrid/Fts5/Vector paths get separate cache entries - Tag hash collision fixed: added count sentinel + per-tag separator to prevent ['a','bc'] vs ['ab','c'] hash ambiguity - forget() no longer clears entire cache on lookup failure — only invalidates the specific namespace when memory is found - Removed dead cache.clear() usage, kept as public API
ajianaz
added a commit
that referenced
this pull request
Aug 13, 2026
…#307) * feat(#181): agent recall optimization with caching and context output Recall cache: - LRU cache (256 entries, 5min TTL) avoids redundant embedding computation - Auto-invalidation on remember/forget mutations - Cache metrics exposed in uteke stats (hits, misses, hit rate) - Effective for server/MCP mode where process is long-lived Context output: - uteke recall --context formats results for AI prompt injection - Compact structured summary: score, content, tags, importance markers - recall_context() library API for direct prompt injection Closes #181 * fix(#181): address Cora review findings on recall cache - Cache key now includes RecallStrategy (vector/fts5/hybrid) to prevent wrong results when strategy differs between calls - min_score is intentionally NOT in cache key: cached results store unfiltered results and caller re-applies threshold - Renamed from 'LRU' to 'FIFO' — eviction uses insert-time, not access-time (accurate documentation) - forget() now uses targeted namespace invalidation instead of full cache clear, preventing cross-namespace regression * fix(#181): address all Cora review findings — cache key, strategy, forget - Cache moved from recall() to recall_hybrid() — strategy-aware key ensures Hybrid/Fts5/Vector paths get separate cache entries - Tag hash collision fixed: added count sentinel + per-tag separator to prevent ['a','bc'] vs ['ab','c'] hash ambiguity - forget() no longer clears entire cache on lookup failure — only invalidates the specific namespace when memory is found - Removed dead cache.clear() usage, kept as public API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multi-layered recall optimization for AI agent integration.
Recall cache: LRU (256 entries, 5min TTL), auto-invalidated on mutations.
Context output: Compact structured format optimized for LLM consumption.
Closes #181