> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Planning Agent • Rust AI Agent SDK

> PlanningAgent: Planning agent for multi-step task planning

# PlanningAgent

> Defined in the [**specialized**](../modules/specialized) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Planning agent for multi-step task planning

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    input["Input Data"] --> agent["Agent: PlanningAgent"]
    agent --> output["Output Result"]
    style agent fill:#8B0000,color:#fff
    style input fill:#8B0000,color:#fff
    style output fill:#8B0000,color:#fff
```

## Fields

| Name           | Type                      | Description        |
| -------------- | ------------------------- | ------------------ |
| `config`       | `PlanningAgentConfig`     | Configuration      |
| `plan`         | `Vec&lt;PlanningStep&gt;` | Current plan       |
| `current_step` | `usize`                   | Current step index |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(config: PlanningAgentConfig) -> Self
```

Create a new planning agent

**Parameters:**

| Name     | Type                  |
| -------- | --------------------- |
| `config` | `PlanningAgentConfig` |

### `create_plan`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn create_plan(&mut self, task: &str) -> Vec<PlanningStep>
```

Create a plan from a task

**Parameters:**

| Name   | Type   |
| ------ | ------ |
| `task` | `&str` |

### `add_step`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn add_step(&mut self, description: impl Into<String>) -> ()
```

Add a step to the plan

**Parameters:**

| Name          | Type                      |
| ------------- | ------------------------- |
| `description` | `impl Into&lt;String&gt;` |

### `current`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn current(&self) -> Option<&PlanningStep>
```

Get current step

### `complete_step`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn complete_step(&mut self, result: Option<String>) -> ()
```

Mark current step as complete

**Parameters:**

| Name     | Type                   |
| -------- | ---------------------- |
| `result` | `Option&lt;String&gt;` |

### `fail_step`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn fail_step(&mut self, error: impl Into<String>) -> ()
```

Mark current step as failed

**Parameters:**

| Name    | Type                      |
| ------- | ------------------------- |
| `error` | `impl Into&lt;String&gt;` |

### `steps`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn steps(&self) -> &[PlanningStep]
```

Get all steps

### `is_complete`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn is_complete(&self) -> bool
```

Check if plan is complete

### `progress`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn progress(&self) -> f32
```

Get progress percentage

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/parity/specialized.rs#L178">
  `praisonai/src/parity/specialized.rs` at line 178
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Agent" icon="robot" href="/docs/rust/agent" />

  <Card title="Rust Overview" icon="book-open" href="/docs/rust/overview" />

  <Card title="Rust Quickstart" icon="rocket" href="/docs/rust/quickstart" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />

  <Card title="Rust Autonomy" icon="wand-magic-sparkles" href="/docs/rust/autonomy" />
</CardGroup>
