Skip to content

feat(memory): All-Mem consolidation, MAGMA edge weights, RuntimeLayer hooks#2358

Merged
bug-ops merged 6 commits intomainfrom
feat/issue-2270/research-memory-all-mem-lifelo
Mar 28, 2026
Merged

feat(memory): All-Mem consolidation, MAGMA edge weights, RuntimeLayer hooks#2358
bug-ops merged 6 commits intomainfrom
feat/issue-2270/research-memory-all-mem-lifelo

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 28, 2026

Summary

Implements three research-driven memory enhancements:

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace --features full -- -D warnings — clean (pre-existing zeph-tools error from PR feat(skills): SAGE RL reward signal, trust governance, SkillsBench constraints #2348 is unrelated)
  • cargo nextest run --workspace --features full --lib --bins — 7070/7070 passed (+28 vs base)
  • CHANGELOG.md [Unreleased] updated
  • Consolidation disabled by default (enabled = false) — no behavior change for existing configs

Closes #2270, closes #2231, closes #2286

bug-ops added 6 commits March 28, 2026 18:46
…d spreading activation (#2231)

Apply per-type multipliers in composite_score() and spreading activation spread:
- Causal: 1.2x (high-signal cause-effect chains)
- Semantic: 1.0x (baseline)
- Temporal: 0.9x
- Entity: 0.8x (structural skeleton, lower recall signal)

Weights are constants (not config) following existing codebase precedent for
non-configurable scoring parameters.
…2270)

Add migration 049 with `consolidated` column and `memory_consolidation_sources`
join table. Implement `consolidation.rs` with TopologyOp (Merge/Update), background
sweep loop, in-memory cosine similarity clustering, and transactional apply.

Wire loop startup into runner.rs after tier promotion loop. Add ConsolidationConfig
to MemoryConfig and bootstrap provider resolution.

TopologyOp::Split deferred (trigger condition undefined, see critic review).
…atch (#2286)

Add RuntimeLayer trait with before_chat/after_chat/before_tool/after_tool hooks.
NoopLayer no-op impl; BeforeToolResult type alias to avoid type_complexity.
Agent stores runtime_layers: Vec<Arc<dyn RuntimeLayer>> (empty by default, zero-cost).
Hooks wired into call_chat_with_tools in native.rs.
…ispatch (#2286)

before_tool is called per-call before executor spawn in the tier loop;
returning Some(result) short-circuits execution.
after_tool is called per-call after join_all results are collected.
Both are guarded by runtime_layers.is_empty() for zero-cost empty-vec case.
…timeLayer

- edge_type_weight exact float assertions (1.2/1.0/0.9/0.8)
- composite_score with non-baseline edge types verified
- consolidation sweep empty-DB and threshold boundary tests
- RuntimeLayer multi-layer ordering and short-circuit tests
@bug-ops bug-ops force-pushed the feat/issue-2270/research-memory-all-mem-lifelo branch from ba469e3 to 6a8dea3 Compare March 28, 2026 17:57
@bug-ops bug-ops enabled auto-merge (squash) March 28, 2026 17:58
@bug-ops bug-ops merged commit 068d153 into main Mar 28, 2026
25 checks passed
@bug-ops bug-ops deleted the feat/issue-2270/research-memory-all-mem-lifelo branch March 28, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request memory zeph-memory crate (SQLite) rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant