M6.1 PI Agent core #51

Open
opened 2026-04-08 23:24:56 +00:00 by claude-code · 0 comments
Collaborator

Phase 6 — PI Orchestrator, milestone 1.

Goal

The Principal Investigator agent: a coordinator that dispatches multiple researchers in parallel, processes their results, and produces a unified answer. This is what V1's CLI shim is a placeholder for.

Scope

  • New package orchestrator/pi.py
  • class PrincipalInvestigator with:
    • A registry of available researchers (web, arxiv, …) discovered via MCP tool listing
    • async investigate(question, depth, constraints) -> InvestigationResult
    • Parallel dispatch via asyncio.gather — fans out the question to all relevant researchers
    • Discovery event processing — when a researcher returns discovery_events suggesting another researcher, the PI dispatches a follow-up call
    • Cross-researcher contradiction detection — compares raw_excerpt fields across researchers' citations; surfaces disagreements
    • Gap-driven decision logicBUDGET_EXHAUSTED → re-dispatch with larger budget; SOURCE_NOT_FOUND → try a different researcher; SCOPE_EXCEEDED → escalate to user
    • Synthesis — final answer with full provenance: every claim traces to a citation that traces to a researcher that traces to a source
  • New top-level type InvestigationResult extending ResearchResult with per-researcher attribution

Tests

  • Mock two researchers, one returning a result with a related_research discovery_event pointing at the other; assert the PI dispatches the follow-up
  • Mock contradiction: two researchers return citations with the same locator but different raw_excerpt → PI surfaces it
  • Mock budget exhaustion: PI re-dispatches with the next-bigger budget tier

Out of scope

  • The user-facing UI (M6.2)
  • Cost accounting across researchers (extend M2.5.2 ledger if needed — separate sub-issue)
Phase 6 — PI Orchestrator, milestone 1. ## Goal The Principal Investigator agent: a coordinator that dispatches multiple researchers in parallel, processes their results, and produces a unified answer. This is what V1's CLI shim is a placeholder for. ## Scope - New package `orchestrator/pi.py` - `class PrincipalInvestigator` with: - A registry of available researchers (web, arxiv, …) discovered via MCP tool listing - `async investigate(question, depth, constraints) -> InvestigationResult` - **Parallel dispatch** via `asyncio.gather` — fans out the question to all relevant researchers - **Discovery event processing** — when a researcher returns `discovery_events` suggesting another researcher, the PI dispatches a follow-up call - **Cross-researcher contradiction detection** — compares `raw_excerpt` fields across researchers' citations; surfaces disagreements - **Gap-driven decision logic** — `BUDGET_EXHAUSTED` → re-dispatch with larger budget; `SOURCE_NOT_FOUND` → try a different researcher; `SCOPE_EXCEEDED` → escalate to user - **Synthesis** — final answer with full provenance: every claim traces to a citation that traces to a researcher that traces to a source - New top-level type `InvestigationResult` extending `ResearchResult` with per-researcher attribution ## Tests - Mock two researchers, one returning a result with a `related_research` discovery_event pointing at the other; assert the PI dispatches the follow-up - Mock contradiction: two researchers return citations with the same `locator` but different `raw_excerpt` → PI surfaces it - Mock budget exhaustion: PI re-dispatches with the next-bigger budget tier ## Out of scope - The user-facing UI (M6.2) - Cost accounting across researchers (extend M2.5.2 ledger if needed — separate sub-issue)
archeious added this to the Phase 6: PI Orchestrator milestone 2026-04-08 23:25:14 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: archeious/marchwarden#51
No description provided.