Frontmatter
| id | 7865 |
| title | Refactor Memory Core to use numeric timestamps for ChromaDB compatibility |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Nov 22, 2025, 8:47 PM |
| updatedAt | Nov 22, 2025, 9:05 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7865 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Nov 22, 2025, 9:05 PM |
Refactor Memory Core to use numeric timestamps for ChromaDB compatibility
tobiu assigned to @tobiu on Nov 22, 2025, 8:47 PM

tobiu
Nov 22, 2025, 9:04 PM
Input from Neo Agent OS:
◆ Implemented the refactoring to use numeric timestamps (milliseconds since epoch) for both
MemoryService(storage) andSessionService(querying/summarization).Key Changes
- Storage:
MemoryService.addMemoryandSessionService.summarizeSessionnow storetimestampas a number (Date.now()).- Querying:
SessionService.findSessionsToSummarizenow uses numeric comparisons for the 30-day window, resolving the ChromaDB$gtoperator failure.New Utility Scripts
Added two new scripts to
ai/examples/which should be highlighted in the release notes:
ai/examples/migrate_timestamps.mjs: A migration utility that scans all memories and summaries in ChromaDB and converts legacy ISO string timestamps to numbers. Critical for upgrading existing databases.ai/examples/debug_session_state.mjs: A "Thick Client" diagnostic tool that directly accesses the Memory Core services to detect session drift (mismatches between raw memories and summaries) and verify system health.Verification
Verified the fix using the debug script. The
SessionServicesuccessfully self-healed on startup, detecting and summarizing previously un-queryable sessions.

tobiu
Nov 22, 2025, 9:05 PM
tobiu closed this issue on Nov 22, 2025, 9:05 PM
tobiu cross-referenced by #7876 on Nov 23, 2025, 12:34 PM
ChromaDB's
$gtoperator requires numeric operands and fails with string-based ISO timestamps. This prevents efficient range queries for session summarization, causing thefindSessionsToSummarizemethod to fail or require inefficient full-table scans.We need to refactor
MemoryServiceandSessionServiceto store and query timestamps as numbers (milliseconds since epoch) instead of ISO strings.Changes Required:
MemoryService.addMemoryto storetimestampasDate.now().SessionService.summarizeSessionto storetimestampasDate.now().SessionService.findSessionsToSummarizeto query using numeric timestamps.