fix(memory): warm the store on session init so the first message enriches - #24
Merged
Conversation
…ches Cold-start: the first enrichment query in a fresh process paid the LanceDB connect+open cost (~230ms), tipping over the 250ms budget so the enrichment hook gracefully passed the message through with no recalled context. Warm the fragments/consolidated tables (reinforcement-free, fire-and-forget) when a session becomes ready. Measured: first enrichment after warm ~24ms vs ~238ms cold, so the recalled-context chip now shows on the first message.
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.
Problem
Memory enrichment has a 250 ms budget and gracefully passes the original message through if it exceeds it (so chat never blocks). The very first enrichment query in a fresh server process pays the LanceDB connect + table-open cost (~230 ms measured), which tips over budget — so the first user message in a session was never enriched (no recalled-context chip), even though every subsequent message was.
Fix
When a session becomes ready, fire a reinforcement-free warm-up (opens the fragments + consolidated tables) off the hot path. Routed through the collective-intelligence layer to keep the ws-bridge↔store boundary clean, matching how enrichment is wired.
Result (measured)
Testing