Convert Claude Code or Codex into the most intelligent Deep Research Agent. Collect, search, and synthesize web research into a persistent, searchable wiki that builds on itself. Hosted API + MCP: hyperresearch.ai
name: hyperresearch-4-loci-analysis description: > Step 4 of the hyperresearch V8 pipeline. Spawns 2 parallel loci-analyst subagents that read the width corpus and identify 1-6 specific questions where depth investigation will pay off. Deduplicates and scores each locus on importance/uncertainty/disagreement/decision_impact, then allocates source budgets dynamically. Invoked via Skill tool from the entry skill (full tier only).
Step 4 — Loci analysis (parallel, 2 analysts)
Tier gate: SKIP entirely for light tier — proceed directly to step 9. Only full tier runs loci analysis.
Goal: identify 1–6 specific questions where depth investigation will pay off.
Recover state
Read these inputs:
research/runs/<vault_tag>/scaffold.md— vault_tagresearch/runs/<vault_tag>/prompt-decomposition.json— atomic items, sub-questionsresearch/runs/<vault_tag>/temp/contradiction-graph.json— ranked fight clusters (if step 3 ran)research/runs/<vault_tag>/temp/coverage-gaps.md— which atomic items have weak coverage
Survey the corpus: {hpr_path} note list --tag <vault_tag> --all -j to confirm width sweep is complete.
Procedure
Spawn 2
hyperresearch-loci-analystsubagents in parallel (ONE message, all 2 Task calls). Each analyst gets a letter id in order —a,b,c, ... — and writes to its own output file. All read the same width corpus but return independently.Spawn template:
subagent_type: hyperresearch-loci-analyst prompt: | RESEARCH QUERY (verbatim, gospel): > {{paste research/runs/<vault_tag>/query.md body}} QUERY FILE: research/runs/<vault_tag>/query.md PIPELINE POSITION: You are step 4 (loci-analyst, instance <analyst_id> of 2) of the hyperresearch V8 pipeline. The width sweep (step 2) populated the vault tagged <vault_tag>. The contradiction graph (step 3) lives at research/runs/<vault_tag>/temp/contradiction-graph.json. After you and the other analysts return, the orchestrator dedupes your loci and assigns budgets. YOUR INPUTS: - corpus_tag: <vault_tag> - analyst_id: "<analyst_id>" (one letter per analyst: a, b, c, ...) - output_path: research/runs/<vault_tag>/loci-<analyst_id>.json RUN DIRECTIVES: append the FULL contents of research/runs/<vault_tag>/shims/research.md here, verbatim.Wait for all 2. If some fail, proceed with the successful outputs. If every analyst fails (empty loci lists), tell the user the width sweep was too thin and stop — do not force depth on a weak corpus.
Deduplicate and clamp to 6.
- Read every analyst's JSON output (
research/runs/<vault_tag>/loci-<analyst_id>.json). - Dedupe on
name(exact match) or near-match (same core question, different phrasing). When in doubt, prefer the entry with strongercorpus_evidence. - If the deduped list exceeds 6, drop the weakest entries — rank by how load-bearing the rationale is for the canonical research query.
- Persist every analyst's
skip_lociarray in the merged output — union them under a top-levelskip_locikey. These justifications matter downstream.
- Read every analyst's JSON output (
Score and budget each locus (dynamic depth allocation). For each surviving locus, compute four dimensions:
- importance (0-10): how central is this locus to the research_query? A locus that directly answers a primary sub-question scores 8-10; tangential enrichment scores 2-4.
- uncertainty (0-10): how uncertain is the current evidence? If the contradiction graph shows a sharp fight with equal-quality evidence on both sides, uncertainty is high (8-10). If one side has clearly stronger evidence, moderate (4-6). If the corpus already resolves this, low (1-3).
- disagreement (0-10): how many independent sources disagree? Proxy from the contradiction cluster size. Singletons score low (2-3); multi-source fights score high (7-10). If no contradiction graph exists, estimate from the loci analyst's
opposing_positions. - decision_impact (0-10): would resolving this locus change the draft's recommendation or thesis? If yes, high (8-10). If it adds nuance but doesn't change direction, moderate (4-6).
Composite score = importance + uncertainty + disagreement + decision_impact (max 40).
Allocate source budgets. Total source budget for step 5 is 40. Distribute proportionally:
- Loci scoring 30-40:
source_budgetup to 15 (deep dive) - Loci scoring 20-29:
source_budgetup to 10 (standard) - Loci scoring 10-19:
source_budgetup to 5 (shallow pass) - Loci scoring <10:
source_budget0-3, or skip investigation entirely
It's fine if only 1-2 loci score above 20 — allocate heavily to them.
Write scored loci to
research/runs/<vault_tag>/loci.json. Schema:{ "loci": [ { "name": "...", "one_line": "...", "flavor": "dialectical|synthesis|technical", "importance": 8, "uncertainty": 7, "disagreement": 6, "decision_impact": 9, "composite_score": 30, "source_budget": 12, "rationale": "..." } ], "skip_loci": [...union from all analysts...] }Decide investigator count. Spawn ONE depth-investigator (in step 5) per locus with
source_budget > 0, capped at 6. If only 1 locus passes scoring, spawn 1.Reconsider
inference_depthagainst the actual corpus. Step 1 set it provisionally from the query alone; you have now seen what the surface web actually holds. Upgrade todeepwhen the corpus shows the load-bearing questions are underdetermined by clearly-published sources — high-uncertainty loci where the missing evidence is gray literature, filings, or unpublished figures rather than papers nobody fetched yet. Downgrade tosurfaceonly if step 1 chosedeepand the corpus turned out rich and univocal. To change it:{hpr_path} levers set <vault_tag> inference_depth=deep --rerender -jThe
--rerenderrefreshes the shim files so step 5's investigators inherit the new posture. If the step-1 value still fits, do nothing.
INVARIANT: at least one flavor: "dialectical" locus must be present unless an analyst's skip_loci justifies its absence with specific evidence of a univocal corpus. No dialectical locus + no justification = re-spawn the loci-analyst with a tighter prompt.
Placeholder-breadcrumb ban: depth investigators will fetch sources; do not hand them breadcrumb placeholders like hyperresearch-locus-seed — use real source note ids from the vault or omit --suggested-by entirely.
Exit criterion
research/runs/<vault_tag>/loci.jsonexists with at least 1 locus (or every analyst justified skip withskip_loci)- At least one dialectical locus OR a documented justification in
skip_loci - All retained loci have
source_budgetallocated
Next step
Return to the entry skill (hyperresearch). Invoke step 5:
Skill(skill: "hyperresearch-5-depth-investigation")