Adapters¶
ADK stores use the same adapters as the rest of SQLSpec. Configure your database with a standard config class, then pass it to the ADK store.
Choosing an Adapter¶
Use async adapters for best performance with ADK runners:
PostgreSQL (recommended):
asyncpg,psycopg(async mode),psqlpyCockroachDB:
cockroach_asyncpg,cockroach_psycopg(full FTS support)MySQL/MariaDB:
aiomysql,asyncmySQLite:
aiosqlite(development and single-process)Oracle:
oracledbDuckDB:
duckdb(analytics; reduced-scope for ADK)ADBC:
adbc(Arrow-native portability; reduced-scope for ADK)Spanner:
spanner(Google Cloud, globally distributed)SQL Server over ODBC:
arrow_odbcwith Microsoft ODBC Driver 18
Sync adapters (psycopg sync mode, sqlite, mysqlconnector,
pymysql, arrow_odbc) work but require wrapping with anyio for async
ADK runners.
Each Adapter Provides¶
Every adapter with ADK support ships session/event and memory stores:
Session store (e.g.,
AsyncpgADKStore) -- sessions and events.Memory store (e.g.,
AsyncpgADKMemoryStore) -- long-term memory with FTS.
Import from the adapter's adk subpackage:
Artifact service base classes live under sqlspec.extensions.adk.artifact.
They require a concrete metadata-store implementation and are not exported from
adapter adk packages.
Example¶
adk backend config¶from sqlspec.adapters.adbc import AdbcConfig
adk_config = {
"session_table": "adk_session",
"events_table": "adk_event",
"memory_table": "adk_memory",
"memory_use_fts": True,
}
gizmo = AdbcConfig(
connection_config={"driver_name": "gizmosql", "gizmosql_backend": "duckdb"},
extension_config={"adk": adk_config},
)
See Also¶
Backends for the full support matrix and backend-specific notes.
Drivers and Querying for adapter configuration patterns.
Adapters for the complete adapter API.