mysql backend stores sessions in a MySQL database. Multiple agent instances can connect to the same database for shared, distributed persistence.
When to use
- Production, multi-instance, or distributed deployments;
- When sessions are centrally managed by a shared MySQL.
Usage
Provide connection details viaconfig.yaml (or the matching environment variables) — never hard-code the password.
db_kwargs:
MysqlConfig directly through backend_configs to override the environment variables (hard-coding the password is discouraged):
Parameters
ShortTermMemory constructor parameters (mysql)
MysqlConfig fields and environment variables
TheMysqlConfig config class uses the env prefix DATABASE_MYSQL_.
config.yaml
VeADK selects a MySQL driver compatible with the installed Google ADK version and automatically encodes special characters in usernames and passwords. You can provision MySQL on Volcengine.