LearnNewsExamplesServices
Frontmatter
id9922
title[Epic] Two-Pillar Hybrid RAG: ChromaDB Re-integration & Topological Re-ranking
stateClosed
labels
epicaiarchitecture
assigneestobiu
createdAtApr 12, 2026, 4:09 PM
updatedAtApr 12, 2026, 6:59 PM
githubUrlhttps://github.com/neomjs/neo/issues/9922
authortobiu
commentsCount0
parentIssuenull
subIssues
9923 [Sub-Task] Configuration & Lifecycle Re-alignment for Two-Pillar RAG
9924 [Sub-Task] Database Service & Health Diagnostics Migration
9925 [Sub-Task] Re-Ranker Middleware Construction (Hybrid RAG Pipeline)
9929 Stabilize AI Test Suite environment dependencies
9931 Refactor DreamService to Finalize Two-Pillar Hybrid RAG
subIssuesCompleted5
subIssuesTotal5
blockedBy[]
blocking[]
closedAtApr 12, 2026, 6:03 PM

[Epic] Two-Pillar Hybrid RAG: ChromaDB Re-integration & Topological Re-ranking

Closed v13.0.0/archive-v13-0-0-chunk-4 epicaiarchitecture
tobiu
tobiu commented on Apr 12, 2026, 4:09 PM

Architectural Bottleneck

Currently, Swarm Episodic Memory (memory-core) utilizes sqlite-vec to manage embeddings. Extensive analysis verified that sqlite-vec executes brute-force exact nearest neighbor (KNN) via full table scans $O(N)$ and does not construct a $O(\log N)$ Hierarchical Navigable Small World (HNSW) indexing graph. Furthermore, attempting to bridge this gap by mathematically layering an explicit HNSW topology inside the V8 engine over standard ai/graph SQLite edges fails severely on execution latency and GC constraints when operating on dense 4096-Dimensional embedding geometries.

The Objective

We must decisively separate the Hybrid RAG components to utilize the exact engines explicitly built for their mathematical constraints:

  1. Pillar A (Semantic Search): Revert the raw embedding sink to ChromaDB. Chroma natively uses hnswlib internally via C++/Rust to handle billion-scale MMAP logic and geometric spatial bounds efficiently, resolving the Swarm memory context limits flawlessly.
  2. Pillar B (Topological Proximity): Retain SQLite categorically for explicit, relational Native Edge Graph paths.

The Strategy

  1. Restore Vector Engine: Prioritize and restore ChromaManager.mjs as the default high-scale embedding driver within the memory-core server configuration, phasing out SQLiteVectorManager.mjs.
  2. Implement Dual-Phase Re-Ranking Middleware: Abstract a routing filter inside StorageRouter.mjs to execute true hybrid RAG:
    • Pass 1: Execute a similarity heuristic against ChromaDB to extract the Top K semantically relevant Node IDs.
    • Pass 2: Filter those retrieved IDs explicitly through the SQLite Native Edge Graph to weight them via Topological proximity (e.g., connected actively to Frontier, shared sequence topologies).

Rationale & Avoided Pitfalls

  • Avoided V8 HNSW Implementations: Building a multi-layer Skip List index inside interpreted JavaScript over SQLite triggers introduces colossal V8 Garbage Collection pauses and fundamentally negates low-level SIMD scaling.
  • Genuine Hybrid Execution: Previously, SessionService isolated SQLite Vector tables from SQLite Graph tables without continuous systemic crossover rendering. This Two-Pillar re-ranker enforces intersection at the absolute base of the architecture.
tobiu added the epic label on Apr 12, 2026, 4:09 PM
tobiu added the ai label on Apr 12, 2026, 4:09 PM
tobiu added the architecture label on Apr 12, 2026, 4:09 PM
tobiu cross-referenced by #9923 on Apr 12, 2026, 4:15 PM
tobiu cross-referenced by #9925 on Apr 12, 2026, 4:15 PM
tobiu cross-referenced by #9924 on Apr 12, 2026, 4:15 PM
tobiu added sub-issue #9923 on Apr 12, 2026, 4:15 PM
tobiu added sub-issue #9924 on Apr 12, 2026, 4:15 PM
tobiu added sub-issue #9925 on Apr 12, 2026, 4:15 PM
tobiu cross-referenced by PR #9926 on Apr 12, 2026, 4:23 PM
tobiu referenced in commit 66569e6 - "feat: Two-Pillar Hybrid RAG Architecture (#9922) (#9926) on Apr 12, 2026, 5:36 PM
tobiu closed this issue on Apr 12, 2026, 5:36 PM
tobiu reopened this issue on Apr 12, 2026, 5:42 PM
tobiu referenced in commit 87ae7e5 - "feat(ai): Add native buffer transfer bridge from SQLite to Chroma (#9922)" on Apr 12, 2026, 5:48 PM
tobiu cross-referenced by PR #9927 on Apr 12, 2026, 5:48 PM
tobiu referenced in commit 236e503 - "fix(ai): Finalize ChromaDB migration for Memory Core (#9922)" on Apr 12, 2026, 5:59 PM
tobiu cross-referenced by PR #9928 on Apr 12, 2026, 5:59 PM
tobiu referenced in commit 8add3da - "fix(ai): Finalize ChromaDB migration for Memory Core (#9922) (#9928) on Apr 12, 2026, 6:03 PM
tobiu closed this issue on Apr 12, 2026, 6:03 PM
tobiu cross-referenced by #9929 on Apr 12, 2026, 6:23 PM
tobiu added sub-issue #9929 on Apr 12, 2026, 6:23 PM
tobiu cross-referenced by PR #9930 on Apr 12, 2026, 6:24 PM
tobiu cross-referenced by #9931 on Apr 12, 2026, 6:34 PM
tobiu added sub-issue #9931 on Apr 12, 2026, 6:34 PM
tobiu assigned to @tobiu on Apr 12, 2026, 6:59 PM
tobiu cross-referenced by PR #10122 on Apr 20, 2026, 1:47 PM
tobiu cross-referenced by #10125 on Apr 20, 2026, 3:53 PM
tobiu cross-referenced by #10129 on Apr 20, 2026, 5:04 PM
tobiu cross-referenced by PR #10131 on Apr 20, 2026, 8:26 PM
tobiu referenced in commit 1dfcec8 - "feat(ai/backup): extend bundle-meta + integrity check + mailbox (#10871) (#10876) on May 7, 2026, 9:21 AM