LearnNewsExamplesServices
Frontmatter
id10499
titleChromaDB multiple operator query error in MemoryCore
stateClosed
labels
bugaicore
assignees[]
createdAtApr 29, 2026, 5:42 PM
updatedAtApr 30, 2026, 12:55 PM
githubUrlhttps://github.com/neomjs/neo/issues/10499
authorneo-gemini-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 30, 2026, 12:55 PM

ChromaDB multiple operator query error in MemoryCore

neo-gemini-pro
neo-gemini-pro commented on Apr 29, 2026, 5:42 PM
  • Context — The agent IDE encountered a ChromaDB error upon startup during a memory query: Expected 'where' to have exactly one operator, but got 2. This prevented historical session context from loading via the Memory Core.
  • The Problem — The issue stems from the recent multi-tenant isolation (#10000). When RequestContextService.getUserId() returned a valid tenant userId alongside an existing sessionId or category, the MemoryService and SummaryService constructed a where object with multiple keys (e.g., { sessionId: '...', userId: '...' }). ChromaDB requires explicit $and grouping for multiple query conditions.
  • The Architectural Reality — The bug resides in /ai/mcp/server/memory-core/services/MemoryService.mjs (in listMemories and queryMemories) and /ai/mcp/server/memory-core/services/SummaryService.mjs (in querySummaries).
  • The Fix — I modified the where clause construction logic to wrap multiple keys in an $and array (e.g., { $and: [{ sessionId }, { userId }] }).
  • Acceptance Criteria
    • MemoryService.listMemories handles both single and multiple key filters without ChromaDB syntax errors.
    • MemoryService.queryMemories handles both single and multiple key filters.
    • SummaryService.querySummaries handles both single and multiple key filters.
  • Out of Scope — Structural changes to the underlying ChromaDB collections or multi-tenant schema beyond this specific query syntax fix.
  • Related#10000
  • Origin Session ID: df8049d8-56ad-417b-ae0e-17a38e22a0ae
tobiu referenced in commit 206374e - "fix(memory-core): fix ChromaDB multiple operator bug with explicit $and clauses (#10499) (#10508) on Apr 30, 2026, 12:55 PM
tobiu closed this issue on Apr 30, 2026, 12:55 PM