Cross-platform sessions let one user keep a single conversation across every messaging platform.Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
Quick Start
Choosing Your Resolver
SessionContext for Tools
Any tool the agent calls can read who is messaging:SessionContext Fields
| Field | Type | Description |
|---|---|---|
platform | str | "telegram", "discord", "slack", … |
chat_id | str | Platform chat / channel id |
chat_name | str | Human-readable channel name |
thread_id | str | Thread / topic id (Slack threads, Telegram topics) |
user_id | str | Raw platform user id |
user_name | str | Display name |
unified_user_id | str | Result of IdentityResolver.resolve() |
Use
set_session_context / clear_session_context for advanced custom adapters. Returns a token; reset in a finally block.Mirror for Outbound Deliveries
Cron jobs, scheduled deliveries, and cross-platform replies need to mirror the assistant’s outbound message into the user’s history:Parameters
| Parameter | Type | Description |
|---|---|---|
session_mgr | BotSessionManager | Session manager instance |
user_id | str | Unified user ID |
message_text | str | Message content to mirror |
source_label | str | Source identifier ("cron", "web", "cross_platform") |
metadata | dict | Optional extra metadata |
lock | threading.RLock | Optional lock for synchronization |
Errors are swallowed and logged — a mirror failure must never break the outbound delivery itself.
Storage & Privacy
FileIdentityResolver defaults to ~/.praisonai/identity.json (override via PRAISONAI_IDENTITY_PATH env var or constructor path=). File is written atomically and chmod 0o600.Best Practices
Use FileIdentityResolver by default
Use FileIdentityResolver by default
For production single-host bots,
FileIdentityResolver provides persistent storage with atomic writes and proper file permissions.Implement custom IdentityResolverProtocol for scale
Implement custom IdentityResolverProtocol for scale
For multi-process/multi-host deployments, back it with SQLite, Redis, or a database:
Pair before linking
Pair before linking
Never auto-link based on display name. Always require a DM-verified pairing flow:
Read SessionContext in tools
Read SessionContext in tools
Instead of
os.environ, read SessionContext — concurrent message handlers won’t trample each other:Related
BotOS
Multi-platform bot orchestrator
Messaging Bots
Platform-specific bot guides

