> ## 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 Config • Rust AI Agent SDK

> MemoryConfig: Memory configuration

# MemoryConfig

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

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

Memory configuration

## Fields

| Name             | Type     | Description                                             |
| ---------------- | -------- | ------------------------------------------------------- |
| `use_short_term` | `bool`   | Enable short-term memory (conversation history)         |
| `use_long_term`  | `bool`   | Enable long-term memory (persistent storage)            |
| `provider`       | `String` | Memory provider (e.g., "memory", "chroma", "sqlite")    |
| `max_messages`   | `usize`  | Maximum number of messages to keep in short-term memory |

## Methods

### `new`

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

Create a new memory config with defaults

### `with_long_term`

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

Enable long-term memory

### `provider`

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

Set the memory provider

**Parameters:**

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

### `max_messages`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn max_messages(mut self, max: usize) -> Self
```

Set max messages

**Parameters:**

| Name  | Type    |
| ----- | ------- |
| `max` | `usize` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/config.rs#L27">
  `praisonai/src/config.rs` at line 27
</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" />

  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

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