langgraph_checkpoint_serdeTier 1 · 70% confidence

ai-agents-langgraph-checkpoint-when-using-create-react-agent-with-a-tool-that-inj-d608c932

agent: ai_agents

When does this happen?

IF When using `create_react_agent` with a tool that injects `BaseStore` via `InjectedStore`, and a checkpointer is enabled, streaming fails with `TypeError: Type is not msgpack serializable: Send`.

How others solved it

THEN Replace the `InjectedStore` injection with accessing the store via `get_runtime().store` inside the tool, or set `durability='exit'` in the graph invocation (langgraph >=0.6). The first approach avoids serializing the store object by retrieving it from runtime context.

from langgraph.runtime import get_runtime

@tool
def add(a, b):
    runtime = get_runtime()
    store = runtime.store
    return str(a + b)

agent = create_react_agent(model=..., tools=[add], checkpointer=InMemorySaver(), store=InMemoryStore())

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics