The MemoryService.mjs currently generates memory IDs using a timestamp-based format (mem_${timestamp}). This is inconsistent with SessionService.mjs, which uses crypto.randomUUID() for session IDs. Furthermore, relying on timestamps for IDs is generally discouraged when better alternatives like UUIDs are available, especially since the timestamp is already stored as metadata.
Goal:
Refactor MemoryService.mjs to generate memory IDs using crypto.randomUUID(), ensuring consistency across the memory core services.
Tasks:
- Import
crypto in ai/mcp/server/memory-core/services/MemoryService.mjs.
- Update the
addMemory method to generate memoryId using crypto.randomUUID() instead of the timestamp-based string.
The
MemoryService.mjscurrently generates memory IDs using a timestamp-based format (mem_${timestamp}). This is inconsistent withSessionService.mjs, which usescrypto.randomUUID()for session IDs. Furthermore, relying on timestamps for IDs is generally discouraged when better alternatives like UUIDs are available, especially since the timestamp is already stored as metadata.Goal: Refactor
MemoryService.mjsto generate memory IDs usingcrypto.randomUUID(), ensuring consistency across the memory core services.Tasks:
cryptoinai/mcp/server/memory-core/services/MemoryService.mjs.addMemorymethod to generatememoryIdusingcrypto.randomUUID()instead of the timestamp-based string.