Data and state
In this sectionWhere 10xGraph keeps agent state: checkpoints for threads, long-term memory and shared server state, and how Postgres and Redis back each in production.
- 12 pages
- About 77 min to read all
This section covers where 10xGraph keeps agent state: checkpoints for threads, long-term memory, shared server state and the databases behind them. Use Postgres and Redis by default, SQLite for local work, and any database through BaseCheckpointer, BaseStore and BaseCacheStore.
Reference: BaseCheckpointer · Source: base_checkpointer.py
Reference: BaseStore · Source: base_store.py
Reference: BaseCacheStore · Source: base.py
- Checkpointing and threads: How threads, checkpoints and state history work.
- Checkpointer internals: How PgCheckpointer keeps hot state in Redis and durable state in Postgres.
- Long-term memory: How the memory store, search and agent-level memory fit together.
- Set up checkpointing: Choose and configure a checkpointer for state persistence, from development to production.
- Durability and concurrency: Thread isolation, state history, optimistic concurrency, and idempotent tool calls.
- Memory store: Use PgVectorStore and QdrantStore for long-term memory and enable agent-level memory with MemoryConfig.
- PgVectorStore: Keep long-term memory and RAG in the same Postgres as your checkpointer.
- Memory tools: Give an agent tools to save, search and forget memories.
- Cache store: What the API server keeps in its cache store, which backend to use, and how each feature behaves when the store fails.
- Postgres and Redis: Set up PgCheckpointer for durable, resumable agent threads, with schema, pooling and operations.
- Bring your own database: The storage classes behind a 10xGraph server and how to plug in a custom one.
- Backup and restore: What 10xGraph persists and how to back up, restore or roll back a running deployment safely.
All pages in Data and state
Threads and state
- Checkpointing and ThreadsHow a checkpointer saves graph state and reloads it for the same thread_id, how the config dict identifies a thread, and how to pass one to graph.compile().5 min
- Hot and cold state: how PgCheckpointer stores threadsThe internal mechanisms of PgCheckpointer's two-layer storage model, the write path, read path, and optimistic concurrency control for thread state.6 min
- Set up checkpointingChoose and configure a checkpointer for state persistence: InMemoryCheckpointer for development, SqliteCheckpointer for clients, PgCheckpointer for production.7 min
- Durability and concurrencyHandle StaleStateError when several processes advance one thread, retry safely, and tune the per-step durable checkpoint PgCheckpointer saves after each node.3 min
Long-term memory
- Long-term MemoryGive agents long-term memory across threads: how the memory store differs from the checkpointer, and the no_retrieval, preload and postload modes.12 min
- How to use the memory storeSet up PgVectorStore or QdrantStore for long-term memory, use the factory helpers, and turn on agent-level memory by passing a MemoryConfig to your agents.7 min
- How to use PgVectorStoreKeep long-term memory and RAG in the same Postgres as your checkpointer with PgVectorStore: install, search strategies, settings, embeddings, table layout.6 min
- Memory Toolsuser_memory_tool and agent_memory_tool give an Agent long-term memory to search and remember facts across conversations, enabled with MemoryConfig.6 min
Shared server state
Your databases
- Postgres and Redis checkpointingSet up PgCheckpointer for durable, resumable agent threads: Postgres as the source of truth, Redis as a cache, plus schema, pooling and operations.9 min
- Bring your own backendThe three storage classes behind a 10xGraph server, what each holds, how to plug in a custom one, the aping rules and the BaseCacheStore contract.7 min
- Backup and restoreWhat 10xGraph persists, how to back up the Postgres tables that hold threads and state, and how to restore or roll back a running deployment safely.7 min