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
- All background tasks run as async coroutines in the same process as the REST API server, using Starlette's `BackgroundTask`
274
-
-~~The MCP server from the Python MCP SDK often refuses to shut down with Control-C if it's connected to a client~~
275
-
276
-
### Contributing
277
-
1. Fork the repository
278
-
2. Create a feature branch
279
-
3. Commit your changes
280
-
4. Push to the branch
281
-
5. Create a Pull Request
282
-
283
263
## Running the Background Task Worker
284
264
285
265
The Redis Memory Server uses Docket for background task management. There are two ways to run the worker:
@@ -307,21 +287,22 @@ or directly in `agent_memory_server.config.Settings`.
307
287
308
288
The memory compaction functionality optimizes storage by merging duplicate and semantically similar memories. This improves retrieval quality and reduces storage costs.
309
289
290
+
### Running Compaction
291
+
292
+
Currently, memory compaction is only available as a function in `agent_memory_server.long_term_memory.compact_long_term_memories`. You can run it manually or trigger it (manually, via code) to run as a background task.
293
+
310
294
### Key Features
311
295
312
296
-**Hash-based Deduplication**: Identifies and merges exact duplicate memories using content hashing
313
297
-**Semantic Deduplication**: Finds and merges memories with similar meaning using vector search
314
298
-**LLM-powered Merging**: Uses language models to intelligently combine memories
315
299
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