Expand description
Multi-model task orchestration: DAG execution, failure propagation, and persistence.
zeph-orchestration decomposes a user goal into a directed acyclic graph (DAG)
of sub-tasks, schedules them for concurrent execution by specialised sub-agents,
and synthesises the results into a coherent final response.
§Architecture overview
User goal
│
▼
[Planner] ──LLM──► TaskGraph (DAG)
│
▼
[DagScheduler] ──tick()──► SchedulerAction
│ │
│ ┌────────────────┘
│ ▼
│ spawn sub-agent / run inline / cancel / done
│
▼ (TaskEvent)
[DagScheduler] records outcome, applies failure strategy, routes next tasks
│
▼
[Aggregator] ──LLM──► synthesised response§Core types
TaskGraph/TaskNode— the DAG and its nodesDagScheduler— drives execution, emitsSchedulerActionsPlanner/LlmPlanner— decomposes a goal into aTaskGraphAggregator/LlmAggregator— synthesises completed task outputsAgentRouter/RuleBasedRouter— selects the best agent for a taskPlanCache— caches and reuses completed plan skeletonsPlanVerifier— post-task completeness verifier with targeted replan
§Feature flags
This crate has no optional Cargo features. All orchestration primitives are always available when the crate is in the dependency graph.
§Example: build a plan and run the scheduler
ⓘ
use zeph_orchestration::{LlmPlanner, DagScheduler, RuleBasedRouter};
use zeph_config::OrchestrationConfig;
let config = OrchestrationConfig::default();
let planner = LlmPlanner::new(my_provider, &config);
let (graph, _usage) = planner.plan("build and deploy service", &agents).await?;
let scheduler = DagScheduler::new(
graph,
&config,
Box::new(RuleBasedRouter),
agents.clone(),
)?;
// drive the scheduler loop …Re-exports§
pub use adaptorch::AdaptOrchMetrics;pub use adaptorch::AdvisorVerdict;pub use adaptorch::TaskClass;pub use adaptorch::TopologyAdvisor;pub use adaptorch::TopologyHint;pub use aggregator::Aggregator;pub use aggregator::LlmAggregator;pub use cascade::AbortDecision;pub use cascade::CascadeConfig;pub use cascade::CascadeDetector;pub use cascade::RegionHealth;pub use command::PlanCommand;pub use error::OrchestrationError;pub use graph::ExecutionMode;pub use graph::FailureStrategy;pub use graph::GraphId;pub use graph::GraphPersistence;pub use graph::GraphStatus;pub use graph::TaskGraph;pub use graph::TaskId;pub use graph::TaskNode;pub use graph::TaskResult;pub use graph::TaskStatus;pub use lineage::ErrorLineage;pub use lineage::LineageEntry;pub use lineage::LineageKind;pub use lineage::classify_error;pub use plan_cache::PlanCache;pub use plan_cache::PlanCacheError;pub use plan_cache::PlanTemplate;pub use plan_cache::TemplateTask;pub use plan_cache::normalize_goal;pub use plan_cache::plan_with_cache;pub use planner::LlmPlanner;pub use planner::Planner;pub use router::AgentRouter;pub use router::RuleBasedRouter;pub use scheduler::DagScheduler;pub use scheduler::SchedulerAction;pub use scheduler::TaskEvent;pub use scheduler::TaskOutcome;pub use topology::DispatchStrategy;pub use topology::Topology;pub use topology::TopologyAnalysis;pub use topology::TopologyClassifier;pub use verifier::Gap;pub use verifier::GapSeverity;pub use verifier::PlanVerifier;pub use verifier::VerificationResult;pub use verify_predicate::PredicateEvaluator;pub use verify_predicate::PredicateOutcome;pub use verify_predicate::VerifyPredicate;
Modules§
- adaptorch
AdaptOrch— bandit-driven topology advisor for the LLM planner.- aggregator
- Result aggregation: collect completed task outputs and synthesise a coherent summary.
- cascade
- Cascade-aware routing for DAG execution (arXiv:2603.17112).
- command
- dag
- DAG algorithm primitives: validation, topological sort, ready-task detection, failure propagation, and retry reset.
- error
- graph
- lineage
- Error lineage tracking for DAG cascade abort defense (arXiv:2603.04474).
- plan_
cache - Plan template caching for the LLM planner.
- planner
- LLM-based goal decomposition into a validated
TaskGraph. - router
- Agent routing: selects the best agent definition for a given task.
- scheduler
- DAG execution scheduler: drives task graph execution by emitting
SchedulerActioncommands. - topology
- Heuristic topology classification for
TaskGraphDAGs. - verifier
- Post-task completeness verifier with targeted replan for detected gaps.
- verify_
predicate - Per-subtask verification predicates (predicate gate).