firestore_session_store library

A Firestore-backed SessionStore for Genkit agents.

Ported from the Genkit JS FirestoreSessionStore, this store persists session snapshots as incremental JSON Patch diffs anchored to periodic, sharded full-state checkpoints, so it scales to arbitrarily long sessions without any single document approaching Firestore's 1 MiB limit.

Classes

FirestoreSessionStore
A Firestore-backed SessionStore that persists session snapshots as incremental JSON Patch diffs anchored to periodic, sharded full-state checkpoints.

Constants

defaultCheckpointInterval → const int
Default number of turns between full-state checkpoints.
defaultShardSize → const int
Default maximum size (in bytes) of a single shard / diff document. Kept well under Firestore's 1 MiB per-document limit so that no individual write can be rejected for being too large.