Crate ambush

Crate ambush 

Source
Expand description

§Ambush

Task decomposition and plan mode for AI agents - planning the attack.

This crate provides:

  • Task decomposition into sub-tasks
  • Plan generation with dependency graphs
  • Agent assignment strategies
  • Complexity estimation

§Plan Mode

When plan mode is enabled, user requests are converted to structured plans before execution begins:

User Request: "Add user authentication"
          │
          ▼
  ┌───────────────────┐
  │   TaskPlanner     │
  │ ┌───────────────┐ │
  │ │  Decomposer   │ │ → Breaks into sub-tasks
  │ ├───────────────┤ │
  │ │   Analyzer    │ │ → Estimates complexity
  │ ├───────────────┤ │
  │ │   Assigner    │ │ → Maps to agent roles
  │ └───────────────┘ │
  └─────────┬─────────┘
            │
            ▼
    ┌───────────────┐
    │   TaskPlan    │
    │  Steps: 5     │
    │  Agents: 3    │
    │  Est: 50k tok │
    └───────────────┘

§Example

use ambush::{TaskPlanner, PlanConfig};

let config = PlanConfig::default();
let planner = TaskPlanner::new(config);

let plan = planner.plan("Add user authentication to the app").await?;
println!("Generated {} steps", plan.steps.len());

Re-exports§

pub use planner::TaskPlanner;
pub use decomposer::TaskDecomposer;
pub use analyzer::ComplexityAnalyzer;
pub use assigner::AgentAssigner;
pub use error::PlannerError;
pub use types::*;

Modules§

analyzer
Complexity analysis
assigner
Agent role assignment
decomposer
Task decomposition logic
error
Planner error types
planner
Main task planner
types
Planner type definitions

Structs§

PlanStep
A single step in a plan
TaskPlan
A task decomposition plan

Enums§

AgentRole
Role of an agent in the hierarchy
PlanGranularity
Granularity of task planning
StepComplexity
Complexity of a plan step