-
Notifications
You must be signed in to change notification settings - Fork 2
Description
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
TopologyClassifierinzeph-core::orchestration: heuristic on edge count / depth / fan-out ratio - Pass topology hint to
DagSchedulerto 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
TaskNodewithdifficulty_hint: Option<f32>populated byLlmPlannerduring decomposition - In
DagScheduler::spawn_task(), passdifficulty_hinttoAgentRouteras weight modifier AgentRoutermaps 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
zeph-core:orchestration/(TopologyClassifier, DagScheduler),agent/planner.rs,agent/scheduler.rszeph-llm:router/thompson.rs(difficulty weight modifier)- Architecture reference: research(memory): multi-agent memory architecture — cache coherency and access control (vision) #1866 (multi-agent memory vision — cache coherency across agent tiers)
References
- arXiv:2602.16873 (AdaptOrch)
- arXiv:2601.19793 (CASTER)