genkit FirestoreSessionStore: Agents That Remember Users
genkit FirestoreSessionStore gives your defineAgent agent durable memory: every turn is saved as a snapshot in Cloud Firestore, so conversations survive turns, app restarts, and scale-out deploys.
Last updated: October 21, 2026 Imagine your Flutter chat agent greeting a returning user by name, picking up exactly where the conversation left off — yesterday, last week, even after your Cloud Run instance restarted twice. That's what genkit FirestoreSessionStore buys you: durable, server-managed agent memory backed by Cloud Firestore, wired in with one defineAgent option. No hand-threaded message history, no Redis cluster to babysit. In this tutorial you'll define an agent with Firestore-backed sessions, resume conversations with a sessionId after a full app restart, and serve it over HTTP so your Flutter client can call it with remoteAgent. Multi-turn agents are easy to demo and hard to ship. The demo works because the process never dies. Production kills processes constantly — deploys, scaling events, crashes — and every restart wipes whatever lived in memory. A session store is Genkit's answer: the agent runtime saves a snapshot of the conversation after every turn, and hands it back when the same session resumes. FirestoreSessionStore is the production-grade choice for that snapshot — Cloud Firestore instead of a local file, so memory survives restarts and is visible to every instance of your backend. What you'll learn with genkit FirestoreSessionStore What a Genkit session store actually does: snapshots, sessionId/snapshotId resume, and failed-turn recovery How to define a defineAgent agent with FirestoreSessionStore (experimental import included) How to chat across turns with a stable sessionId — multi-turn without hand-threading history How to kill your server process and resume the exact same conversation afterward How to serve the agent over HTTP with GenkitRouter and call it from Flutter via remoteAgent When to pick InMemorySessionStore,…