fix(memory): harden recall hot path#1871
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughIntroduces corpus-aware keyword recall for agent-facing memory search, replacing static stopword filtering with dynamic term statistics. Adds query-embedding soft-timeout and in-flight deduplication, extends repository contracts with matchMode search, term stats, and batched access recording, and updates settings UI hints. ChangesKeyword Recall Hot Path
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant MemoryPresenter
participant QueryEmbeddingInFlight
participant EmbeddingProvider
participant AgentMemoryTable
Caller->>MemoryPresenter: recall(query)
MemoryPresenter->>QueryEmbeddingInFlight: startQueryEmbedding(agentId, providerId, modelId)
alt already in-flight and fresh
QueryEmbeddingInFlight-->>MemoryPresenter: skip vector recall
else new request
MemoryPresenter->>EmbeddingProvider: getEmbeddings(query)
MemoryPresenter->>MemoryPresenter: withSoftTimeout(embedding promise)
alt timeout
MemoryPresenter-->>MemoryPresenter: skip vector, keep vector-store readiness
else resolved in time
EmbeddingProvider-->>MemoryPresenter: embedding vector
end
end
MemoryPresenter->>AgentMemoryTable: search(keywordQuery, matchMode: any)
AgentMemoryTable-->>MemoryPresenter: matched rows
MemoryPresenter->>AgentMemoryTable: recordAccessBatch(ids, now)
MemoryPresenter-->>Caller: fused recall results
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary by CodeRabbit
New Features
Bug Fixes