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
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 22, 2025, 10:09 PM

Refactor MemoryService to use crypto-based IDs

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.