You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/README.md
+41-5Lines changed: 41 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This directory contains Jupyter notebooks demonstrating the usage of Redis with
4
4
5
5
## Running Notebooks with Docker
6
6
7
-
To run these notebooks using the local development version of the Redis checkpoint package:
7
+
To run these notebooks using Docker (recommended for consistent environment):
8
8
9
9
1. Ensure you have Docker and Docker Compose installed on your system.
10
10
2. Navigate to this directory (`examples`) in your terminal.
@@ -15,21 +15,57 @@ To run these notebooks using the local development version of the Redis checkpoi
15
15
```
16
16
17
17
4. Look for a URL in the console output that starts with `http://127.0.0.1:8888/tree`. Open this URL in your web browser to access Jupyter Notebook.
18
-
5. You can now run the notebooks, which will use the local development version of the Redis checkpoint package.
18
+
5. You can now run the notebooks with all dependencies pre-installed.
19
19
20
-
Note: The first time you run this, it may take a few minutes to build the Docker image.
20
+
Note:
21
+
- The first time you run this, it may take a few minutes to build the Docker image.
22
+
- The Docker setup uses a simplified structure where the examples are self-contained, making it portable and independent of the repository structure.
21
23
22
24
To stop the Docker containers, use Ctrl+C in the terminal where you ran `docker compose up`, then run:
23
25
24
26
```bash
25
27
docker compose down
26
28
```
27
29
30
+
## Running Notebooks Locally
31
+
32
+
If you prefer to run these notebooks locally without Docker:
33
+
34
+
1. Make sure you have Redis running locally or accessible from your machine.
35
+
2. Install the required dependencies:
36
+
37
+
```bash
38
+
pip install langgraph-checkpoint-redis
39
+
pip install langgraph>=0.3.0
40
+
pip install jupyter redis>=5.2.1 redisvl>=0.5.1
41
+
pip install langchain-openai langchain-anthropic
42
+
pip install python-ulid "httpx>=0.24.0,<1.0.0"
43
+
44
+
# Some notebooks may require additional packages, which will be installed
45
+
# within the notebooks themselves when needed
46
+
```
47
+
48
+
3. Set the appropriate Redis connection string in the notebooks.
49
+
4. Launch Jupyter Notebook:
50
+
51
+
```bash
52
+
jupyter notebook
53
+
```
54
+
55
+
5. Navigate to the notebook you want to run and open it.
56
+
28
57
## Notebook Contents
29
58
30
-
-`persistence_redis.ipynb`: Demonstrates the usage of `RedisSaver` and `AsyncRedisSaver` checkpoint savers with LangGraph.
59
+
-`persistence-functional.ipynb`: Demonstrates the usage of `RedisSaver` and functional persistence patterns with LangGraph.
31
60
-`create-react-agent-memory.ipynb`: Shows how to create an agent with persistent memory using Redis.
32
61
-`cross-thread-persistence.ipynb`: Demonstrates cross-thread persistence capabilities with Redis.
33
-
-`persistence-functional.ipynb`: Shows functional persistence patterns with Redis.
62
+
-`cross-thread-persistence-functional.ipynb`: Shows functional cross-thread persistence patterns with Redis.
63
+
-`create-react-agent-manage-message-history.ipynb`: Shows how to manage conversation history in a ReAct agent with Redis.
64
+
-`subgraph-persistence.ipynb`: Demonstrates persistence with subgraphs using Redis.
65
+
-`subgraphs-manage-state.ipynb`: Shows how to manage state in subgraphs with Redis.
66
+
-`create-react-agent-hitl.ipynb`: Demonstrates human-in-the-loop (HITL) capabilities with Redis.
67
+
-`human_in_the_loop/*.ipynb`: Demonstrates various human-in-the-loop interaction patterns with LangGraph and Redis.
68
+
69
+
All notebooks have been updated to use the Redis implementation instead of memory implementation, showcasing the proper usage of Redis integration with LangGraph.
34
70
35
71
These notebooks are designed to work both within this Docker environment (using local package builds) and standalone (using installed packages via pip).
0 commit comments