> ## 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.

# Plan Storage • Rust AI Agent SDK

> PlanStorage: Storage for plans.

# PlanStorage

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

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

Storage for plans.

## Fields

| Name    | Type                    | Description  |
| ------- | ----------------------- | ------------ |
| `plans` | `HashMap&lt;String`     | Plans by ID  |
| `path`  | `Option&lt;PathBuf&gt;` | Storage path |

## Methods

### `new`

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

Create a new storage.

### `with_path`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn with_path(path: impl Into<PathBuf>) -> Self
```

Create with file path.

**Parameters:**

| Name   | Type                       |
| ------ | -------------------------- |
| `path` | `impl Into&lt;PathBuf&gt;` |

### `save`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn save(&mut self, plan: Plan) -> ()
```

Save a plan.

**Parameters:**

| Name   | Type   |
| ------ | ------ |
| `plan` | `Plan` |

### `load`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn load(&self, id: &str) -> Option<&Plan>
```

Load a plan by ID.

**Parameters:**

| Name | Type   |
| ---- | ------ |
| `id` | `&str` |

### `load_mut`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn load_mut(&mut self, id: &str) -> Option<&mut Plan>
```

Load mutable plan by ID.

**Parameters:**

| Name | Type   |
| ---- | ------ |
| `id` | `&str` |

### `delete`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn delete(&mut self, id: &str) -> Option<Plan>
```

Delete a plan.

**Parameters:**

| Name | Type   |
| ---- | ------ |
| `id` | `&str` |

### `list`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn list(&self) -> Vec<&Plan>
```

List all plans.

### `count`

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

Get plan count.

### `persist`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn persist(&self) -> std::io::Result<()>
```

Save to file.

### `restore`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn restore(&mut self) -> std::io::Result<()>
```

Load from file.

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/planning/mod.rs#L402">
  `praisonai/src/planning/mod.rs` at line 402
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust RAG" icon="magnifying-glass" href="/docs/rust/rag" />

  <Card title="Rust Retrieval" icon="search" href="/docs/rust/retrieval" />

  <Card title="Rust Vector Store" icon="database" href="/docs/rust/vector-store" />

  <Card title="Rust Chunking" icon="scissors" href="/docs/rust/chunking" />
</CardGroup>
