LearnNewsExamplesServices
Frontmatter
id11161
titleMigrate knowledge-base services to SDK (M6 Tier-1)
stateClosed
labels
enhancementaiarchitecture
assigneesneo-gemini-3-1-pro
createdAtMay 11, 2026, 1:32 AM
updatedAtMay 12, 2026, 4:08 AM
githubUrlhttps://github.com/neomjs/neo/issues/11161
authorneo-gemini-3-1-pro
commentsCount2
parentIssue10982
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 11, 2026, 1:35 AM

Migrate knowledge-base services to SDK (M6 Tier-1)

Closedenhancementaiarchitecture
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on May 11, 2026, 1:32 AM

Context

This is a Tier-1 sub-ticket of epic #10982 (M6: Migrate per-server MCP services to flatter SDK structure), targeting the knowledge-base server.

The Problem

ai/services.mjs currently imports KB_* services directly from ai/mcp/server/knowledge-base/services/*. This couples the SDK to the MCP server hosting layout. Per the v13 M6 exit criteria, services must flatten into the SDK boundary and the Server.mjs must shrink to a thin endpoint wrapper (<50 LOC).

The Architectural Reality

  • Source: ai/mcp/server/knowledge-base/services/
  • Contents: ~10 services + ChromaManager + toolService
  • Target: A flatter SDK-owned location (to be determined during implementation), exported via ai/services.mjs while keeping the KB_ prefix.
  • Constraint: The Factory pattern (RequestContextService) uniform application must be preserved.

The Fix

  1. Relocate knowledge-base services out of the MCP server directory to the new SDK structure.
  2. Update ai/services.mjs to export these from their new location, strictly preserving KB_ namespace prefixes to avoid breaking consumers.
  3. Update ai/mcp/server/knowledge-base/Server.mjs to import services from the SDK instead of local files, reducing its LOC footprint to <50.
  4. Verify the RequestContextService dispatch remains unchanged.

Acceptance Criteria

  • AC1: All knowledge-base services are relocated to an SDK-owned location.
  • AC2: ai/services.mjs updated to import from the new locations while preserving KB_ namespace prefixes.
  • AC3: ai/mcp/server/knowledge-base/Server.mjs is updated to consume from the SDK and is reduced to <50 LOC.
  • AC4: Factory pattern (RequestContextService) is uniformly preserved across server tools.
  • AC5: Existing consumers of KB_* services (tests, daemon scripts) continue to function without signature changes.
  • AC6: Unit and integration tests pass successfully.
  • AC7 (Post-merge): Record LOC moved from the MCP server directory to the SDK in the PR body.

Out of Scope

  • Service-internal refactors or logic changes.
  • Adding new tools or changing tool semantics.

Related

  • Parent epic: #10982
  • Strategic anchor: learn/agentos/v13-path.md §4 M6

Retrieval Hint: query_raw_memories(query="M6 SDK migration knowledge-base services Server.mjs thin wrapper")