Skip to main content
Resume a previous conversation exactly where you left off — same model, same agent, same chat history.

Quick Start

1

Find your session ID

praisonai session list
Copy the session ID from the output table.
2

Resume the session

praisonai session resume <session_id>
The CLI restores your prior model, agent name, full chat history, and cumulative usage totals, then shows:
╭─ Session Resumed ──────────────────────────────────╮
│ Session: my-assistant                               │
│ Model: anthropic/claude-3-5-sonnet-latest           │
│ Messages restored: 12                               │
│ Usage:  12,440 tokens · $0.0710 (3 requests)        │
╰─────────────────────────────────────────────────────╯

--- Restored Conversation ---
[user] What is the capital of France?
[assistant] Paris.
The Usage line appears only when token/cost data has been accumulated for the session. Cumulative totals keep accumulating from this point — they do not reset.
3

Continue with a new prompt

praisonai session resume <session_id> "What about Germany?"
Passes the resumed state directly into the same run path as praisonai run --session.
4

View transcript only (read-only)

praisonai session resume <session_id> --transcript
Prints recent events without restoring state — useful for reviewing a session without continuing it.

How It Works

The rehydrate_session() helper searches stores in order and returns a RehydratedSession dataclass:
from dataclasses import dataclass, field
from typing import Optional

@dataclass
class RehydratedSession:
    session_id: str
    chat_history: list[dict[str, str]] = field(default_factory=list)
    model: Optional[str] = None
    agent_name: Optional[str] = None
    metadata: dict = field(default_factory=dict)
    usage: dict = field(default_factory=dict)  # cumulative token/cost totals
    found: bool = False
When found is False, the CLI prints:
Error: Session not found: <session_id>
  → Use 'praisonai session list' to see available sessions

Cumulative Usage Across Resumes

Token and cost totals accumulate across all runs for a session. When you resume and run more prompts, the totals grow — they are never reset. The store that already holds usage metadata takes priority on resume — a globally-stored session resumed via the project store keeps its original totals intact.

Project vs Global Store

The resume helper always searches the project-scoped store first, then falls back to the global default store. This means sessions created inside a project are resolved with higher priority, and you can still resume cross-project sessions by ID. The project_path parameter (optional, defaults to cwd) controls which project store is searched first. Use it when running resume from a different working directory:
praisonai session resume <id>

Flags

FlagDescription
<session_id>Session ID to restore (required)
[PROMPT]Optional prompt to continue the session immediately
--transcriptShow transcript only — do not restore state

Relation to run --continue / run --session

praisonai session resume and praisonai run --session <id> call the same rehydrate_session() helper under the hood. The outcomes are identical: same chat history, same model, same agent. Use whichever form fits your workflow.
# These are equivalent:
praisonai session resume abc123 "next question"
praisonai run --session abc123 "next question"
As of the fix for PraisonAI #2655, run --continue also searches both stores when finding the last session — before, only session resume did.
For the memory-driven resume path (different code path, uses DefaultSessionStore memory layers), see Session Resume in Persistence.

Best Practices

Store the session ID in an environment variable or config file so automation scripts always resume the correct conversation:
SESSION_ID="abc-123-def"
praisonai session resume "$SESSION_ID" "run daily report"
--transcript shows events without restoring state, making it safe to inspect a live session from a second terminal without risk of creating conflicting state.
The global store covers cross-machine cases when the same project root is checked out. Sessions written to the project-scoped store travel with the project directory.
Always run praisonai session list first to confirm the session ID and its message count before resuming — especially after long gaps.

Session List

View and manage all sessions

Run Command

praisonai run —session and —continue flags

Session Persistence

How sessions are stored and retrieved

Memory-based Session Resume

The memory-driven session resume path