research_pipeline
Structure and preserve research findings through a six-phase workflow: create outline, gather content, review quality, analyze data, verify claims, and finalize reports.
Instructions
[PIPELINE] RECOMMENDED for research tasks. Orchestrates all underlying Context-First layers through 6 phases (init→gather→review→analyze→verify→finalize). NEW: plan→draft→review→fix loop — like compile→test→fix in coding. Init generates a research outline (12+ sections). Each gather adds depth to one section with quality gate (25K char / 500 line min — multiple gathers per section expected). Review runs quality tests and identifies gaps. CRITICAL: Interleave web search and gather — after EACH search, IMMEDIATELY call gather with deeply written content. Do NOT batch searches. Each gather writes a file to disk. After sufficient gathers, call review to run quality tests. Fix failed sections by gathering again with metadata.targetSection=N. Coverage must reach 60% before analyze. Autonomous file writing is ALWAYS ON — files are written to disk during gather, analyze, and finalize phases. Provide outputDir to control destination, or let the pipeline auto-create a temp directory. Finalize works even if verify hasn't passed. It does not browse the web or invent source material for you; use it to structure, preserve, pressure-test, and export sourced findings collected from web, GitHub, fetch, or other MCP tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | No | default | |
| phase | Yes | Pipeline phase. Call in order: init → gather (repeatable) → review → analyze → verify → finalize. Each phase auto-chains the appropriate layer tools internally. Analyze is blocked until gathered evidence clears the weak-evidence gate and coverage ≥ 60%. | |
| content | Yes | Phase-specific content: init=task description, gather=WRITE a deeply researched section based on your LATEST web search. CRITICAL WORKFLOW: Do ONE web search, then IMMEDIATELY call gather. Repeat. Do NOT do multiple searches before calling gather — content gets lost to compaction. You are a research AUTHOR: use the search result as input to write a comprehensive section with specific facts, data, analysis, relationships, and expert commentary. Each gather call writes one file to disk immediately — this is the pipeline's core output. analyze=problem/question to reason about (runs on accumulated gather files), verify=draft output to verify (runs on accumulated files), finalize=final summary to persist (synthesizes all files) | |
| outputDir | No | RECOMMENDED. When provided, the pipeline autonomously writes enriched research files to this directory during gather, analyze, and finalize phases. This eliminates the need for the LLM to write files manually — the pipeline writes them itself, like how export_research_files works but incrementally per-phase. Files survive context compaction because they are on disk, not just in memory. Prefer an absolute path. | |
| baseFileName | No | Base filename prefix for autonomously written files when outputDir is set. Produces files like research.batch-001.topic-slug.md, research.analysis-001.md, research.synthesis.md | research |
| messages | No | Recent conversation messages for context_loop | |
| claim | No | Specific claim to fact-check (verify phase) | |
| metadata | No | Optional metadata for memory storage and finalize/export controls. Supported conventions: sourceTools during gather, maxChunkChars during finalize, exportChunkIndex during finalize chunk retrieval, outline (Array<{title, description}>) during gather to set the research outline, targetSection (number) during gather to expand/append depth to a specific outline section (multi-gather accumulation). |