mofa-research
A DOT-based deep research pipeline that dynamically plans N search angles via LLM, executes them in parallel, then analyzes and synthesizes sequentially:
plan_and_search ──(N dynamic workers)──→ analyze ──→ synthesize
(strong) (strong, goal gate)
- Plan — LLM generates 4-6 search angles tailored to the query (strong model)
- Search — Spawns N search agents concurrently (cheap model, web tools)
- Analyze — Cross-references all search outputs, organizes by subtopic (strong model)
- Synthesize — Produces a structured report with citations (strong model, goal gate)
Usage
run_pipeline(pipeline="mofa-research/deep_research", input="<research topic>")
The pipeline file is at ~/.octos/skills/mofa-research/deep_research.dot.
How it works
The plan_and_search node uses handler="dynamic_parallel":
- The planner LLM call generates a JSON array of
{task, label}objects - Each task becomes a synthetic Codergen worker node with the
worker_prompttemplate - All workers run concurrently via
futures::join_all - When all complete, their outputs are merged and fed to the
analyzenode - Fallback: if the planner fails or returns <2 tasks, 3 generic angles are used
Compared to the old static parallel approach (4 hardcoded angles), dynamic_parallel:
- Adapts the number and type of search angles to each query
- Generates cross-language angles automatically
- Can produce 4-8 angles depending on topic complexity
Performance
With dynamic parallel search agents (~300s each):
- Sequential (old): ~1200s + analyze + synthesize = ~1800s
- Dynamic parallel (new): ~300s + analyze + synthesize = ~900s (2x overall speedup)
Data flow between nodes
- plan_and_search → analyze: All N worker outputs are merged with
## Labelheaders and---separators - analyze → synthesize: The analysis is passed as-is to the synthesis node
Each worker runs an independent agent with fresh context plus the original user input.
Customization
Copy deep_research.dot and edit:
prompt— change the planning prompt to control how angles are generatedworker_prompt— template for each worker (use{task}placeholder)planner_model/model— change which ProviderRouter keys to usetools="deep_search,read_file"— restrict which tools each worker can accessmax_tasks="8"— cap on number of dynamic taskstimeout_secs="600"— per-worker timeout- Add intermediate nodes (e.g.
fact_checkbetween analyze and synthesize)