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.
With Database Persistence
For production apps, persist to a database:Session ID Strategies
| Pattern | Use Case | Example |
|---|---|---|
| User-based | Persistent per user | f"user-{user_id}-main" |
| Conversation-based | New chat each time | f"conv-{uuid.uuid4().hex[:8]}" |
| Task-based | Workflow tracking | f"task-{task_id}-{user_id}" |
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
