Research Finding
Sources:
- AdaptOrch — arXiv:2602.16873 (2025): task-adaptive topology selection, 12-23% improvement over static baselines
- CASTER — arXiv 2601.19793 (Jan 2026): difficulty-aware routing, up to 72.4% cost reduction with no quality loss
Problem
Zeph's orchestration uses TaskGraph + DagScheduler + AgentRouter with a rule-based 3-step fallback. After LlmPlanner produces a task DAG, Zeph always uses the same execution topology and always routes to the same provider tier regardless of task structure or complexity. Two independent improvements from recent research can be layered on top:
Phase 1: Topology Selection (AdaptOrch)
After LlmPlanner produces a TaskGraph, classify its shape and pick the execution strategy:
| DAG shape |
Topology |
| All nodes independent |
parallel dispatch via DagScheduler |
| Linear chain |
sequential (already default) |
| Fan-out root |
hierarchical (coordinator + workers) |
| Mixed |
hybrid (parallel sub-chains with merge step) |
Implementation:
- Add
TopologyClassifier in zeph-core::orchestration: heuristic on edge count / depth / fan-out ratio
- Pass topology hint to
DagScheduler to control concurrency limits and aggregation strategy
- Config:
[orchestration] topology_selection = true
Complexity: LOW — simple heuristic on existing TaskGraph structure, no new models required.
Phase 2: Difficulty-Aware Routing (CASTER)
For each task node in the DAG, estimate difficulty and route to appropriately sized model:
- Simple nodes (file reads, formatting) → cheap model (compatible/ollama)
- Complex reasoning nodes → cloud model (claude)
Implementation:
- Extend
TaskNode with difficulty_hint: Option<f32> populated by LlmPlanner during decomposition
- In
DagScheduler::spawn_task(), pass difficulty_hint to AgentRouter as weight modifier
AgentRouter maps difficulty → preferred provider tier
- Log routing decisions per task node with difficulty score and provider selected
- Collect failed task outcomes → feed back into Thompson Sampling EMA (already tracks outcomes)
- Config:
[llm.router] difficulty_routing = true
Complexity: HIGH — requires LLM-side difficulty estimation in LlmPlanner, DagScheduler integration, router extension. Implement incrementally: start with LlmPlanner emitting difficulty hints, wire routing later.
Integration Points
References
- arXiv:2602.16873 (AdaptOrch)
- arXiv:2601.19793 (CASTER)
Research Finding
Sources:
Problem
Zeph's orchestration uses
TaskGraph+DagScheduler+AgentRouterwith a rule-based 3-step fallback. AfterLlmPlannerproduces a task DAG, Zeph always uses the same execution topology and always routes to the same provider tier regardless of task structure or complexity. Two independent improvements from recent research can be layered on top:Phase 1: Topology Selection (AdaptOrch)
After
LlmPlannerproduces aTaskGraph, classify its shape and pick the execution strategy:DagSchedulerImplementation:
TopologyClassifierinzeph-core::orchestration: heuristic on edge count / depth / fan-out ratioDagSchedulerto control concurrency limits and aggregation strategy[orchestration] topology_selection = trueComplexity: LOW — simple heuristic on existing
TaskGraphstructure, no new models required.Phase 2: Difficulty-Aware Routing (CASTER)
For each task node in the DAG, estimate difficulty and route to appropriately sized model:
Implementation:
TaskNodewithdifficulty_hint: Option<f32>populated byLlmPlannerduring decompositionDagScheduler::spawn_task(), passdifficulty_hinttoAgentRouteras weight modifierAgentRoutermaps difficulty → preferred provider tier[llm.router] difficulty_routing = trueComplexity: HIGH — requires LLM-side difficulty estimation in
LlmPlanner,DagSchedulerintegration, router extension. Implement incrementally: start withLlmPlanneremitting difficulty hints, wire routing later.Integration Points
zeph-core:orchestration/(TopologyClassifier, DagScheduler),agent/planner.rs,agent/scheduler.rszeph-llm:router/thompson.rs(difficulty weight modifier)References