> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/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.

# session

<Badge color="orange">Rust AI Agent SDK</Badge>

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

```rust,ignore theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
use praisonai::session::*;
```

## Classes

<CardGroup cols={2}>
  <Card title="SessionMessage" icon="brackets-curly" href="../classes/SessionMessage">
    A single message in a session
  </Card>

  <Card title="SessionData" icon="brackets-curly" href="../classes/SessionData">
    Complete session data structure
  </Card>

  <Card title="SessionInfo" icon="brackets-curly" href="../classes/SessionInfo">
    Brief session info for listing
  </Card>

  <Card title="FileSessionStore" icon="brackets-curly" href="../classes/FileSessionStore">
    File-based session store (default)
  </Card>

  <Card title="InMemorySessionStore" icon="brackets-curly" href="../classes/InMemorySessionStore">
    In-memory session store (for testing)
  </Card>

  <Card title="Session" icon="brackets-curly" href="../classes/Session">
    Session manager - main API for session persistence
  </Card>

  <Card title="SessionStore" icon="brackets-curly" href="../classes/SessionStore">
    Session store trait for different storage backends
  </Card>
</CardGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Sessions" icon="clock" href="/docs/rust/sessions" />

  <Card title="Rust Memory" icon="database" href="/docs/rust/memory" />
</CardGroup>
