LearnNewsExamplesServices
Frontmatter
id11635
titlePhase 2C — Bulk Facade: CLI ai:ingest-tenant + Streaming Ingestion Path
stateClosed
labels
enhancementaiarchitecture
assigneesneo-opus-ada
createdAtMay 19, 2026, 1:55 PM
updatedAtJun 7, 2026, 7:13 PM
githubUrlhttps://github.com/neomjs/neo/issues/11635
authorneo-opus-ada
commentsCount3
parentIssue11626
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[x] 11633 Phase 2A — KnowledgeBaseIngestionService Core: Orchestrator + parsed-chunk-v1 Validation + Delta Integration
blocking[]
closedAtMay 21, 2026, 12:14 AM

Phase 2C — Bulk Facade: CLI ai:ingest-tenant + Streaming Ingestion Path

Closed v13.0.0/archive-v13-0-0-chunk-12 enhancementaiarchitecture
neo-opus-ada
neo-opus-ada commented on May 19, 2026, 1:55 PM

Context

Sub of Phase 2 Epic #11626 (meta-Epic #11624). Graduated from Discussion #11623.

Bulk data-plane facade for initial tenant onboarding + hook bursts > MCP threshold. CLI path bypasses MCP volume gate.

The Problem

Initial tenant onboarding can be 5k-50k chunks (per ChromaDB defrag-perf anchor: ~10k chunks reasonable scale). MCP facade refuses this. Hook bursts after git push of a large refactor branch can also exceed the threshold. Bulk path is structurally necessary.

The Fix

CLI command: npm run ai:ingest-tenant <tenantId> [--from-file <path>] [--from-stdin]

Wraps KnowledgeBaseIngestionService.ingestSourceFiles (Phase 2A) with viaMcp: false:

  1. Reads parsed-chunk-v1 records from file OR stdin (JSONL streaming)
  2. Batches into reasonable chunks (config-tunable; default 500 records)
  3. Streams progress to stdout
  4. Returns structured summary on completion

Optional V1.5 — HTTP/streaming endpoint deferred decision pending V1 deployment shape. For V1: CLI-only acceptable; HTTP can land as separate ticket if measurement justifies.

Script location: buildScripts/ai/ingest-tenant.mjs OR ai/scripts/ingest-tenant.mjs — final placement requires structural-pre-flight skill consultation at implementation time (sibling-pattern lift: ai/scripts/orchestrator-daemon.mjs precedent).

Acceptance Criteria

  • CLI command npm run ai:ingest-tenant defined in package.json
  • Script implementation reads parsed-chunk-v1 records from --from-file OR --from-stdin
  • Batches records (default 500/batch; configurable)
  • Streams progress + final summary to stdout
  • Bypasses MCP volume gate (viaMcp: false)
  • structural-pre-flight skill consulted for script placement decision (buildScripts/ai/ vs ai/scripts/)
  • Unit tests: stream parsing, batching, error handling, summary shape
  • Integration test: ingest 1k+ chunks via CLI; verify Chroma state matches

Out of Scope

  • HTTP/streaming endpoint → potentially V1.5 (separate ticket if needed)
  • MCP facade → Phase 2B
  • Service-layer ingestion logic → Phase 2A (consumed here)

Related

  • Parent: #11626
  • Blocked-by: Phase 2A (#TBD — service layer must exist)
  • Daemon-script precedent: ai/scripts/orchestrator-daemon.mjs, swarm-heartbeat-daemon.mjs
  • Discussion source: #11623 §4 Q3 + §7 Phase 2

Origin Session ID

7360e917-1733-4cdd-a6f3-5ac51c34b838

Handoff Retrieval Hints

  • ai/scripts/orchestrator-daemon.mjs is sibling-pattern reference for CLI tooling under ai/scripts/
  • buildScripts/ai/backup.mjs (#10129 precedent) is the canonical-orchestrator-script pattern for KB-side ops
  • structural-pre-flight skill placement decision is the substrate-correct gate before file location commits
tobiu referenced in commit c9d286d - "feat(kb): add ai:ingest-tenant bulk-facade CLI (#11635) (#11697) on May 21, 2026, 12:14 AM
tobiu closed this issue on May 21, 2026, 12:14 AM
tobiu referenced in commit b7a8d75 - "docs(agentos): Phase 3B cloud-deployment guides + examples (#11627) (#11707) on May 21, 2026, 8:49 AM