Memory Protocol • Rust AI Agent SDK

MemoryProtocol: Protocol for memory implementations.

MemoryProtocol

Defined in the protocols module.

Rust AI Agent SDK

Protocol for memory implementations.

Methods

store

rust
async fn store(&mut self, role: &str, content: &str) -> Result<()>

Store a message in memory

Parameters:

NameType
role&str
content&str

history

rust
async fn history(&self) -> Result<Vec<MemoryMessage>>

Get conversation history

clear

rust
async fn clear(&mut self) -> Result<()>

Clear memory

search

rust
async fn search(&self, query: &str, limit: usize) -> Result<Vec<MemoryMessage>>

Search memory

Parameters:

NameType
query&str
limitusize

Source

View on GitHub

praisonai/src/protocols/mod.rs at line 0


Related Documentation