Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Memory
Defined in the memory module.
Rust AI Agent SDK
Memory manager for agents
Fields
| Name | Type | Description |
|---|
adapter | Box<dyn MemoryAdapter> | - |
config | MemoryConfig | - |
Methods
new
fn new(adapter: impl MemoryAdapter + 'static, config: MemoryConfig) -> Self
Create a new memory with the given adapter
Parameters:
| Name | Type |
|---|
adapter | impl MemoryAdapter + 'static |
config | MemoryConfig |
in_memory
fn in_memory(config: MemoryConfig) -> Self
Create a new in-memory memory
Parameters:
| Name | Type |
|---|
config | MemoryConfig |
default_memory
fn default_memory() -> Self
Create with default config
store
async fn store(&mut self, message: Message) -> Result<()>
Store a message
Parameters:
history
async fn history(&self) -> Result<Vec<Message>>
Get conversation history
search
async fn search(&self, query: &str, limit: usize) -> Result<Vec<Message>>
Search memory
Parameters:
| Name | Type |
|---|
query | &str |
limit | usize |
clear
async fn clear(&mut self) -> Result<()>
Clear memory
config
fn config(&self) -> &MemoryConfig
Get the config
Source
View on GitHub
praisonai/src/memory/mod.rs at line 151