Skip to main content

session

Rust AI Agent SDK Session persistence module for PraisonAI Rust SDK. Provides automatic session persistence with zero configuration. When a session_id is provided to an Agent, conversation history is automatically persisted to disk and restored on subsequent runs.

Usage

use praisonai::{Agent, Session};

// With session persistence
let session = Session::new("my-session-123");
let agent = Agent::new()
.session(session)
.build()?;

agent.chat("Hello").await?;

// Later, new process - history is restored
let session = Session::load("my-session-123")?;
let agent = Agent::new()
.session(session)
.build()?;

agent.chat("What did I say before?").await?; // Remembers!

Import

use praisonai::session::*;

Classes