Skip to main content
Learn how to persist agent state and resume interrupted sessions.
from praisonaiagents import Agent, Session

session = Session(session_id="demo", persistence="sqlite")
agent = Agent(name="Assistant", session=session)

agent.start("Continue our conversation.")
The user opens a persistence guide, wires a session store, then resumes work without losing context.

Quick Start

1

Simple Usage

Attach a session to the agent so its state survives a restart.
from praisonaiagents import Agent, Session

session = Session(session_id="demo", persistence="sqlite")
agent = Agent(name="Assistant", session=session)
agent.start("Continue our conversation.")
2

With Configuration

Reopen the same session ID later to pick up exactly where you left off.
from praisonaiagents import Agent, Session

session = Session(session_id="demo", persistence="sqlite")
agent = Agent(name="Assistant", session=session)
agent.resume()

How It Works


Guides

Overview

Persistence concepts

Database Setup

Configure database backends

Session Resume

Resume interrupted sessions

Best Practices

SQLite is perfect for a single process; move to PostgreSQL or Redis once several instances need to share the same sessions.
The same session_id reconnects to the same history. Generate it per user or per task, and store it where you can look it up later.
Set checkpoint_interval so a crash mid-task resumes from the last checkpoint instead of the beginning.