Skip to main content

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.

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

SessionMessage

A single message in a session

SessionData

Complete session data structure

SessionInfo

Brief session info for listing

FileSessionStore

File-based session store (default)

InMemorySessionStore

In-memory session store (for testing)

Session

Session manager - main API for session persistence

SessionStore

Session store trait for different storage backends

Rust Sessions

Rust Memory