MySQL Storage
For common Agent integration, extraction modes, and tool configuration, see Usage and Configuration.
Use case: Production, ACID guarantees, complex queries
Configuration options:
WithMySQLClientDSN(dsn): MySQL DSN connection string (recommended; requiresparseTime=true)WithMySQLInstance(name): Use pre-registered MySQL instanceWithSoftDelete(enabled): Enable soft delete (default false)WithTableName(name): Custom table name (default "memories")WithMemoryLimit(limit): Memory limit per userWithCustomTool(toolName, creator): Register custom toolWithToolEnabled(toolName, enabled): Enable/disable toolWithExtraOptions(...options): Extra options passed to MySQL clientWithSkipDBInit(skip): Skip table initialization (for users without DDL permissions)
WithMySQLClientDSN takes priority over WithMySQLInstance when both are set.
DSN example:
Default table schema (auto-created):
WithTableName replaces memories in this DDL.
Resource cleanup: Call Close() method to release database connection: