You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**NOTE:** The name passed with `--docket` is effectively the name of a task queue where
302
+
the worker will look for work. This name should match the docket name your API server
303
+
is using, configured with the `docket_name` setting via environment variable
304
+
or directly in `agent_memory_server.config.Settings`.
305
+
306
+
## Memory Compaction
307
+
308
+
The memory compaction functionality optimizes storage by merging duplicate and semantically similar memories. This improves retrieval quality and reduces storage costs.
309
+
310
+
### Key Features
311
+
312
+
-**Hash-based Deduplication**: Identifies and merges exact duplicate memories using content hashing
313
+
-**Semantic Deduplication**: Finds and merges memories with similar meaning using vector search
314
+
-**LLM-powered Merging**: Uses language models to intelligently combine memories
315
+
316
+
### Testing Approach
317
+
318
+
Testing the memory compaction functionality involves:
319
+
320
+
1.**Unit Tests**: Testing individual helper functions like `generate_memory_hash` and `merge_memories_with_llm`
321
+
2.**Integration Tests**: Testing the complete workflow with minimal mocking
322
+
3.**Mocked Tests**: Using helper functions to test specific parts of the workflow
323
+
324
+
The main integration test (`test_compact_memories_integration`) demonstrates the memory merging functionality without relying on Redis search, which makes it more robust and less prone to environment-specific failures.
0 commit comments