Skip to content

langgraph dev Ignores Checkpointer Configuration, Forcing In-Memory Storage and Preventing State Persistence** #5790

Description

@Lambdua

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

### **Steps to Reproduce**

1.  **Create a `checkpoint_config.py` file to configure an SQLite checkpointer:**

    
    # checkpoint_config.py
    import aiosqlite
    from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver

    async def get_sqlite_saver():
        # Ensure the database connection is awaitable
        conn = await aiosqlite.connect("checkpoint.db")
        return AsyncSqliteSaver(conn=conn)
    

2.  **Create a `my_graph.py` file defining a simple graph and configuring it with the SQLite checkpointer:**

    
    # my_graph.py
    from typing import TypedDict
    from langgraph.graph import StateGraph
    from checkpoint_config import get_sqlite_saver

    class State(TypedDict):
        value: int

    def step(state: State):
        print(f"Current value: {state['value']}")
        return {"value": state["value"] + 1}

    async def get_graph():
        builder = StateGraph(State)
        builder.add_node("step", step)
        builder.set_entry_point("step")
        builder.add_edge("step", "step")
        
        # Configure the persistent SQLite checkpointer
        checkpointer = await get_sqlite_saver()
        
        print(f"Graph compiled with checkpointer: {checkpointer}")
        graph = builder.compile(checkpointer=checkpointer)
        return graph
    

3.  **Create a `langgraph.json` file pointing to the graph:**

    
    {
      "graphs": {
        "my_agent": "./my_graph.py:get_graph"
      }
    }
    

4.  **Start the service using `langgraph dev`:**

    
    langgraph dev --port 8088
    

5.  **Interact with the service to create some state changes.** For instance, call `ainvoke` several times via the LangGraph Studio or `curl`.

6.  **Restart the `langgraph dev` service.**

Error Message and Stack Trace (if applicable)

### **Expected Behavior**

After restarting the service, the previous conversation state should be fully preserved and loaded, as the checkpointer is configured to use `checkpoint.db`. The `checkpoint.db` file should contain data records.

### **Actual Behavior**

After restarting, all conversation state is lost. Although the `checkpoint.db` file is created, it remains empty. The startup logs from `langgraph dev` clearly indicate that it is using an in-memory runtime:
`[info] Using langgraph_runtime_inmem`
`[info] Starting In-Memory runtime ...`

Description

Problem Description

When using the langgraph dev command for development, we've observed that it ignores any persistent checkpointer (e.g., AsyncSqliteSaver) configured in the code for a graph. Instead, it forcibly uses a temporary in-memory runtime (langgraph_runtime_inmem). This results in the loss of all conversation state upon server restart, which significantly complicates the development and debugging of state-dependent agents.

We expect langgraph dev to either respect the checkpointer configured in the code, similar to when running a script directly, or at least provide a command-line option to enable persistence.

Expected Behavior

After restarting the service, the previous conversation state should be fully preserved and loaded, as the checkpointer is configured to use checkpoint.db. The checkpoint.db file should contain data records.

Actual Behavior

After restarting, all conversation state is lost. Although the checkpoint.db file is created, it remains empty. The startup logs from langgraph dev clearly indicate that it is using an in-memory runtime:
[info] Using langgraph_runtime_inmem
[info] Starting In-Memory runtime ...

This demonstrates that the builder.compile(checkpointer=checkpointer) configuration in the code is completely ignored by langgraph dev.

Additional Context

We have carefully checked our local environment configuration and reviewed the official LangGraph documentation but have been unable to find any instructions on how to enable persistent storage for langgraph dev. We also noticed that even when no checkpointer is provided in the code, langgraph dev does not use the .langgraph_api directory for state persistence as one might expect; the files in that directory are not updated as the conversation progresses. This further reinforces our conclusion that langgraph dev may currently be hardcoded to run in-memory, bypassing all persistence mechanisms.

While we understand that langgraph dev is intended as a development tool, this behavior makes it very difficult to develop complex conversational agents that rely on persistent state. Every code change that triggers a hot reload forces us to recreate the conversation state from scratch, which severely impacts development efficiency.

If this is indeed the intended behavior of langgraph dev, we would appreciate it if this were clarified in the official documentation. If it is a configurable issue, we would be grateful for guidance on how to resolve it. Thank you!

System Info

Environment Information

  • LangGraph Version: 0.6.1
  • Python Version: 3.12
  • Operating System: Windows

langgraph dev --port 8088 --no-browser

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingawaiting review/confirmation by maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions