Registry /
llm-agents / langgraph-checkpoint-sqlite
Install & Compatibility
Where this runs
tested against v2.0.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 70.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 7.6s · import 0.000s · 79MB
73MB installed
● package 73MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SQLiteSaver
✓ from langgraph.checkpoint.sqlite import SQLiteSaver
✗ from langgraph.checkpoint.sqlite import SQLiteSaver
This quickstart demonstrates how to set up `SQLiteSaver` with a basic LangGraph `StateGraph`. It creates a simple graph, initializes `SQLiteSaver` to a local file, and then compiles the graph with the checkpointer. Subsequent invocations with the same `thread_id` in the configuration will automatically load and resume the graph's state from the SQLite database.
import os
from typing import Annotated, TypedDict
import operator
from langgraph.graph import StateGraph, START
from langgraph.checkpoint.sqlite import SQLiteSaver
# Define a simple state for our graph
class AgentState(TypedDict):
messages: Annotated[list, operator.add]
turn: int
# Define a node function
def my_node(state: AgentState):
print(f"Executing my_node, current turn: {state.get('turn', 0)}")
return {"messages": [f"Hello from node in turn {state.get('turn', 0)}!"], "turn": state.get('turn', 0) + 1}
# Build the graph
workflow = StateGraph(AgentState)
workflow.add_node("step_one", my_node)
workflow.set_entry_point(START)
workflow.set_finish_point("step_one")
# Initialize SQLiteSaver
# Ensure the directory exists or create it. For this example, we'll use a local file.
sqlite_file = "./langgraph_checkpoints.sqlite"
memory = SQLiteSaver.from_file(sqlite_file)
# Compile the graph with the checkpointer
app = workflow.compile(checkpointer=memory)
# Invoke the graph with a thread_id to save state
config = {"configurable": {"thread_id": "my_first_thread"}}
print("\n--- First Invocation ---")
# The initial state passed here will be merged with any loaded state for 'my_first_thread'
initial_state = {"messages": ["User: Start conversation"], "turn": 0}
app.invoke(initial_state, config=config)
print("\n--- Second Invocation (resuming thread) ---")
# Invoke again with the same thread_id; it should load the previous state.
# We don't need to pass initial_state here to resume.
app.invoke(None, config=config)
print("\n--- Third Invocation (resuming thread) ---")
app.invoke(None, config=config)
# Clean up the SQLite file for demonstration purposes (optional)
# os.remove(sqlite_file)
Debug
Known issues
gotchaSQLite's file-based nature limits its concurrency. For multi-user or high-concurrency applications (e.g., web services), direct use of `SQLiteSaver` can lead to database locking issues, performance bottlenecks, or even data corruption. Consider using a dedicated database like PostgreSQL (`langgraph-checkpoint-postgres`) or an external service for production environments.fixFor high-concurrency applications, switch to `langgraph-checkpoint-postgres`, `langgraph-checkpoint-redis`, or a custom `BaseCheckpointSaver` implementation backed by a robust database.
affects: All versions
gotchaWhen initializing `SQLiteSaver.from_file(file_path)`, ensure the directory specified in `file_path` exists and is writable by the application. If the directory does not exist, an `OSError` or `sqlite3.OperationalError` might occur.fixBefore calling `SQLiteSaver.from_file()`, ensure the parent directory of `file_path` exists, e.g., by using `os.makedirs(os.path.dirname(file_path), exist_ok=True)`.
affects: All versions
breakingThe `langgraph` library underwent significant API changes with its 1.0 release. While `langgraph-checkpoint-sqlite` versions are generally compatible with `langgraph>=0.0.1` (which includes 1.x.x), users migrating from older pre-1.0 `langgraph` applications may find that the overall `StateGraph` and checkpointing interface has changed, requiring updates to their graph definitions and invocation patterns.fixRefer to the official LangGraph 1.0 migration guides and updated documentation for the new `StateGraph` and checkpointing API. Ensure your `langgraph` version is 1.0 or higher.
affects: LangGraph versions pre-1.0 to post-1.0
Upgrade
Version history
3.1.1latest on PyPI · released Jul 30, 2026
Audit
Dependencies
langgraphrequiredCore LangGraph library, providing the `BaseCheckpointSaver` interface.
langchain-corerequiredBase components and utilities used across LangChain projects.