Save sessions

Choose in-memory or durable storage for Agentdock sessions.

Agentdock uses an in-memory checkpoint by default. It is useful for development and tests, but it does not survive a process restart.

For saved sessions, install one checkpoint adapter:

StoragePackageUse it for
SQLite@agentdock-ai/checkpoint-sqliteA local database file or a single server
PostgreSQL@agentdock-ai/checkpoint-postgresA shared production database
MongoDB@agentdock-ai/checkpoint-mongodbA MongoDB deployment
Redis Stack@agentdock-ai/checkpoint-redisRedis with the JSON and Search modules

Example: SQLite

yarn add @agentdock-ai/checkpoint-sqlite
import { SqliteCheckpoint } from "@agentdock-ai/checkpoint-sqlite";
import { AgentDock } from "@agentdock-ai/agentdock";

const agent = new AgentDock({
  model,
  checkpoint: new SqliteCheckpoint({ path: "./data/agentdock.sqlite" }),
});

Close the agent

When your app shuts down, call await agent.close(). Agentdock closes adapters passed as checkpoint. The host app still owns the database server and the rules for who can access each session.

Redis checkpoints require Redis Stack. A plain Redis server does not include the modules they need.

On this page