From def69c59d2e26a8a21525e87f23c303ba250f0a8 Mon Sep 17 00:00:00 2001 From: alxdr3k <138971778+alxdr3k@users.noreply.github.com> Date: Mon, 17 Mar 2025 22:38:15 +0900 Subject: [PATCH] docs: add missing namespace definition in persistence.md (#3859) - fix typo - add missing namespace definition for memory store --- docs/docs/concepts/persistence.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/docs/concepts/persistence.md b/docs/docs/concepts/persistence.md index a7684cc2a..678b66a25 100644 --- a/docs/docs/concepts/persistence.md +++ b/docs/docs/concepts/persistence.md @@ -232,7 +232,7 @@ from langgraph.store.memory import InMemoryStore in_memory_store = InMemoryStore() ``` -Memories are namespaced by a `tuple`, which in this specific example will be `(, "memories")`. The namespace can be any length and represent anything, does not have be user specific. +Memories are namespaced by a `tuple`, which in this specific example will be `(, "memories")`. The namespace can be any length and represent anything, does not have to be user specific. ```python user_id = "1" @@ -387,6 +387,9 @@ We can access the memories and use them in our model call. def call_model(state: MessagesState, config: RunnableConfig, *, store: BaseStore): # Get the user id from the config user_id = config["configurable"]["user_id"] + + # Namespace the memory + namespace = (user_id, "memories") # Search based on the most recent message memories = store.search(