mateclaw/mateclaw-server/src/main/java/vip/mate/memory/service
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
..
AlwaysOnFileBudget.java feat(memory): bound always-on memory growth with injection budget, consolidation, and file ceilings 2026-06-17 11:04:19 +08:00
DreamMode.java feat(memory): Dream v2 Phase 1 engine — consolidate refactor, focused endpoint, monthly archive 2026-04-20 20:21:03 +08:00
DreamReport.java feat(memory): Dream v2 Phase 1 engine — consolidate refactor, focused endpoint, monthly archive 2026-04-20 20:21:03 +08:00
DreamStatus.java feat(memory): Dream v2 Phase 1 engine — consolidate refactor, focused endpoint, monthly archive 2026-04-20 20:21:03 +08:00
MemoryEmergenceService.java feat(memory): bound always-on memory growth with injection budget, consolidation, and file ceilings 2026-06-17 11:04:19 +08:00
MemoryHilService.java fix(memory): route long-term memory edits to the file being edited (#148) 2026-05-18 11:28:01 +08:00
MemoryRecallService.java feat(memory): Dream v2 Phase 1 engine — consolidate refactor, focused endpoint, monthly archive 2026-04-20 20:21:03 +08:00
MemoryRecallTracker.java feat(memory): add active retrieval tracking, multi-gate filtering, DREAMS.md diary and dreaming status API 2026-04-06 23:35:27 +08:00
MemorySummarizationGate.java fix(agent): drop brittle output policing, add evidence-grounded long-task safeguards 2026-05-04 11:55:44 +08:00
MemorySummarizationService.java feat(memory): bound always-on memory growth with injection budget, consolidation, and file ceilings 2026-06-17 11:04:19 +08:00
MorningCardService.java docs: update README title and tagline 2026-04-21 09:27:42 +08:00
PromotedEntry.java feat(memory): Dream v2 Phase 1 engine — consolidate refactor, focused endpoint, monthly archive 2026-04-20 20:21:03 +08:00
RejectedEntry.java feat(memory): Dream v2 Phase 1 engine — consolidate refactor, focused endpoint, monthly archive 2026-04-20 20:21:03 +08:00
SoulSummarizerService.java fix(llm): skip unconfigured provider when resolving default model 2026-04-20 21:50:01 +08:00
StructuredMemoryConsolidationService.java feat(memory): bound always-on memory growth with injection budget, consolidation, and file ceilings 2026-06-17 11:04:19 +08:00
StructuredMemoryService.java feat(memory): bound always-on memory growth with injection budget, consolidation, and file ceilings 2026-06-17 11:04:19 +08:00