Memory Config • Rust AI Agent SDK

MemoryConfig: Memory configuration

MemoryConfig

Defined in the config module.

Rust AI Agent SDK

Memory configuration

Fields

NameTypeDescription
use_short_termboolEnable short-term memory (conversation history)
use_long_termboolEnable long-term memory (persistent storage)
providerStringMemory provider (e.g., “memory”, “chroma”, “sqlite”)
max_messagesusizeMaximum number of messages to keep in short-term memory

Methods

new

rust
fn new() -> Self

Create a new memory config with defaults

with_long_term

rust
fn with_long_term(mut self) -> Self

Enable long-term memory

provider

rust
fn provider(mut self, provider: impl Into<String>) -> Self

Set the memory provider

Parameters:

NameType
providerimpl Into&lt;String&gt;

max_messages

rust
fn max_messages(mut self, max: usize) -> Self

Set max messages

Parameters:

NameType
maxusize

Source

View on GitHub

praisonai/src/config.rs at line 27


Related Documentation