Skip to content

Commit dd7d686

Browse files
bsboddenclaude
andcommitted
docs(examples): fix documentation and align dependency versions
- Update redisvl version from >=0.5.1 to >=0.11.0 in Dockerfile and README - Fix .gitignore comment: /docs -> /examples - Fix README reference to parent directory mount path - Fix create-react-agent-hitl.ipynb to use uuid for unique thread IDs - Update notebook markdown to reference RedisStore instead of InMemoryStore - Update notebook markdown to reference RedisSaver instead of MemorySaver These changes ensure: 1. Security fix (CVE-2025-64439) via redisvl >=0.11.0 2. Accurate documentation matching actual implementations 3. Notebooks work correctly with checkpoint state isolation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ba762f8 commit dd7d686

File tree

7 files changed

+40
-152
lines changed

7 files changed

+40
-152
lines changed

examples/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# .gitignore for /docs directory
1+
# .gitignore for /examples directory
22
.ipynb_checkpoints
33
*.pyc
44
__pycache__

examples/Dockerfile.jupyter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ENV PATH="/home/jupyter/venv/bin:$PATH"
2222
RUN pip install --no-cache-dir --upgrade pip && \
2323
pip install --no-cache-dir "httpx>=0.24.0,<1.0.0" && \
2424
pip install --no-cache-dir "langgraph>=0.3.0" && \
25-
pip install --no-cache-dir jupyter "redis>=5.2.1" "redisvl>=0.5.1" langchain-openai langchain-anthropic python-ulid
25+
pip install --no-cache-dir jupyter "redis>=5.2.1" "redisvl>=0.11.0" langchain-openai langchain-anthropic python-ulid
2626

2727
# Create a startup script that checks if local library is mounted
2828
RUN echo '#!/bin/bash\n\

examples/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To run these notebooks using Docker (recommended for consistent environment):
2121
Note:
2222

2323
- The first time you run this, it may take a few minutes to build the Docker image.
24-
- When running with Docker Compose, the local library code from `../langgraph` is automatically mounted and installed,
24+
- When running with Docker Compose, the local library code from `../` (parent directory) is automatically mounted and installed,
2525
allowing you to test changes to the library immediately without rebuilding.
2626
- If running the Docker image standalone (without docker-compose), it will install the library from PyPI instead.
2727

@@ -40,12 +40,12 @@ If you prefer to run these notebooks locally without Docker:
4040

4141
```bash
4242
pip install langgraph-checkpoint-redis
43-
pip install langgraph>=0.3.0
44-
pip install jupyter redis>=5.2.1 redisvl>=0.5.1
45-
pip install langchain-openai langchain-anthropic
43+
pip install langgraph>=0.3.0
44+
pip install jupyter redis>=5.2.1 redisvl>=0.11.0
45+
pip install langchain-openai langchain-anthropic
4646
pip install python-ulid "httpx>=0.24.0,<1.0.0"
47-
48-
# Some notebooks may require additional packages, which will be installed
47+
48+
# Some notebooks may require additional packages, which will be installed
4949
# within the notebooks themselves when needed
5050
```
5151

examples/create-react-agent-hitl.ipynb

