Conversational and chat interface for querying the research corpus

2026-03-08 · rag-retrieval tools-infrastructure knowledge-management · medium · source → · wiki →
key claims
  1. The existing `.github/mcp.json` pattern (10 stdio servers, all subprocess-based) directly accommodates a new `research` MCP server without any new infrastructure, credentials, or persistent process. The research MCP server is a natural extension of what already exists, not a new dependency category
  2. MCP stdio transport uses subprocess invocation per agent session — the server process lives only for the duration of the session and terminates when the session ends. Cold-start latency for a Python stdio server is 30–300ms; per-request file I/O on GitHub Actions SSD-backed runners is < 10ms. These are acceptable for interactive agent use
  3. The correct interface contract has three tools: `search_research(query, tags, limit)` returning ranked excerpts, `get_research_item(slug)` returning full Markdown, and `get_related_items(slug)` navigating the `state/links.json` edge store. The server returns ranked lists; the calling LLM agent synthesises answers. The server is a retrieval tool, not a reasoning engine
  4. Grounding is architectural, not just instructional: because `search_research` can only return items from `Research/completed/`, the model cannot hallucinate corpus content that doesn't exist — it can only hallucinate synthesis or extrapolation from what was returned. Prompt-level instructions ("cite the item slug for every claim; if the corpus does not cover this topic, say so") address the remaining synthesis hallucination risk
  5. The GitHub Copilot Extension (OAuth app) model requires a publicly hosted HTTPS server, OAuth app registration, and a webhook handler — three constraints that make it infeasible for this repository. As of 2025, GitHub's "building Copilot extensions" documentation redirects to MCP as the primary extension mechanism, confirming the MCP server approach is the recommended path for Copilot integration
  6. GitHub Copilot's Agent Skills (`.github/skills/`) and custom agents (`.github/agents/`) provide persona and instructions but cannot run corpus searches — they have no query capability against the research files. They are not a substitute for an MCP search tool; they are an optional complement for configuring agent behaviour
  7. The CLI chatbot approach is blocked by the absence of an approved direct LLM API credential (Anthropic/OpenAI) in this repository's credential table. The approach is technically viable in isolation but violates the AGENTS.md hard-stop rule against introducing new external services without explicit approval. If an API key is later approved, the CLI chatbot becomes an optional high-level wrapper over the same MCP tools
  8. Phase 1 (grep-based search) can be implemented immediately and independently of the `2026-03-02-semantic-full-text-search.md` item. Phase 2 upgrades the search backend to SQLite FTS5 (and optionally vector search) without changing the MCP tool interface, preserving all downstream integrations

Research Question

What is the best approach to expose the Research/completed/ corpus as a queryable, conversational interface — so that a user (or an AI agent) can ask "what do I know about X?" and receive a grounded, cited answer drawn from completed research items?

Findings

Executive Summary

An MCP server with stdio transport — registered in .github/mcp.json alongside the repository's existing 10 MCP servers — is the correct and only viable approach for a conversational research-corpus interface under this repository's constraints. The server exposes three tools (search_research, get_research_item, get_related_items) and requires no persistent process, no new credentials, and no hosted infrastructure. The GitHub Copilot Extension (OAuth app) approach is eliminated by the no-persistent-server constraint; the CLI chatbot approach is blocked by the absence of an approved LLM API key (Anthropic/OpenAI). Grounding is structural — the server can only return items from Research/completed/ — and is reinforced by instructional prompt patterns directing the calling agent to cite item slugs and decline to answer questions not covered by the corpus. The implementation splits into two phases: Phase 1 ships immediately using grep-based search; Phase 2 upgrades to SQLite FTS5 after the 2026-03-02-semantic-full-text-search.md item is complete, with the MCP tool interface unchanged across both phases.

