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

# Memory Protocol • Rust AI Agent SDK

> MemoryProtocol: Protocol for memory implementations.

# MemoryProtocol

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

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

Protocol for memory implementations.

## Methods

### `store`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn store(&mut self, role: &str, content: &str) -> Result<()>
```

Store a message in memory

**Parameters:**

| Name      | Type   |
| --------- | ------ |
| `role`    | `&str` |
| `content` | `&str` |

### `history`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn history(&self) -> Result<Vec<MemoryMessage>>
```

Get conversation history

### `clear`

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

Clear memory

### `search`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async fn search(&self, query: &str, limit: usize) -> Result<Vec<MemoryMessage>>
```

Search memory

**Parameters:**

| Name    | Type    |
| ------- | ------- |
| `query` | `&str`  |
| `limit` | `usize` |

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Memory" icon="database" href="/docs/rust/memory" />

  <Card title="Rust Sessions" icon="clock" href="/docs/rust/sessions" />

  <Card title="Rust Knowledge" icon="book" href="/docs/rust/knowledge" />
</CardGroup>
