session_id in your Agent’s memory configuration.
Quick Start
session_id enables history=True automatically, which restores prior user and assistant turns from the session store into the new agent before it processes your next prompt. An explicit session_id is global — it resumes the same conversation from any project.
Upgrading from name-only sessions: without an explicit
session_id, history=True now derives a workspace-scoped id, so the same agent name in a different project is a separate conversation. Legacy history_<name-only>.json files are not adopted automatically in workspace scope. To keep an old file everywhere, export PRAISONAI_GLOBAL_SESSIONS=true; to pin it to one project, pass an explicit session_id. See Where sessions live.With Database Persistence
For production apps, persist to a database:Session ID Strategies
Auto-Derived Session ID Is Workspace-Scoped
Whenhistory is enabled and you don’t pass a session_id, the Agent derives one automatically — and that id is now scoped to your workspace, so same-named agents in different projects keep separate history.
history_<sha256("{workspace_id}:{name}")[:8]>. The workspace identity prefers the git repository’s root-commit sha, falls back to the resolved working directory, then "global".
An explicit session_id is unchanged — it stays fully global and resumes anywhere.
Opt Out with PRAISONAI_GLOBAL_SESSIONS
Set PRAISONAI_GLOBAL_SESSIONS to restore the pre-workspace, name-only global id — useful for a shared CLI where one agent should persist across every project.
Backwards Compatibility
Legacy name-only session files (older sha256 and md5 ids) are adopted only in global scope, so existing history keeps loading when you opt out. In workspace scope, legacy files are ignored by design to preserve cross-project isolation. Sessions live in~/.praisonai/sessions/ by default; a custom PRAISONAI_HOME is honoured because the lookup resolves through get_sessions_dir().
Inspect the Workspace Identity
Read the opaque workspace identity string directly with the public helper.CLI Resume
Best Practices
Consistent IDs
Same
session_id = same conversation threadUser Isolation
Include
user_id in session_id for multi-user appsRight Backend
JSON for dev, PostgreSQL for production
Meaningful Names
Use descriptive IDs:
user-123-support-ticketCLI equivalent
Use
praisonai run --continue or praisonai run --session <id> for the same restore behaviour from the command line
