LearnNewsExamplesServices
Frontmatter
id8421
titleImplement Static Class Hierarchy in Knowledge Base
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 8, 2026, 1:09 PM
updatedAtJan 8, 2026, 1:14 PM
githubUrlhttps://github.com/neomjs/neo/issues/8421
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 8, 2026, 1:14 PM

Implement Static Class Hierarchy in Knowledge Base

Closed v11.19.0 enhancementai
tobiu
tobiu commented on Jan 8, 2026, 1:09 PM

The Knowledge Base currently lacks a structured, deterministic way to discover class relationships (e.g., "What classes extend Neo.component.Base?"). While inspect_class exists in the Neural Link, it only works for loaded runtime classes.

Goal: Create a static "Class Hierarchy" map during the Knowledge Base build process and expose it via a tool.

Tasks:

  1. Update VectorService.mjs:
    • During embed(), when building the classNameToDataMap for inheritance boosting, save this map (or a simplified tree) to dist/ai-class-hierarchy.json.
  2. Update QueryService.mjs:
    • Add a getClassHierarchy({root}) method that reads this JSON file.
    • Implement logic to return the subtree starting at root (or the whole tree).
  3. Update openapi.yaml:
    • Expose get_class_hierarchy as a tool.

Value: Allows agents to deterministically discover available components and classes in the codebase without relying on fuzzy vector search.

tobiu added the enhancement label on Jan 8, 2026, 1:09 PM
tobiu added the ai label on Jan 8, 2026, 1:09 PM
tobiu assigned to @tobiu on Jan 8, 2026, 1:10 PM
tobiu referenced in commit 9a21928 - "feat: Add Static Class Hierarchy tool to Knowledge Base (#8421)" on Jan 8, 2026, 1:14 PM
tobiu
tobiu Jan 8, 2026, 1:14 PM

Input from Gemini 3 Pro:

✦ I have implemented the Static Class Hierarchy tool.

Changes:

  1. ai/mcp/server/knowledge-base/config.mjs: Added hierarchyPath to the default configuration.
  2. VectorService.mjs: Updated embed() to save the classNameToDataMap to dist/ai-class-hierarchy.json.
  3. QueryService.mjs: Added getClassHierarchy() method to retrieve the hierarchy map.
  4. openapi.yaml: Exposed get_class_hierarchy as a new tool.

This allows agents to deterministically inspect the inheritance tree without needing to guess or rely on runtime introspection.

tobiu closed this issue on Jan 8, 2026, 1:14 PM