LangGraph
Give a LangGraph agent long-term memory across threads. Ships in the Python SDK.
Install
bash
pip install "suprflo[langgraph]"Targets langgraph >= 0.2.
What you get
All three are built on the Python SDK MemoryClient:
SuprfloStore— aBaseStoreimplementation, soget/put/search/deleteinside a graph read and write Suprflo memories. Read the limits below before using it.create_memory_node(client, user_id)— a graph node that recalls memories relevant to the last message intostate["memories"].create_memory_writer_node(client, user_id)— a graph node that persistsstate["messages"]to Suprflo.
Store
python
from suprflo import MemoryClient
from suprflo.integrations.langgraph import SuprfloStore
client = MemoryClient(api_key="YOUR_API_KEY")
store = SuprfloStore(client=client)
# Namespaces map onto Suprflo subjects: the last element is the user_id.
store.search(("memories", "alice"), query="hobbies")SuprfloStore is a memory store, not a faithful key-value backend. Three gaps to know about:
putcannot create by key. Suprflo assigns memory ids server side, so aputwith an unknown key raisesKeyError(it cannot create a memory at a key you choose).puton an existing key updates it in place, which does behave as expected. Take keys fromsearchresults rather than choosing them yourself.valueis flattened to text. Suprflo stores a memory string, not an arbitrary JSON blob. A value's"data"field (or the whole value stringified, if absent) is what gets persisted; other fields become metadata on create and are dropped on update.list_namespacesraisesNotImplementedError— Suprflo has no namespace tree to enumerate.
abatch calls the synchronous HTTP client, so it blocks the event loop. Fine for typical graph fan-out; not for high concurrency.
Nodes in a graph
python
from langgraph.graph import END, START, StateGraph
from suprflo.integrations.langgraph import create_memory_node, create_memory_writer_node
builder = StateGraph(State)
builder.add_node("recall", create_memory_node(client, user_id="alice", top_k=5))
builder.add_node("agent", my_agent_node) # reads state["memories"]
builder.add_node("save", create_memory_writer_node(client, user_id="alice"))
builder.add_edge(START, "recall")
builder.add_edge("recall", "agent")
builder.add_edge("agent", "save")
builder.add_edge("save", END)recall returns {"memories": [...]} (a list of memory strings) for a downstream prompt to consume; save returns {} and leaves graph state untouched. Both read plain dict messages and LangChain message objects.
If
langgraphisn't installed, importing this module raises a clearImportErrortelling you topip install "suprflo[langgraph]".