Enhance memory management and compaction features

- Implement global memory layer for cross-project patterns.
- Improve memory entry scoring with recency and tokenization.
- Adjust MAX_TEXT limit from 400 to 800 for better context retention.
- Add TTL pruning for stale memory entries.
- Capture and summarize dropped content during compaction.
- Update tests to reflect changes in memory behavior and compaction logic.
This commit is contained in:
asepharyana
2026-09-08 21:27:47 +07:00
parent b1ff00d840
commit 7db69f19da
8 changed files with 522 additions and 36 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ test('an empty note is refused', async () => {
test('long text is truncated', async () => {
const m = new Memory('/repo');
const entry = await m.add('fact', 'x'.repeat(2000));
expect(entry?.text.length).toBe(400);
expect(entry?.text.length).toBe(800);
});
test('search requires every term and records a hit', async () => {