Skip to content

Commit a0d7f33

Browse files
committed
context-engineering: use Redis 8, fix 8088 refs, add tests
- Switch to Redis 8.2.1 (compose, tests via Testcontainers) - Replace Redis Stack mentions in CE docs; remove RedisInsight port - Default Agent Memory Server to http://localhost:8088; update notebooks - Keep LangGraph checkpointer off; add TODO explaining async issue - Remove deprecated APIs (RedisVL .connect, Pydantic .dict) - Add tests: unit + Redis-backed tool-path integration
1 parent 1cec8b3 commit a0d7f33

File tree

19 files changed

+357
-47
lines changed

19 files changed

+357
-47
lines changed

python-recipes/context-engineering/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ docker-compose up -d
116116
docker-compose ps
117117

118118
# Check Agent Memory Server health
119-
curl http://localhost:8000/health
119+
curl http://localhost:8088/health
120120
```
121121

122122
#### 2. Set Up the Reference Agent

python-recipes/context-engineering/SETUP.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Your `.env` file should look like this:
2929
```bash
3030
OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxxx
3131
REDIS_URL=redis://localhost:6379
32-
AGENT_MEMORY_URL=http://localhost:8000
32+
AGENT_MEMORY_URL=http://localhost:8088
3333
```
3434

3535
**Important:** The `.env` file is already in `.gitignore` so your API key won't be committed to git.
@@ -46,12 +46,12 @@ docker-compose up -d
4646
docker-compose ps
4747

4848
# Check that the Agent Memory Server is healthy
49-
curl http://localhost:8000/health
49+
curl http://localhost:8088/health
5050
```
5151

5252
You should see:
53-
- `redis-context-engineering` running on ports 6379 (Redis) and 8001 (RedisInsight)
54-
- `agent-memory-server` running on port 8000
53+
- `redis-context-engineering` running on port 6379 (Redis 8)
54+
- `agent-memory-server` running on port 8088
5555

5656
### Step 3: Install Python Dependencies
5757

@@ -92,11 +92,11 @@ docker exec redis-context-engineering redis-cli ping
9292
### Check Agent Memory Server
9393
```bash
9494
# Test health endpoint
95-
curl http://localhost:8000/health
95+
curl http://localhost:8088/health
9696
# Should return: {"status":"healthy"}
9797

9898
# Test that it can connect to Redis and has your API key
99-
curl http://localhost:8000/api/v1/namespaces
99+
curl http://localhost:8088/api/v1/namespaces
100100
# Should return a list of namespaces (may be empty initially)
101101
```
102102

@@ -151,15 +151,15 @@ docker exec redis-context-engineering redis-cli ping
151151

152152
### Port Already in Use
153153

154-
If you get errors about ports already in use (6379, 8000, or 8001), you can either:
154+
If you get errors about ports already in use (6379 or 8088), you can either:
155155

156156
1. Stop the conflicting service
157157
2. Change the ports in `docker-compose.yml`:
158158
```yaml
159159
ports:
160160
- "6380:6379" # Use 6380 instead of 6379
161161
```
162-
Then update `REDIS_URL` in your `.env` file accordingly.
162+
Then update `REDIS_URL` or `AGENT_MEMORY_URL` in your `.env` file accordingly.
163163

164164
## Stopping Services
165165

python-recipes/context-engineering/docker-compose.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
services:
22
redis:
3-
image: redis/redis-stack:latest
3+
image: redis:8.2.1
44
container_name: redis-context-engineering
55
ports:
66
- "6379:6379"
7-
- "8001:8001" # RedisInsight
87
environment:
98
- REDIS_ARGS=--save 60 1 --loglevel warning
109
volumes:
@@ -20,7 +19,7 @@ services:
2019
container_name: agent-memory-server
2120
command: ["agent-memory", "api", "--host", "0.0.0.0", "--port", "8000", "--no-worker"]
2221
ports:
23-
- "8000:8000"
22+
- "8088:8000" # Host port changed to avoid conflicts
2423
environment:
2524
- REDIS_URL=redis://redis:6379
2625
- OPENAI_API_KEY=${OPENAI_API_KEY}

python-recipes/context-engineering/notebooks/common_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def setup_notebook(require_openai_key=True, require_memory_server=False):
129129
print(f"✅ REDIS_URL: {redis_url}")
130130

131131
# Check AGENT_MEMORY_URL
132-
memory_url = os.getenv("AGENT_MEMORY_URL", "http://localhost:8000")
132+
memory_url = os.getenv("AGENT_MEMORY_URL", "http://localhost:8088")
133133
print(f"✅ AGENT_MEMORY_URL: {memory_url}")
134134

135135
# Step 4: Check Agent Memory Server if required

python-recipes/context-engineering/notebooks/section-1-introduction/01_what_is_context_engineering.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@
404404
"\n",
405405
"# Initialize memory client\n",
406406
"config = MemoryClientConfig(\n",
407-
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8000\"),\n",
407+
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8088\"),\n",
408408
" default_namespace=\"redis_university\"\n",
409409
")\n",
410410
"memory_client = MemoryClient(config=config)\n",

python-recipes/context-engineering/notebooks/section-1-introduction/02_project_overview.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
"Example:\n",
188188
"```python\n",
189189
"from agent_memory_client import MemoryClient, MemoryClientConfig\n",
190-
"cfg = MemoryClientConfig(base_url=\"http://localhost:8000\", default_namespace=\"redis_university\")\n",
190+
"cfg = MemoryClientConfig(base_url=\"http://localhost:8088\", default_namespace=\"redis_university\")\n",
191191
"mem = MemoryClient(config=cfg)\n",
192192
"mem.store(entity_id=\"alex\", kind=\"preference\", text=\"Prefers online courses\")\n",
193193
"related = mem.search(entity_id=\"alex\", query=\"online\", k=3)\n",

python-recipes/context-engineering/notebooks/section-4-optimizations/01_context_window_management.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"# Initialize memory client with proper config\n",
134134
"import os\n",
135135
"config = MemoryClientConfig(\n",
136-
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8000\"),\n",
136+
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8088\"),\n",
137137
" default_namespace=\"redis_university\"\n",
138138
")\n",
139139
"memory_client = MemoryClient(config=config)\n",

python-recipes/context-engineering/notebooks/section-4-optimizations/02_retrieval_strategies.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
"# Initialize memory client with proper config\n",
163163
"import os\n",
164164
"config = MemoryClientConfig(\n",
165-
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8000\"),\n",
165+
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8088\"),\n",
166166
" default_namespace=\"redis_university\"\n",
167167
")\n",
168168
"memory_client = MemoryClient(config=config)\n",

python-recipes/context-engineering/notebooks/section-4-optimizations/03_grounding_with_memory.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"# Initialize memory client with proper config\n",
115115
"import os\n",
116116
"config = MemoryClientConfig(\n",
117-
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8000\"),\n",
117+
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8088\"),\n",
118118
" default_namespace=\"redis_university\"\n",
119119
")\n",
120120
"memory_client = MemoryClient(config=config)\n",

python-recipes/context-engineering/notebooks/section-4-optimizations/05_crafting_data_for_llms.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"# Initialize memory client with proper config\n",
167167
"import os\n",
168168
"config = MemoryClientConfig(\n",
169-
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8000\"),\n",
169+
" base_url=os.getenv(\"AGENT_MEMORY_URL\", \"http://localhost:8088\"),\n",
170170
" default_namespace=\"redis_university\"\n",
171171
")\n",
172172
"memory_client = MemoryClient(config=config)\n",

0 commit comments

Comments
 (0)