Lines changed: 26 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,19 @@
120120
"name": "stdout",
121121
"output_type": "stream",
122122
"text": [
123-
"0.1.0\n",
124-
"18:45:35 langgraph.checkpoint.redis INFO Redis client is a standalone client\n"
123+
"0.2.0\n",
124+
"02:38:15 langgraph.checkpoint.redis INFO Redis client is a standalone client\n",
125+
"02:38:15 redisvl.index.index INFO Index already exists, not overwriting.\n",
126+
"02:38:15 redisvl.index.index INFO Index already exists, not overwriting.\n",
127+
"02:38:15 redisvl.index.index INFO Index already exists, not overwriting.\n"
128+
]
129+
},
130+
{
131+
"name": "stderr",
132+
"output_type": "stream",
133+
"text": [
134+
"/tmp/ipykernel_519/104821471.py:41: LangGraphDeprecatedSinceV10: create_react_agent has been moved to `langchain.agents`. Please update your import to `from langchain.agents import create_agent`. Deprecated in LangGraph V1.0 to be removed in V2.0.\n",
135+
" graph = create_react_agent(\n"
125136
]
126137
}
127138
],
@@ -198,35 +209,11 @@
198209
},
199210
{
200211
"cell_type": "code",
201-
"execution_count": 5,
212+
"execution_count": null,
202213
"id": "9ffff6c3-a4f5-47c9-b51d-97caaee85cd6",
203214
"metadata": {},
204-
"outputs": [
205-
{
206-
"name": "stdout",
207-
"output_type": "stream",
208-
"text": [
209-
"================================\u001b[1m Human Message \u001b[0m=================================\n",
210-
"\n",
211-
"what is the weather in SF, CA?\n",
212-
"18:45:36 httpx INFO HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
213-
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
214-
"Tool Calls:\n",
215-
" get_weather (call_lwlXXEJvgUaXb9Q8EIjSMLgJ)\n",
216-
" Call ID: call_lwlXXEJvgUaXb9Q8EIjSMLgJ\n",
217-
" Args:\n",
218-
" location: SF, CA\n"
219-
]
220-
}
221-
],
222-
"source": [
223-
"\n",
224-
"\n",
225-
"config = {\"configurable\": {\"thread_id\": \"42\"}}\n",
226-
"inputs = {\"messages\": [(\"user\", \"what is the weather in SF, CA?\")]}\n",
227-
"\n",
228-
"print_stream(graph.stream(inputs, config, stream_mode=\"values\"))"
229-
]
215+
"outputs": [],
216+
"source": "import uuid\n\nconfig = {\"configurable\": {\"thread_id\": str(uuid.uuid4())}}\ninputs = {\"messages\": [(\"user\", \"what is the weather in SF, CA?\")]}\n\nprint_stream(graph.stream(inputs, config, stream_mode=\"values\"))"
230217
},
231218
{
232219
"cell_type": "markdown",
@@ -238,18 +225,10 @@
238225
},
239226
{
240227
"cell_type": "code",
241-
"execution_count": 6,
228+
"execution_count": null,
242229
"id": "3decf001-7228-4ed5-8779-2b9ed98a74ea",
243230
"metadata": {},
244-
"outputs": [
245-
{
246-
"name": "stdout",
247-
"output_type": "stream",
248-
"text": [
249-
"Next step: ('tools',)\n"
250-
]
251-
}
252-
],
231+
"outputs": [],
253232
"source": [
254233
"snapshot = graph.get_state(config)\n",
255234
"print(\"Next step: \", snapshot.next)"
@@ -267,35 +246,10 @@
267246
},
268247
{
269248
"cell_type": "code",
270-
"execution_count": 7,
249+
"execution_count": null,
271250
"id": "740bbaeb",
272251
"metadata": {},
273-
"outputs": [
274-
{
275-
"name": "stdout",
276-
"output_type": "stream",
277-
"text": [
278-
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
279-
"Tool Calls:\n",
280-
" get_weather (call_lwlXXEJvgUaXb9Q8EIjSMLgJ)\n",
281-
" Call ID: call_lwlXXEJvgUaXb9Q8EIjSMLgJ\n",
282-
" Args:\n",
283-
" location: SF, CA\n",
284-
"=================================\u001b[1m Tool Message \u001b[0m=================================\n",
285-
"Name: get_weather\n",
286-
"\n",
287-
"Error: AssertionError('Unknown Location')\n",
288-
" Please fix your mistakes.\n",
289-
"18:45:37 httpx INFO HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
290-
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
291-
"Tool Calls:\n",
292-
" get_weather (call_ormEQsagC8POw6hpsc8mMS4W)\n",
293-
" Call ID: call_ormEQsagC8POw6hpsc8mMS4W\n",
294-
" Args:\n",
295-
" location: San Francisco, CA\n"
296-
]
297-
}
298-
],
252+
"outputs": [],
299253
"source": [
300254
"print_stream(graph.stream(None, config, stream_mode=\"values\"))"
301255
]
@@ -312,23 +266,10 @@
312266
},
313267
{
314268
"cell_type": "code",
315-
"execution_count": 8,
269+
"execution_count": null,
316270
"id": "1c81ed9f",
317271
"metadata": {},
318-
"outputs": [
319-
{
320-
"data": {
321-
"text/plain": [
322-
"{'configurable': {'thread_id': '42',\n",
323-
" 'checkpoint_ns': '',\n",
324-
" 'checkpoint_id': '1f072f58-b2bc-662b-8004-07d2cd61ee7e'}}"
325-
]
326-
},
327-
"execution_count": 8,
328-
"metadata": {},
329-
"output_type": "execute_result"
330-
}
331-
],
272+
"outputs": [],
332273
"source": [
333274
"state = graph.get_state(config)\n",
334275
"\n",
@@ -340,31 +281,10 @@
340281
},
341282
{
342283
"cell_type": "code",
343-
"execution_count": 9,
284+
"execution_count": null,
344285
"id": "83148e08-63e8-49e5-a08b-02dc907bed1d",
345286
"metadata": {},
346-
"outputs": [
347-
{
348-
"name": "stdout",
349-
"output_type": "stream",
350-
"text": [
351-
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
352-
"Tool Calls:\n",
353-
" get_weather (call_ormEQsagC8POw6hpsc8mMS4W)\n",
354-
" Call ID: call_ormEQsagC8POw6hpsc8mMS4W\n",
355-
" Args:\n",
356-
" location: San Francisco\n",
357-
"=================================\u001b[1m Tool Message \u001b[0m=================================\n",
358-
"Name: get_weather\n",
359-
"\n",
360-
"It's always sunny in sf\n",
361-
"18:45:38 httpx INFO HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
362-
"==================================\u001b[1m Ai Message \u001b[0m==================================\n",
363-
"\n",
364-
"The weather in San Francisco is always sunny.\n"
365-
]
366-
}
367-
],
287+
"outputs": [],
368288
"source": [
369289
"print_stream(graph.stream(None, config, stream_mode=\"values\"))"
370290
]
@@ -394,9 +314,9 @@
394314
"name": "python",
395315
"nbconvert_exporter": "python",
396316
"pygments_lexer": "ipython3",
397-
"version": "3.11.13"
317+
"version": "3.11.14"
398318
}
399319
},
400320
"nbformat": 4,
401321
"nbformat_minor": 5
402-
}
322+
}

