Frontmatter
| id | 10057 |
| title | Knowledge Base: Add PullRequestSource for PR Conversation Embeddings |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Apr 18, 2026, 12:48 AM |
| updatedAt | Apr 18, 2026, 8:44 PM |
| githubUrl | https://github.com/neomjs/neo/issues/10057 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 9999 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 18, 2026, 8:44 PM |
Knowledge Base: Add PullRequestSource for PR Conversation Embeddings
tobiu assigned to @tobiu on Apr 18, 2026, 8:10 PM

tobiu
Apr 18, 2026, 8:11 PM
Input from Claude Opus 4.7 (Claude Code):
❋ Graph wiring (ticket-intake)
- Parent: #9999 — fits the "KB knows more about project work history" framing. (Originally #9999 §3 scoped PRs under the Macro DB plan; that vector-heavy direction was abandoned due to semantic dilution. This ticket delivers the same goal via the conventional chunked-source pattern instead.)
- Related, not parent: #10030 — Concept Ontology is a different architectural layer (deterministic JSONL graph, not vectors). PR embeddings are complementary: concepts tell you what; PR embeddings surface how things got done.
Hypothesis vs root cause (flagged during intake)
The ticket prescribes "chunk the PR body + conversation into embeddable segments", but the actual
DiscussionSource.mjs/TicketSource.mjspattern is one chunk per markdown file — downstream chunking happens inDatabaseService. I will follow the established pattern (~40 LOC, mirror ofDiscussionSource) rather than over-engineering per-section splitting.Minor out-of-scope observations (not bundling into this PR)
TicketSource.mjs:14-17JSDoc says.github/ISSUE_ARCHIVEbut code readsresources/content/issues+issue-archive. Stale comment.- Frontmatter metadata is embedded in content rather than extracted across all source providers. Limits
state='merged'style filters; fine for semantic search today.Proceeding with branch
agent/10057-pull-request-sourcefromorigin/dev.
tobiu added parent issue #9999 on Apr 18, 2026, 8:11 PM
tobiu cross-referenced by PR #10066 on Apr 18, 2026, 8:15 PM
tobiu closed this issue on Apr 18, 2026, 8:44 PM
tobiu cross-referenced by #9748 on Apr 20, 2026, 1:13 PM
Intent / The Why
The Knowledge Base indexes content from six source providers:
ApiSource,LearningSource,ReleaseNotesSource,TicketSource,DiscussionSource, andTestSource. The GitHub Workflow server syncs PR conversations to local markdown files atresources/content/pulls/(~280 files), but noPullRequestSourceexists to embed them into the vector database.This means:
ask_knowledge_base(query='how was the grid selection refactored?')can find the ticket that described the intent, but not the PR that documents the actual implementation, review feedback, and architectural corrections made during execution.The Q&A Signal Pattern
The old workflow (pre-Swarm) put both problem and solution in ticket comments. With PRs, the signal split: ticket = problem, PR = solution. If the KB only indexes tickets, agents can find what to do but not how it was done before. This asymmetry degrades RAG quality over time as more work flows through PRs.
Scope of Work
New Source Provider
Create
ai/mcp/server/knowledge-base/source/PullRequestSource.mjsfollowing theDiscussionSource.mjspattern:resources/content/pulls/*.mdtype: 'pull'metadata for filtered queriesKB Query Integration
The
query_documentstool already supportstypefiltering. After addingPullRequestSource, queries withtype='pull'should return PR content. No tool changes needed — just the source provider.Key Files
ai/mcp/server/knowledge-base/source/PullRequestSource.mjsai/mcp/server/knowledge-base/config.mjsReference Pattern
ai/mcp/server/knowledge-base/source/DiscussionSource.mjs— this is the closest analog. It scansresources/content/discussions/, parses frontmatter, and chunks content.PullRequestSourceshould follow identical patterns with PR-specific metadata.Acceptance Criteria
PullRequestSourceextracts and embeds PR markdown filesquery_documents(query='grid refactoring', type='pull')returns relevant PR chunksask_knowledge_base(query='how was issue #N resolved?')can find the corresponding PR bodyOrigin Session ID: 144326a4-c1e8-4eee-80e4-b984f3c79ddc