Memory
tursoChatMemory
libSQL / Turso-backed chat memory. Replicated SQLite with the same surface as sqliteChatMemory.
import { tursoChatMemory } from '@agentskit/memory'
const memory = tursoChatMemory({
url: 'libsql://my-db-myorg.turso.io',
authToken: process.env.TURSO_AUTH_TOKEN!,
conversationId: 'user-123',
})@libsql/client is an optional peer dependency loaded lazily.
npm install @libsql/client#Config
| Option | Type | Default |
|---|---|---|
url | string | required (file:, libsql://, or http://) |
authToken | string | required for libsql:// URLs |
conversationId | string | 'default' |
#Why turso vs sqlite
- Replication. Turso replicates SQLite to read-only edge replicas globally. Single-region writes, multi-region reads.
- Embedded mode.
file:./local.dbworks identically β develop offline, deploy hosted. - Same surface. Mirrors
sqliteChatMemoryexactly, so swapping is a one-line import change.
#Surface
load() / save(messages) / clear() β same as every other chat memory.