mateclaw/mateclaw-server/src/main/java/vip/mate/memory/scheduler
matevip fe68f22aa8 feat(memory): bound always-on memory growth with injection budget, consolidation, and file ceilings
Always-on memory (structured user/feedback blocks, PROFILE.md, MEMORY.md) is injected into every system prompt but only ever grew, inflating per-turn context over time. This adds deterministic size control across all always-on sources:

- Injection budget: cap the always-on structured block by total chars and per-type entry count, keeping the most-recently-updated entries (LRU by Updated date) and disclosing how many were omitted
- Nightly consolidation: a dedicated scheduled pass merges duplicate/stale user & feedback entries via the LLM, preserving each entry's original Updated date; runs per owner bucket (shared + personal) with a per-run cap and a never-grow safety guard
- File ceilings: deterministic backstop truncates PROFILE.md / MEMORY.md at a section boundary when a rewrite overruns its budget
- Manual trigger endpoint for the consolidation maintenance task

All knobs under mate.memory.*; covered by unit tests.
2026-06-17 11:04:19 +08:00
..
DreamingScheduler.java feat(memory): Dream v2 Phase 1 engine — consolidate refactor, focused endpoint, monthly archive 2026-04-20 20:21:03 +08:00
StructuredMemoryMaintenanceScheduler.java feat(memory): bound always-on memory growth with injection budget, consolidation, and file ceilings 2026-06-17 11:04:19 +08:00