feat(memory): extend SYNAPSE to five-signal retrieval + async consolidation daemon#4392
Merged
Conversation
12b1124 to
c144808
Compare
c144808 to
8c1bf85
Compare
- Bump workspace version 0.21.1 → 0.21.2 - Consolidate duplicate CHANGELOG.md section headers in [0.21.2] - Update splash snapshot for new version string - Update test badge count (9824) - Update specs to reflect changes since v0.21.1
…dation daemon Extends SYNAPSE recall in zeph-memory from two signals (recency + semantic relevance) to five by adding access frequency, causal distance, and novelty. Adds an optional async consolidation daemon via zeph-scheduler that promotes high-utility episodic facts to Qdrant and deprioritizes cold ones. New signals (all off by default — w_frequency=w_causal=w_novelty=0.0): - access_frequency: log(1+count) normalized, tracked in fact_access_log SQLite table; session-scoped via per-process UUID - causal_distance: BFS on MAGMA causal edges from current goal entity, bounded by causal_bfs_max_depth (default 10), cached per turn - novelty: exp(-λ × days_since_agent_init), pure arithmetic, zero I/O Weight normalization to 1.0 happens once at startup with WARN if config values diverge. The is_baseline() short-circuit preserves zero overhead for the two-signal default. Feature-gated consolidation daemon registered via zeph-scheduler under the `scheduler` feature. Migration 090 adds: fact_access_log table, messages.memory_tier, messages.qdrant_promoted columns. Research basis: MemTier (arXiv:2605.03675) — +33pp on LongMemEval-S; 14pp tool-execution degradation over 72h with flat retrieval. Closes #4374 Closes #3703
- Rename migration 090 → 091 to avoid conflict with 090_implicit_conflict_candidates added in #4386 (TrajectoryRiskAccumulator) - Rename ConsolidationDaemonConfig (five-signal) → FiveSignalConsolidationConfig to avoid collision with existing spec 004-17 ConsolidationDaemonConfig - Keep shadow_memory field added by #4386 alongside five_signal in MemoryConfig
…y::field_reassign_with_default
65cfd24 to
af4a2e1
Compare
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
Extends SYNAPSE recall in
zeph-memoryfrom two signals (recency + semantic relevance) to five by adding access frequency, causal distance, and novelty. Adds an optional async consolidation daemon viazeph-schedulerthat promotes high-utility episodic facts to Qdrant.Research basis: MemTier (arXiv:2605.03675) — +33pp on LongMemEval-S; 14pp tool-execution success degradation over 72h windows with flat retrieval.
Changes
New module:
crates/zeph-memory/src/five_signal/(7 submodules)weights—FiveSignalWeights, normalization at startup,is_baseline()short-circuitaccess_frequency—fact_access_logSQLite tracking, per-turn GROUP BY aggregation, session-scopedcausal_distance— BFS on MAGMA causal edges, bounded bycausal_bfs_max_depth, per-turn cachenovelty—exp(-λ × days_since_agent_init), zero I/Oscoring— five-signal weighted sum,is_baseline()fast pathconsolidation— async daemon: promotion/demotion loop (Qdrant wiring deferred, stub present)metrics— Prometheus counters:five_signal_recall_total,consolidation_*_totalConfig:
[memory.five_signal]+[memory.five_signal.consolidation_daemon]inzeph-config. All new weights default to0.0— backward compatible. Config migration step 48 added.Migration 090:
fact_access_logtable,messages.memory_tier,messages.qdrant_promotedcolumns.Integration:
SemanticMemory::recall_merge_and_rank— five-signal scoring runs after existing temporal decay + MMR pipeline, fully gated byenabledflag.Deferred (tracked separately)
Nonewired)TaskKind::Customvariant not yet added tozeph-scheduler)--initwizard update for new config sectionTest plan
cargo nextest run -p zeph-memory --lib— 21 five-signal tests passcargo nextest run --workspace --lib --bins— 9906 tests pass, zero regressionscargo clippy --workspace -- -D warnings— cleancargo +nightly fmt --check— cleanw_frequency=w_causal=w_novelty=0.0produces ranking identical to two-signal baseline (covered byscoring::zero_new_weights_equals_two_signal_baseline)weights::unnormalized_weights_emit_warn)causal_distance::distance_to_score_beyond_max_depth_clamped_to_min)Closes #4374
Closes #3703