enhance(lifecycle): consolidation cron for session-to-insight promotion#32
Open
doctatortot wants to merge 5 commits into
Open
enhance(lifecycle): consolidation cron for session-to-insight promotion#32doctatortot wants to merge 5 commits into
doctatortot wants to merge 5 commits into
Conversation
Supports iterating all spaces for background jobs like consolidation that need to process every space, not just those belonging to a user. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…motion Adds a periodic background job that reviews recent Session-type memories and uses the LLM to decide which contain durable facts worth promoting to long-term Insight memories via supersede_batch. Supports both single observation promotion (PROMOTE) and multi-observation merging (MERGE_PROMOTE) into consolidated semantic memories. Key components: - Consolidator struct with run_once() for per-space consolidation - LLM prompt that classifies observations as PROMOTE/MERGE_PROMOTE/SKIP - Tier evaluation piggybacks on each consolidation cycle - Graceful shutdown via watch channel - Gated by OMEM_CONSOLIDATION_ENABLED (default: off) - Configurable interval and lookback window via env vars Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
supersede_batchOMEM_CONSOLIDATION_ENABLED(default: off) — no behavior change for existing deploymentsDetails
New module:
lifecycle/consolidator.rsConsolidator::run_once()iterates all spaces, queries recent Session-type memories, sends them to the LLM with a consolidation prompt, and executes decisions viasupersede_batchTierManager::evaluate_tier) piggybacks on each cycletokio::sync::watchchannelConfig (env vars):
OMEM_CONSOLIDATION_ENABLED— defaultfalseOMEM_CONSOLIDATION_INTERVAL_SECS— default3600(1 hour)OMEM_CONSOLIDATION_LOOKBACK_HOURS— default24Supporting change:
SpaceStore::list_all_spaces()— lets background jobs iterate every space without a user IDTest plan
🤖 Generated with Claude Code