Symptom
ask_knowledge_base with type='src' or type='ai-infrastructure' returns placeholder text in the answer field ("I don't have enough information..." / "provided context documents are empty") while the references array comes back populated with high-scoring, correctly-indexed source files. The same query with type='all' (default) synthesizes a full, grounded answer from the same underlying corpus.
Reproducers
Case 1 — type='src' (empty answer, populated refs):
ask_knowledge_base({query: 'How does the IssueSyncer sync GitHub issues to local markdown files?', type: 'src'})
<h1 class="neo-h1" data-record-id="4">answer: "I don't have enough information from the provided documents..."</h1>
<h1 class="neo-h1" data-record-id="5">references: [src/core/Base.mjs, src/component/Base.mjs, src/main/addon/Base.mjs, ...]</h1>
Case 2 — type='ai-infrastructure' (same symptom):
ask_knowledge_base({query: 'refetchIssuesByNumber detectStaleCommentsCounts exhaustTimelineItems', type: 'ai-infrastructure'})
<h1 class="neo-h1" data-record-id="6">answer: "I don't have enough information to answer your question, as the provided context documents are empty."</h1>
<h1 class="neo-h1" data-record-id="7">references: [</h1>
<h1 class="neo-h1" data-record-id="8">IssueSyncer.mjs (ai/mcp/server/github-workflow/services/sync/IssueSyncer.mjs, score 793),</h1>
<h1 class="neo-h1" data-record-id="9">IssueService.mjs (ai/mcp/server/github-workflow/services/IssueService.mjs, score 635),</h1>
<h1 class="neo-h1" data-record-id="10">DreamService.mjs (ai/daemons/DreamService.mjs, score 341), ...</h1>
<h1 class="neo-h1" data-record-id="11">]</h1>
Control — type='all', same query (full synthesis):
ask_knowledge_base({query: 'refetchIssuesByNumber detectStaleCommentsCounts IssueSyncer GitHub sync'})
<h1 class="neo-h1" data-record-id="12">answer: Full synthesis naming IssueSyncer, FETCH_ISSUES_FOR_SYNC, the comment-sync flow</h1>
<h1 class="neo-h1" data-record-id="13">references: [src/core/Base.mjs, ai/mcp/.../IssueSyncer.mjs, Updater.md, GitHubWorkflow.md, ...]</h1>
What's NOT the bug
- Indexing is not broken.
ApiSource.mjs:42-49 sourceMap includes 'ai': 'ai-infrastructure'. References prove the chunks are in the collection (with content-appropriate scores). type='all' synthesizes correctly using those same chunks.
Suspected Root Cause
Very likely in ai/mcp/server/knowledge-base/services/QueryService.mjs or DocumentService.mjs — the path that feeds chunk content to the synthesis LLM. Hypotheses to investigate:
- Type-filtered Chroma queries return only metadata + references (not chunk
document content), so synthesis gets empty strings.
SourceParser-emitted chunks store content under a different metadata key than LearningSource-emitted chunks, and the synthesis path reads only one.
- A recently-changed filter clause strips
document field when a type filter is present.
Impact
Per AGENTS.md §2.1 Anti-Hallucination Tool Hierarchy, ask_knowledge_base is the PRIMARY tool for conceptual + implementation questions. Agents filtering by type='src' for code-level questions silently get useless placeholder answers despite the KB having the content — a latent value-defeat of the RAG layer. Discovered during the #10092 ticket-intake verification sweep.
Acceptance Criteria
Origin Session ID
d9eb5e76-5430-45f7-b3ea-8600664d28f9
Related: Discovered during #10092 / PR #10093 verification.
Symptom
ask_knowledge_basewithtype='src'ortype='ai-infrastructure'returns placeholder text in theanswerfield ("I don't have enough information..."/"provided context documents are empty") while thereferencesarray comes back populated with high-scoring, correctly-indexed source files. The same query withtype='all'(default) synthesizes a full, grounded answer from the same underlying corpus.Reproducers
Case 1 —
type='src'(empty answer, populated refs):ask_knowledge_base({query: 'How does the IssueSyncer sync GitHub issues to local markdown files?', type: 'src'}) <h1 class="neo-h1" data-record-id="4">answer: "I don't have enough information from the provided documents..."</h1> <h1 class="neo-h1" data-record-id="5">references: [src/core/Base.mjs, src/component/Base.mjs, src/main/addon/Base.mjs, ...]</h1>Case 2 —
type='ai-infrastructure'(same symptom):ask_knowledge_base({query: 'refetchIssuesByNumber detectStaleCommentsCounts exhaustTimelineItems', type: 'ai-infrastructure'}) <h1 class="neo-h1" data-record-id="6">answer: "I don't have enough information to answer your question, as the provided context documents are empty."</h1> <h1 class="neo-h1" data-record-id="7">references: [</h1> <h1 class="neo-h1" data-record-id="8">IssueSyncer.mjs (ai/mcp/server/github-workflow/services/sync/IssueSyncer.mjs, score 793),</h1> <h1 class="neo-h1" data-record-id="9">IssueService.mjs (ai/mcp/server/github-workflow/services/IssueService.mjs, score 635),</h1> <h1 class="neo-h1" data-record-id="10">DreamService.mjs (ai/daemons/DreamService.mjs, score 341), ...</h1> <h1 class="neo-h1" data-record-id="11">]</h1>Control —
type='all', same query (full synthesis):ask_knowledge_base({query: 'refetchIssuesByNumber detectStaleCommentsCounts IssueSyncer GitHub sync'}) <h1 class="neo-h1" data-record-id="12">answer: Full synthesis naming IssueSyncer, FETCH_ISSUES_FOR_SYNC, the comment-sync flow</h1> <h1 class="neo-h1" data-record-id="13">references: [src/core/Base.mjs, ai/mcp/.../IssueSyncer.mjs, Updater.md, GitHubWorkflow.md, ...]</h1>What's NOT the bug
ApiSource.mjs:42-49sourceMap includes'ai': 'ai-infrastructure'. References prove the chunks are in the collection (with content-appropriate scores).type='all'synthesizes correctly using those same chunks.Suspected Root Cause
Very likely in
ai/mcp/server/knowledge-base/services/QueryService.mjsorDocumentService.mjs— the path that feeds chunk content to the synthesis LLM. Hypotheses to investigate:documentcontent), so synthesis gets empty strings.SourceParser-emitted chunks store content under a different metadata key thanLearningSource-emitted chunks, and the synthesis path reads only one.documentfield when atypefilter is present.Impact
Per AGENTS.md §2.1 Anti-Hallucination Tool Hierarchy,
ask_knowledge_baseis the PRIMARY tool for conceptual + implementation questions. Agents filtering bytype='src'for code-level questions silently get useless placeholder answers despite the KB having the content — a latent value-defeat of the RAG layer. Discovered during the #10092 ticket-intake verification sweep.Acceptance Criteria
ask_knowledge_basewithtype='src'returns a real synthesis matchingtype='all'qualityask_knowledge_basewithtype='ai-infrastructure'returns a real synthesistype='src'ANDtype='ai-infrastructure'for a known-indexed method signature; asserts the answer references the method name or nearby context (not placeholder "empty" text)type='all'/type='guide'synthesisOrigin Session ID
d9eb5e76-5430-45f7-b3ea-8600664d28f9Related: Discovered during #10092 / PR #10093 verification.