{"id":3534,"library":"langgraph-checkpoint-sqlite","title":"LangGraph SQLite Checkpoint","description":"This library provides a SQLite implementation of LangGraph's checkpoint saver, enabling persistent storage of graph states. It is currently at version 3.0.3 and is actively maintained as part of the broader LangGraph project, with releases generally aligning with LangGraph's update cadence.","status":"active","version":"3.0.3","language":"en","source_language":"en","source_url":"https://github.com/langchain-ai/langgraph/tree/main/libs/checkpoint-sqlite","tags":["langchain","langgraph","sqlite","checkpoint","state management","persistence"],"install":[{"cmd":"pip install langgraph-checkpoint-sqlite","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core LangGraph library, providing the `BaseCheckpointSaver` interface.","package":"langgraph","optional":false},{"reason":"Base components and utilities used across LangChain projects.","package":"langchain-core","optional":false}],"imports":[{"symbol":"SQLiteSaver","correct":"from langgraph.checkpoint.sqlite import SQLiteSaver"}],"quickstart":{"code":"import os\nfrom typing import Annotated, TypedDict\nimport operator\n\nfrom langgraph.graph import StateGraph, START\nfrom langgraph.checkpoint.sqlite import SQLiteSaver\n\n# Define a simple state for our graph\nclass AgentState(TypedDict):\n    messages: Annotated[list, operator.add]\n    turn: int\n\n# Define a node function\ndef my_node(state: AgentState):\n    print(f\"Executing my_node, current turn: {state.get('turn', 0)}\")\n    return {\"messages\": [f\"Hello from node in turn {state.get('turn', 0)}!\"], \"turn\": state.get('turn', 0) + 1}\n\n# Build the graph\nworkflow = StateGraph(AgentState)\nworkflow.add_node(\"step_one\", my_node)\nworkflow.set_entry_point(START)\nworkflow.set_finish_point(\"step_one\")\n\n# Initialize SQLiteSaver\n# Ensure the directory exists or create it. For this example, we'll use a local file.\nsqlite_file = \"./langgraph_checkpoints.sqlite\"\nmemory = SQLiteSaver.from_file(sqlite_file)\n\n# Compile the graph with the checkpointer\napp = workflow.compile(checkpointer=memory)\n\n# Invoke the graph with a thread_id to save state\nconfig = {\"configurable\": {\"thread_id\": \"my_first_thread\"}}\n\nprint(\"\\n--- First Invocation ---\")\n# The initial state passed here will be merged with any loaded state for 'my_first_thread'\ninitial_state = {\"messages\": [\"User: Start conversation\"], \"turn\": 0}\napp.invoke(initial_state, config=config)\n\nprint(\"\\n--- Second Invocation (resuming thread) ---\")\n# Invoke again with the same thread_id; it should load the previous state.\n# We don't need to pass initial_state here to resume.\napp.invoke(None, config=config)\n\nprint(\"\\n--- Third Invocation (resuming thread) ---\")\napp.invoke(None, config=config)\n\n# Clean up the SQLite file for demonstration purposes (optional)\n# os.remove(sqlite_file)","lang":"python","description":"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."},"warnings":[{"fix":"For high-concurrency applications, switch to `langgraph-checkpoint-postgres`, `langgraph-checkpoint-redis`, or a custom `BaseCheckpointSaver` implementation backed by a robust database.","message":"SQLite'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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Before 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)`.","message":"When 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer 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.","message":"The `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.","severity":"breaking","affected_versions":"LangGraph versions pre-1.0 to post-1.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}