Blog | November 19, 2026 | MultiAgent Compare editors

How each multi-agent framework keeps state between runs

Reviewed Nov 2026

Check any in-memory default before you rely on it across restarts. LangGraph pairs checkpointers with stores. CrewAI ships JSON and SQLite checkpoint providers. ADK splits a SessionService from a MemoryService. The OpenAI Agents SDK keeps history in sessions. Microsoft Agent Framework checkpoints workflows each superstep. Agno persists session records in a configured database.

How does LangGraph keep state between runs?

LangGraph uses two systems. Checkpointers persist a thread's graph state for short-term memory, and stores persist application-defined data outside the graph state for cross-thread memory such as user preferences. You compile your graph with a checkpointer, a store, or both.

What survives a restart depends on the saver. MemorySaver and InMemorySaver store checkpoints in RAM, and all of them are lost when the process restarts. For production the docs name PostgresSaver for PostgreSQL and SqliteSaver, the latter as local file-based storage for development. With a durable saver, you can restart your graph from the last successful step after a node fails, and LangGraph stores pending writes from nodes that completed in that super-step.

Every invocation against a checkpointer must specify a thread_id in the configurable part of the config. With PostgresSaver, keep thread_id values under 255 characters to avoid a database error. Over long conversations checkpoints accumulate, which can increase latency and storage costs. On the Agent Server, you do not configure checkpointers or stores manually.

How do CrewAI checkpoints, memory and flow state differ?

CrewAI has checkpointing, flow state and memory. Checkpointing saves a snapshot of execution state so a crew, flow or agent can resume after a failure or be forked. Without a custom embedder, memory uses OpenAI text-embedding-3-large embeddings.

For checkpoints, you choose the trigger and the provider. The runtime writes a checkpoint each time a selected event fires via on_events, and the default task_completed gives one checkpoint per finished task. JsonProvider writes one file per checkpoint, while SqliteProvider writes to a single SQLite database. Setting max_checkpoints prunes the oldest checkpoints. Children inherit the checkpoint setting from their parent unless they set their own value or pass False. Automatic writes are best-effort, so a failed write is logged and the run continues.

A restore skips completed tasks and rehydrates memory and knowledge. It builds the crew, flow, or agent from the checkpoint file, not from the object you call kickoff() on. Local memory stores built with 1536-dimensional embeddings may not be compatible with the text-embedding-3-large default, and the docs suggest crewai reset-memories -m or deleting the local storage directory when a dimension mismatch appears. The LangGraph vs CrewAI page sets the two side by side.

How does Google ADK persist sessions, state and memory?

ADK persists through the services you pick. With the in-memory options, sessions, state and long-term knowledge are lost when your application restarts. Session state only persists if the SessionService is persistent, meaning Database or VertexAI. DatabaseSessionService connects to a relational database such as PostgreSQL, MySQL or SQLite. In Python it needs the db extra, installed with pip install google-adk[db], and it requires an async database driver.

State keys carry scope through prefixes. A user: key is shared across all sessions for that user and is persistent with Database or VertexAI. A temp: key is discarded after the invocation completes. In Go, call database.AutoMigrate each time your application starts, because the Go service does not create or update its tables.

Long-term memory is a separate service. Python ADK ships three MemoryService implementations: InMemoryMemoryService loses data on restart, while VertexAiMemoryBankService is managed by the Agent Platform. Your application calls add_session_to_memory to ingest a session. See LangGraph vs Google ADK for the wider comparison.

How does the OpenAI Agents SDK persist sessions?

You pass a session object and the SDK handles history. Sessions maintain conversation history across multiple agent runs. SQLiteSession is file-backed or in-memory, RedisSession targets shared memory across workers and services, SQLAlchemySession works with SQLAlchemy-supported databases, and OpenAIConversationsSession offers server-managed storage in OpenAI.

A run paused for approval resumes with the same session ID and the same underlying storage backend. In one run, a session cannot be combined with conversation_id or previous_response_id. The OpenAI Agents SDK vs LangGraph page covers the rest.

How does Microsoft Agent Framework persist sessions and checkpoints?

Conversation state lives in sessions and workflow state in checkpoints. For Harness Agent, the docs say to serialize the session when that state must survive a process restart. HarnessAgent defaults to InMemoryChatHistoryProvider, which you replace when history must use another store. In a self-hosted app, an AgentSessionStore can load and save sessions by a continuation ID. Sessions are agent/service-specific, so reusing one with a different configuration can lead to invalid context.

Checkpoints are created at the end of each superstep. In Python, a CheckpointStorage is provided when creating a workflow. InMemoryCheckpointStorage keeps checkpoints in process memory, FileCheckpointStorage persists checkpoints to a local directory and survives process restarts, and CosmosCheckpointStorage uses Azure Cosmos DB for distributed, cross-process workflows. File storage has no default directory, so storage_path is required. All three share one protocol, so you can swap providers without changing workflow code. When several workflows of one orchestration type share storage, set an explicit name.

How do Agno and Mastra store sessions and memory?

Agno ties persistence to the db on the agent. A stable session_id groups related runs, and in the example the database stores both runs under support-thread-7. History in the prompt is opt-in, since add_history_to_context defaults to False. Memory holds extracted facts about a user across sessions, uses the database configured on the agent, and has agno_memories as the default table name. Choose one memory mode per agent, because agentic memory takes precedence when both are enabled.

Mastra routes this through one storage layer. Storage keeps memory, workflow state and long-running agent state available after a restart, while the default in-memory store loses data when the process exits. Memory calls pass a resource and thread. Mastra says to keep local file databases out of multi-process production. Observational Memory turns off without a warning on an adapter that does not support it. The Mastra vs LangGraph page goes further.

What should you check before relying on persistence?

  • Confirm which backend your running configuration uses, and restart the process once in staging to see what comes back.
  • Generate thread, session and user identifiers in your application and store them with your own records, so a restarted process can find the same state.
  • Plan cleanup early. LangGraph suggests you prune old checkpoints periodically or set a retention policy, and Mastra advises you to configure retention policies, then call storage.prune() from a scheduler.
  • If the whole project runs on one framework, use that framework's own persistence and skip any extra layer.

Is a checkpoint the same as long-term memory?

In LangGraph, a checkpointer tracks the current thread and a store tracks durable information across threads. CrewAI checkpoints exist so a run can resume after a failure or be forked.

Can several agents share one memory?

In Mastra, a subagent without its own memory inherits the supervisor's Memory instance, and its resource-scoped memory persists between calls.

Can one ADK agent use two memory services?

Standard configuration allows one memory service at a time. In your own code, you can instantiate a second BaseMemoryService and call it from a custom tool.

Are saved checkpoints safe to load from any source?

Treat checkpoint files as trusted data only. In CrewAI, restoring saved callback paths depends on an environment variable, and the docs say to set it only for checkpoint files you trust. Microsoft's CosmosCheckpointStorage refuses the save when encoding fails or a required application type isn't allowed.