agentskit.js
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

OptionTypeDefault
urlstringrequired (file:, libsql://, or http://)
authTokenstringrequired for libsql:// URLs
conversationIdstring'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.db works identically β€” develop offline, deploy hosted.
  • Same surface. Mirrors sqliteChatMemory exactly, so swapping is a one-line import change.

#Surface

load() / save(messages) / clear() β€” same as every other chat memory.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page