Key Findings

  1. The existing .github/mcp.json pattern (10 stdio servers, all subprocess-based) directly accommodates a new research MCP server without any new infrastructure, credentials, or persistent process. The research MCP server is a natural extension of what already exists, not a new dependency category.

  2. MCP stdio transport uses subprocess invocation per agent session — the server process lives only for the duration of the session and terminates when the session ends. Cold-start latency for a Python stdio server is 30–300ms; per-request file I/O on GitHub Actions SSD-backed runners is < 10ms. These are acceptable for interactive agent use.

  3. The correct interface contract has three tools: search_research(query, tags, limit) returning ranked excerpts, get_research_item(slug) returning full Markdown, and get_related_items(slug) navigating the state/links.json edge store. The server returns ranked lists; the calling LLM agent synthesises answers. The server is a retrieval tool, not a reasoning engine.

  4. Grounding is architectural, not just instructional: because search_research can only return items from Research/completed/, the model cannot hallucinate corpus content that doesn't exist — it can only hallucinate synthesis or extrapolation from what was returned. Prompt-level instructions ("cite the item slug for every claim; if the corpus does not cover this topic, say so") address the remaining synthesis hallucination risk.

  5. The GitHub Copilot Extension (OAuth app) model requires a publicly hosted HTTPS server, OAuth app registration, and a webhook handler — three constraints that make it infeasible for this repository. As of 2025, GitHub's "building Copilot extensions" documentation redirects to MCP as the primary extension mechanism, confirming the MCP server approach is the recommended path for Copilot integration.

  6. GitHub Copilot's Agent Skills (.github/skills/) and custom agents (.github/agents/) provide persona and instructions but cannot run corpus searches — they have no query capability against the research files. They are not a substitute for an MCP search tool; they are an optional complement for configuring agent behaviour.

  7. The CLI chatbot approach is blocked by the absence of an approved direct LLM API credential (Anthropic/OpenAI) in this repository's credential table. The approach is technically viable in isolation but violates the AGENTS.md hard-stop rule against introducing new external services without explicit approval. If an API key is later approved, the CLI chatbot becomes an optional high-level wrapper over the same MCP tools.

  8. Phase 1 (grep-based search) can be implemented immediately and independently of the 2026-03-02-semantic-full-text-search.md item. Phase 2 upgrades the search backend to SQLite FTS5 (and optionally vector search) without changing the MCP tool interface, preserving all downstream integrations.

  9. The get_related_items tool consuming state/links.json provides cross-reference navigation that keyword search cannot replicate — it answers "what else is connected to this research?" based on typed relationships, not keyword co-occurrence. This requires the state/links.json edge store to be populated, which depends on 2026-03-03-knowledge-linking-connected-corpus.md being implemented.

  10. An ADR is required before shipping the MCP server: it documents the stdio transport choice, three-tool interface contract, grounding design, two-phase implementation plan, and confirms no new credentials or services are introduced.

Assumptions

Analysis

The three-way evaluation between MCP server, Copilot Extension, and CLI chatbot resolves cleanly along two axes: server infrastructure requirement and credential requirement. Only the MCP server satisfies both constraints (no persistent server, no new credential). The Copilot Extension (OAuth) fails the infrastructure constraint; the CLI chatbot fails the credential constraint.

Within the MCP server approach, the interface contract decision (ranked list vs. synthesised answer) resolves correctly: the server is a retrieval tool, and synthesis is delegated to the calling LLM. This matches the MCP design pattern established in the context-mode research and avoids a scenario where the server would need its own LLM integration to generate answers.

The two-phase implementation plan (grep now, BM25 later) is the correct risk management approach: it delivers value immediately without blocking on the search layer item, while preserving the option to upgrade without changing the external interface.

The grounding design (structural + instructional) is appropriate. Structural grounding (tool-scoped retrieval) handles the primary risk (model inventing corpus items that don't exist). Instructional grounding (cite the slug) handles the secondary risk (model extrapolating beyond what the retrieved items actually say). No additional LLM validation layer is required.

Risks, Gaps, and Uncertainties

Open Questions

Output section

sources


Connected items

Loading…

View full knowledge graph →