Skip to main content
MySQL conversation store persists agent sessions and messages with automatic schema creation and connection pooling.
The user continues a thread; MySQL stores messages with connection pooling and auto schema.

Quick Start

1

Simple Usage

2

With Configuration

Use MySQLConversationStore directly when you need table prefixes or pool tuning:

How It Works

FeatureDescription
Schema managementAuto-creates sessions and messages tables (SCHEMA_VERSION = "1.0.0")
Connection poolingConfigurable pool_size for concurrent agents
URL parsingmysql://user:pass@host:port/database format supported

Configuration Options

OptionTypeDefaultDescription
urlstrNoneFull MySQL URL (overrides individual options)
hoststr"localhost"MySQL server hostname
portint3306MySQL server port
databasestr"praisonai"Database name
userstr"root"Database username
passwordstr""Database password
table_prefixstr"praison_"Prefix for table names
auto_create_tablesboolTrueCreate tables automatically
pool_sizeint5Connection pool size
For async workloads, use create_conversation_store("async_mysql", ...) with aiomysql.

Best Practices

Agent(db=db(database_url="mysql://...")) is the simplest path — no manual store wiring needed.
Isolate apps on one database with different prefixes: table_prefix="prod_" vs table_prefix="staging_".
Increase pool_size for high-traffic deployments; use smaller pools for serverless MySQL hosts.
Append ?ssl_mode=REQUIRED to the connection URL for encrypted connections.

MySQL Persistence

MySQL overview with SSL and production patterns

Persistence Backend Plugins

Extend SQL backends via the registry