examples/cross-thread-persistence-functional.ipynb

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,7 @@
119119
"cell_type": "markdown",
120120
"id": "c4c550b5-1954-496b-8b9d-800361af17dc",
121121
"metadata": {},
122-
"source": [
123-
"### Define store\n",
124-
"\n",
125-
"In this example we will create a workflow that will be able to retrieve information about a user's preferences. We will do so by defining an `InMemoryStore` - an object that can store data in memory and query that data.\n",
126-
"\n",
127-
"When storing objects using the `Store` interface you define two things:\n",
128-
"\n",
129-
"* the namespace for the object, a tuple (similar to directories)\n",
130-
"* the object key (similar to filenames)\n",
131-
"\n",
132-
"In our example, we'll be using `(\"memories\", <user_id>)` as namespace and random UUID as key for each new memory.\n",
133-
"\n",
134-
"Importantly, to determine the user, we will be passing `user_id` via the config keyword argument of the node function.\n",
135-
"\n",
136-
"Let's first define our store!"
137-
]
122+
"source": "### Define store\n\nIn this example we will create a workflow that will be able to retrieve information about a user's preferences. We will do so by defining a `RedisStore` - an object that can store data in Redis and query that data.\n\nWhen storing objects using the `Store` interface you define two things:\n\n* the namespace for the object, a tuple (similar to directories)\n* the object key (similar to filenames)\n\nIn our example, we'll be using `(\"memories\", <user_id>)` as namespace and random UUID as key for each new memory.\n\nImportantly, to determine the user, we will be passing `user_id` via the config keyword argument of the node function.\n\nLet's first define our store!"
138123
},
139124
{
140125
"cell_type": "code",
@@ -417,4 +402,4 @@
417402
},
418403
"nbformat": 4,
419404
"nbformat_minor": 5
420-
}
405+
}

examples/cross-thread-persistence.ipynb

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,7 @@
105105
"cell_type": "markdown",
106106
"id": "c4c550b5-1954-496b-8b9d-800361af17dc",
107107
"metadata": {},
108-
"source": [
109-
"## Define store\n",
110-
"\n",
111-
"In this example we will create a graph that will be able to retrieve information about a user's preferences. We will do so by defining an `InMemoryStore` - an object that can store data in memory and query that data. We will then pass the store object when compiling the graph. This allows each node in the graph to access the store: when you define node functions, you can define `store` keyword argument, and LangGraph will automatically pass the store object you compiled the graph with.\n",
112-
"\n",
113-
"When storing objects using the `Store` interface you define two things:\n",
114-
"\n",
115-
"* the namespace for the object, a tuple (similar to directories)\n",
116-
"* the object key (similar to filenames)\n",
117-
"\n",
118-
"In our example, we'll be using `(\"memories\", <user_id>)` as namespace and random UUID as key for each new memory.\n",
119-
"\n",
120-
"Importantly, to determine the user, we will be passing `user_id` via the config keyword argument of the node function.\n",
121-
"\n",
122-
"Let's first define an `InMemoryStore` already populated with some memories about the users."
123-
]
108+
"source": "## Define store\n\nIn this example we will create a graph that will be able to retrieve information about a user's preferences. We will do so by defining a `RedisStore` - an object that can store data in Redis and query that data. We will then pass the store object when compiling the graph. This allows each node in the graph to access the store: when you define node functions, you can define `store` keyword argument, and LangGraph will automatically pass the store object you compiled the graph with.\n\nWhen storing objects using the `Store` interface you define two things:\n\n* the namespace for the object, a tuple (similar to directories)\n* the object key (similar to filenames)\n\nIn our example, we'll be using `(\"memories\", <user_id>)` as namespace and random UUID as key for each new memory.\n\nImportantly, to determine the user, we will be passing `user_id` via the config keyword argument of the node function.\n\nLet's first define a `RedisStore` already populated with some memories about the users."
124109
},
125110
{
126111
"cell_type": "code",
@@ -410,4 +395,4 @@
410395
},
411396
"nbformat": 4,
412397
"nbformat_minor": 5
413-
}
398+
}

examples/subgraph-persistence.ipynb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@
175175
"cell_type": "markdown",
176176
"id": "47084b1f-9fd5-40a9-9d75-89eb5f853d02",
177177
"metadata": {},
178-
"source": [
179-
"We can now compile the graph with an in-memory checkpointer (`MemorySaver`)."
180-
]
178+
"source": "We can now compile the graph with a Redis checkpointer (`RedisSaver`)."
181179
},
182180
{
183181
"cell_type": "code",
@@ -392,4 +390,4 @@
392390
},
393391
"nbformat": 4,
394392
"nbformat_minor": 5
395-
}
393+
}

0 commit comments

Comments
 (0)