Registry / llm-agents / langgraph-runtime-inmem

langgraph-runtime-inmem

JSON →
library0.33.2pypypi✓ verified 24d ago

The `langgraph-runtime-inmem` library provides an in-memory implementation for the LangGraph API server's state management, enabling local development and testing of LangGraph agents without requiring an external database. It's designed for ephemeral, single-process usage. Currently at version 0.27.3, it follows the rapid release cadence of the broader LangGraph ecosystem, with frequent updates.

pip install langgraph-runtime-inmem
INSTALL
IMPORT
SIG · LANGGRAPH-RUNTIME-
L
langgraph-runtime-inmem
llm-agentspythonv0.33.2
Install
9.0s avg
Import
Disk
83MB
Pass rate
6/ 10
Env Coverage6 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.33.2 · 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
musl
glibc
py 3.10
✕ build_error
✕ build_error
py 3.11
✓ —
✓ 9.5s
py 3.12
✓ —
✓ 8.7s
py 3.13
✓ —
✓ 8.9s
py 3.9
✕ build_error
✕ build_error
83MB installed
● package 83MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

InMemoryGraphRuntime
from langgraph_runtime_inmem import InMemoryGraphRuntime
from langgraph_runtime_inmem import InMemoryGraphRuntime

This quickstart demonstrates how to define a LangGraph, instantiate the `InMemoryGraphRuntime`, and register the graph. It also provides instructions on how to launch the FastAPI server using `uvicorn` to make the graph accessible via HTTP.

from langgraph.graph import StateGraph from langgraph_runtime_inmem import InMemoryGraphRuntime from langgraph_runtime_inmem.server import app # 1. Define a simple LangGraph def create_simple_graph(): builder = StateGraph(dict) builder.add_node("start", lambda x: {"step": "start"}) builder.add_node("end", lambda x: {"step": "end"}) builder.add_edge("start", "end") builder.set_entry_point("start") return builder.compile() # 2. Instantiate the in-memory runtime runtime = InMemoryGraphRuntime() # 3. Register your graph with a unique ID my_graph = create_simple_graph() runtime.add_graph("my_first_graph", my_graph) print("Graph 'my_first_graph' registered with the InMemoryGraphRuntime.") print("To run the API server, execute:") print("uvicorn langgraph_runtime_inmem.server:app --host 0.0.0.0 --port 8000") print("You can then interact with the graph via HTTP, e.g., POST /graph/my_first_graph/invoke") # Example of direct interaction (not via HTTP, for demonstration): # state = runtime.invoke("my_first_graph", {}, config={}) # print(f"Direct invocation result: {state}")
Debug
Known issues
gotchaThe `InMemoryGraphRuntime` is ephemeral. All state (including graph run history and current step) is stored only in RAM and will be lost if the server process restarts. It does not support shared state across multiple server instances.
fix
For persistent or distributed state management, use other LangGraph runtime implementations (e.g., backed by a database) or implement your own custom state store.
affects: All
breakingThis library requires Python 3.11 or newer. Attempting to install or run with older Python versions will result in dependency resolution errors or runtime failures.
fix
Ensure your environment uses Python 3.11 or a later version.
affects: All
gotchaVersion alignment between `langgraph-runtime-inmem` and `langgraph` is crucial. Significant API changes in `langgraph` often require corresponding updates in `langgraph-runtime-inmem` to maintain compatibility.
fix
Refer to the release notes for both libraries and keep them updated to compatible versions. Generally, use the latest versions of both.
affects: All
Upgrade
Version history
0.33.2latest on PyPI · released Aug 28, 2026
Audit
Dependencies
langgraphrequiredCore dependency for defining and compiling graphs.
fastapirequiredUsed to build the API server that exposes the runtime.
uvicornrequiredASGI server for running the FastAPI application.
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
langgraph-runtime-inmem — pip install langgraph-runtime-inmem · libregistry