ResearchIt is a config-driven research engine and product shell built for decision-grade analysis.
Instead of a single fluent response, each run produces structured outputs with:
- explicit evidence and confidence per unit,
- critic challenges and analyst responses,
- source verification signals,
- quality gate outcomes and reason codes,
- reproducible artifacts for audit/export.
Quality objective and release priority are defined in docs/quality-bar.md.
researchit/
app/ # Product shell (React + Vite + API routes)
engine/ # Reusable analysis engine (@researchit/engine)
configs/ # ResearchConfig definitions
docs/ # Architecture and quality docsResearch runs now execute through one canonical orchestrator for both scorecard and matrix modes:
engine/pipeline/orchestrator.js- stage modules under
engine/pipeline/stages/* - state/contract mapping under
engine/pipeline/contracts/*
Entry points:
runAnalysis()inengine/pipeline/analysis.jsrunMatrixAnalysis()inengine/pipeline/matrix.jsresolveMatrixResearchInput()inengine/pipeline/matrix.js
Follow-up workflow remains in engine/pipeline/followUp.js.
The pipeline uses two actor roles:
Analyst: planning, scoring, recovery, and defend/concedeCritic: coherence checks, overclaim challenge, counter-case
Default model policy in configs/research-configurations.js:
- Analyst reasoning: OpenAI (
gpt-5.4) - Critic reasoning: Anthropic (
claude-sonnet-4-6) - Retrieval-heavy Analyst stages (including synthesis): Gemini (
gemini-2.5-pro)
Route preflight is enforced before paid calls in engine/lib/routing/route-preflight.js.
All run types share this stage order:
stage_01_intakestage_01b_subject_discovery(matrix optional)stage_02_planstage_03a_evidence_memory(Research Team)stage_03b_evidence_web(Research Team)stage_03c_evidence_deep_assist(Deep Research ×3)stage_04_mergestage_05_score_confidencestage_06_source_verifystage_07_source_assessstage_08_recoverstage_09_rescorestage_10_coherencestage_11_challengestage_12_counter_casestage_13_defendstage_14_synthesizestage_15_finalize
Research Team vs Deep Research ×3 differs only inside Stage 03 (03a/03b vs 03c); all downstream stages are shared.
For the canonical pipeline architecture and stage breakdown, see docs/pipeline-architecture.md.
Both output modes now use the same critic/analyst cycle and debate structure:
- critic flags include typed severity/category,
- analyst responses include disposition + mitigation notes where needed,
- matrix and scorecard both surface critic-vs-analyst exchanges in UI.
Stage 15 applies deterministic coverage + decision gates:
- strict mode: failing gate conditions abort the run (
run_aborted_strict_quality) - non-strict mode: recoverable failures can complete as degraded (
run_completed_degraded) - hard-abort coverage floor failure aborts in both modes
Reason codes are defined in engine/pipeline/contracts/reason-codes.js.
engine/lib/legacy-adapter.js exists only for import/read compatibility of legacy artifacts.
Rules:
- pipeline stage modules must not import it,
- no back-porting new stage logic into legacy format,
- remove it at migration sunset (
LEGACY_ADAPTER_SUNSET).
engine/index.js exports:
runAnalysisrunMatrixAnalysisresolveMatrixResearchInputhandleFollowUpcreateTransport
The app consumes the engine package ("@researchit/engine": "file:../engine") and provides transport functions that call API routes:
/api/analyst/api/critic/api/fetch-source
UI pipeline/progress rendering lives in:
app/src/components/ProgressTab.jsxapp/src/components/ExpandedRow.jsx
Matrix debate rendering lives in:
app/src/components/MatrixDebateTab.jsx
Research behavior is configured by ResearchConfig objects in:
configs/research-configurations.js
Config controls:
- output mode (
scorecardormatrix), - dimensions/attributes and matrix subject rules,
- prompts per actor,
- model routing,
- limits/gates (coverage, decision-grade, recovery budgets, token budgets).
Prerequisites:
- Node.js 20+
- npm
Install app deps:
cd app
npm installRun dev server:
cd app
npm run devBuild app:
npm run buildRun engine tests:
npm run test:engineCreate app/.env.local.
Minimum for OpenAI-only experimentation:
OPENAI_API_KEY=sk-...Optional UI feature flag:
VITE_SHOW_PROGRESS_COSTS=true # set false to hide per-stage tokens/price/cost in Progress tabRecommended for canonical multi-provider routing:
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
GEMINI_API_KEY=...
RESEARCHIT_ANALYST_MODEL=gpt-5.4
RESEARCHIT_CRITIC_MODEL=claude-sonnet-4-6Provider/model/base URL resolution precedence remains:
- role-specific
RESEARCHIT_* - global
RESEARCHIT_* OPENAI_*aliasesResearchConfig.models.*- built-in defaults
Primary architecture contract:
Quality policy:
Pipeline architecture and stage-level breakdown: