LearnNewsExamplesServices
Frontmatter
id10037
titleChromaDB Concept Embedding & Hybrid Search
stateClosed
labels
enhancementaiarchitecture
assigneesneo-gemini-pro
createdAtApr 16, 2026, 12:12 AM
updatedAtMay 1, 2026, 7:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/10037
authortobiu
commentsCount0
parentIssue10030
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[x] 10049 Concept Schema Enrichment: Aliases, Analogous Edges & Rich Descriptions, [x] 10032 ConceptService & Source Code Wiring
blocking[]
closedAtMay 1, 2026, 7:30 PM

ChromaDB Concept Embedding & Hybrid Search

Closed v13.0.0/archive-v13-0-0-chunk-4 enhancementaiarchitecture
tobiu
tobiu commented on Apr 16, 2026, 12:12 AM

Objective

Embed concept nodes into ChromaDB as type: 'concept' documents, enabling hybrid semantic search across concepts, guides, and source code.

Context

Phase 2 sub-issue of the Concept Ontology epic (#10030). Depends on #10032 (ConceptService with loaded JSONL data). Requires a working ChromaDB instance.

Rationale

Concept nodes have short, focused descriptions (1-3 sentences) — the opposite of the Macro KB semantic dilution problem. Embedding them enables:

  1. Concept discovery: queryDocuments({query: "how does reactivity work?", type: "concept"}) → ranked concept nodes
  2. Automated wiring: queryDocuments({query: "Neo.core.EffectManager", type: "concept"}) → discover which concept a class implements
  3. Edge validation: Compare concept description vectors against linked guide chunk vectors → verify EXPLAINED_BY edges are semantically accurate

Deliverables

1. Concept Embedding Sync

Extend the KB DatabaseService sync pipeline (or create a standalone script) to:

  • Read .neo-ai-data/concepts/nodes.jsonl
  • For each concept node, upsert into ChromaDB with metadata:
      { "type": "concept", "name": "Two-Tier Reactivity", "tier": 1, "source": ".neo-ai-data/concepts/nodes.jsonl" }
  • Document content = "${name}: ${description}"
  • Use the same embedding model as all other KB content (NEO_GLOBAL_EMBEDDING)

2. QueryService Scoring Update

Add conceptMatch weight to queryScoreWeights in KB config:

conceptMatch: 15  // Concept results get a scoring boost when type='concept' is queried

3. Cross-Type Semantic Validation

Utility method (in ConceptService or as a script) that:

  • For each CONCEPT with EXPLAINED_BY edges, query ChromaDB for the concept description against type: 'guide'
  • If the linked guide doesn't appear in the top-N results → flag as potentially misattributed edge
  • Report for human review

Three Representations, Three Strengths

Layer What It Handles Format
JSONL Structure (hierarchy, typed edges) .neo-ai-data/concepts/
ChromaDB Similarity (semantic search, discovery) type: 'concept' collection
SQLite Native Graph Traversal (BFS, frontier, gap detection) Phase 3 (#10035)

Architectural Note

ConceptService lives in the SDK (ai/services.mjs). Uses KB_ChromaManager directly through SDK imports — no new MCP tools needed.

Acceptance Criteria

  • Concepts embedded in ChromaDB with correct metadata
  • queryDocuments({type: 'concept'}) returns concept results
  • Cross-type validation identifies misattributed edges
  • Sync is idempotent (re-running doesn't duplicate)

Origin Session ID: 496c0120-29aa-4b02-a804-d5a32ff6b5eb

tobiu added the enhancement label on Apr 16, 2026, 12:12 AM
tobiu added the ai label on Apr 16, 2026, 12:12 AM
tobiu added the architecture label on Apr 16, 2026, 12:12 AM
tobiu added parent issue #10030 on Apr 16, 2026, 12:12 AM
tobiu marked this issue as being blocked by #10032 on Apr 16, 2026, 12:12 AM
tobiu cross-referenced by #10049 on Apr 17, 2026, 3:39 PM
tobiu marked this issue as being blocked by #10049 on Apr 17, 2026, 3:39 PM
tobiu cross-referenced by #10050 on Apr 17, 2026, 3:44 PM
tobiu cross-referenced by PR #10052 on Apr 17, 2026, 4:30 PM
tobiu cross-referenced by PR #10078 on Apr 19, 2026, 10:33 AM
tobiu cross-referenced by #10080 on Apr 19, 2026, 11:16 AM
tobiu cross-referenced by PR #10084 on Apr 19, 2026, 12:25 PM
tobiu cross-referenced by #10086 on Apr 19, 2026, 12:31 PM
tobiu cross-referenced by #10087 on Apr 19, 2026, 12:31 PM
tobiu cross-referenced by #10030 on Apr 19, 2026, 12:33 PM
tobiu cross-referenced by PR #10100 on Apr 19, 2026, 4:17 PM
tobiu cross-referenced by #10085 on Apr 19, 2026, 4:19 PM
tobiu referenced in commit b91d523 - "feat(ai): ORPHAN_CONCEPT signal + ⚠️ Orphaned Concepts handoff section (#10087) on Apr 19, 2026, 4:58 PM
tobiu cross-referenced by PR #10101 on Apr 19, 2026, 4:59 PM
tobiu referenced in commit 9d10d18 - "feat(ai): ORPHAN_CONCEPT signal + ⚠️ Orphaned Concepts handoff section (#10087) (#10101) on Apr 19, 2026, 5:12 PM
tobiu cross-referenced by PR #10102 on Apr 19, 2026, 5:20 PM
tobiu cross-referenced by #9748 on Apr 20, 2026, 1:13 PM
tobiu referenced in commit 54bcff5 - "feat(ai): integrate ConceptSource embedding pipeline and validation (#10037) (#10589) on May 1, 2026, 7:30 PM
tobiu closed this issue on May 1, 2026, 7:30 PM