LearnNewsExamplesServices
Frontmatter
id7867
titleRefactor MemoryService to use crypto-based IDs
stateClosed
labels
airefactoring
assigneestobiu
createdAtNov 22, 2025, 10:05 PM
updatedAtNov 22, 2025, 10:09 PM
githubUrlhttps://github.com/neomjs/neo/issues/7867
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 22, 2025, 10:09 PM

Refactor MemoryService to use crypto-based IDs

Closed v11.9.0 airefactoring
tobiu
tobiu commented on Nov 22, 2025, 10:05 PM

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:

  1. Import crypto in ai/mcp/server/memory-core/services/MemoryService.mjs.
  2. Update the addMemory method to generate memoryId using crypto.randomUUID() instead of the timestamp-based string.
tobiu added the ai label on Nov 22, 2025, 10:05 PM
tobiu added the refactoring label on Nov 22, 2025, 10:05 PM
tobiu assigned to @tobiu on Nov 22, 2025, 10:06 PM
tobiu referenced in commit 5a04c76 - "Refactor MemoryService to use crypto-based IDs #7867" on Nov 22, 2025, 10:09 PM
tobiu closed this issue on Nov 22, 2025, 10:09 PM