Skip to content

Commit ecfaf93

Browse files
Adds cloud Redis agent memory option (#17)
* updates references to Redis Agent Memory * updates references to Redis Agent Memory in READMEs * adds redis agent memory as dependency * adds support for cloud agent memory * updates ci to run integration tests against cloud service * fixes async tests by changing to function scope * passes timeout_ms in memory config * thread config.timeout_ms into AgentMemory client * close client on exit, read owner_id, fix topics filter * simplifies test running
1 parent 344a5a8 commit ecfaf93

19 files changed

Lines changed: 1459 additions & 69 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ jobs:
103103
- name: Docker Info
104104
run: docker info
105105
- name: Integration Tests
106-
run: uv run python -m pytest tests/integration --run-integration
106+
env:
107+
AGENT_MEMORY_ENDPOINT: ${{ secrets.AGENT_MEMORY_ENDPOINT }}
108+
AGENT_MEMORY_API_KEY: ${{ secrets.AGENT_MEMORY_API_KEY }}
109+
AGENT_MEMORY_STORE_ID: ${{ secrets.AGENT_MEMORY_STORE_ID }}
110+
run: uv run python -m pytest tests/integration
107111

108112
integration-api:
109113
runs-on: ubuntu-latest
@@ -138,7 +142,7 @@ jobs:
138142
exit 0
139143
fi
140144
docker info
141-
uv run python -m pytest tests/integration --run-integration --run-api-tests
145+
uv run python -m pytest tests/integration
142146
143147
build:
144148
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ dist/
1111
htmlcov/
1212

1313
NeMo-Agent-Toolkit-3P-repositories.pdf
14+
15+
.claude/settings.local.json

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: setup lint test test-integration test-integration-api validate build check clean
1+
.PHONY: setup lint test test-integration validate build check clean
22

33
setup:
44
uv sync --group dev --extra test
@@ -11,10 +11,7 @@ test:
1111
uv run python -m pytest
1212

1313
test-integration:
14-
uv run python -m pytest tests/integration --run-integration
15-
16-
test-integration-api:
17-
uv run python -m pytest tests/integration --run-integration --run-api-tests
14+
uv run python -m pytest tests/integration
1815

1916
validate:
2017
uv run nat validate --config_file examples/tool_based_memory/configs/config.yml

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
**Redis-backed memory for [NVIDIA NeMo Agent Toolkit](https://github.com/NVIDIA/NeMo-Agent-Toolkit)** — production [Redis Agent Memory](https://redis.github.io/agent-memory-server/quick-start/) integrations plus direct Redis plugins (the historical `nat.plugins.redis` stack).
88

9-
In NAT, long-term recall is usually wired through memory tools such as `get_memory` and `add_memory`, which delegate to a **`MemoryEditor`** implementation. This package adds Redis-backed options in **two families**: **Redis Agent Memory** (AMS over HTTP — richer lifecycle, optional auto-memory workflow) and **direct Redis** (JSON + vector search or plain KV inside `nat.plugins.redis`, no AMS).
9+
In NAT, long-term recall is usually wired through memory tools such as `get_memory` and `add_memory`, which delegate to a **`MemoryEditor`** implementation. This package adds Redis-backed options in **two families**: **Redis Agent Memory** (over HTTP — richer lifecycle, optional auto-memory workflow) and **direct Redis** (JSON + vector search or plain KV inside `nat.plugins.redis`).
1010

1111
This repo is the standalone home for integrations that used to ship under
1212
[`packages/nvidia_nat_redis`](https://github.com/NVIDIA/NeMo-Agent-Toolkit/tree/develop/packages/nvidia_nat_redis) in the NeMo Agent Toolkit monorepo.
@@ -15,28 +15,28 @@ This repo is the standalone home for integrations that used to ship under
1515
1. `_type: redis_agent_memory_backend` — Redis Agent Memory as a NAT `MemoryEditor` long-term memory backend.
1616
2. `_type: redis_agent_memory_auto_memory` — A native Redis Agent Memory wrapper that uses working memory plus
1717
`memory_prompt` hydration on every turn.
18-
AMS runs as a separate service; these surfaces talk to it via the agent-memory client.
18+
Agent Memory runs as a separate service; these surfaces talk to it via the agent-memory client.
1919

2020
1. `_type: redis_agent_memory_backend` — Redis Agent Memory behind NAT’s standard **`MemoryEditor`** contract (fits tool-driven long-term memory).
21-
2. `_type: redis_agent_memory_auto_memory` — A **`workflow` wrapper** (not just another editor): working memory, `memory_prompt` hydration every turn, turn capture, and promotion — the fullest AMS-shaped integration.
21+
2. `_type: redis_agent_memory_auto_memory` — A **`workflow` wrapper** (not just another editor): working memory, `memory_prompt` hydration every turn, turn capture, and promotion — the fullest Agent Memory integration.
2222

2323
### Direct Redis (simple in-Redis memory)
2424

2525
Loaded via the `nat.plugins` setuptools entry point `nat_redis` (same name as
2626
the historical monorepo package):
2727

28-
- `_type: redis_memory` — Vector search over JSON documents in Redis (RediSearch); requires a workflow `embedder` and Redis Stack (or Redis with search + JSON support). Implements **`MemoryEditor`**-style semantic memory without AMS.
28+
- `_type: redis_memory` — Vector search over JSON documents in Redis (RediSearch); requires a workflow `embedder` and Redis Stack (or Redis with search + JSON support). Implements **`MemoryEditor`**-style semantic memory without Redis Agent Memory.
2929
- `_type: redis` — NAT **object store** on plain Redis key–value storage (not semantic long-term memory).
3030

3131
| | **Redis Agent Memory** | **Direct Redis** |
3232
| --- | --- | --- |
33-
| **Runs** | AMS service + Redis | Redis only (your NAT process uses the client) |
34-
| **Best for** | Learning-style memory, working memory, AMS filters and APIs | Lightweight Redis-native memory or KV object store |
35-
| **Tradeoff** | Operate AMS; HTTP path | Simpler ops for `redis` / `redis_memory`; vector path needs embedder + search-capable Redis |
33+
| **Runs** | Agent Memory service + Redis | Redis only (your NAT process uses the client) |
34+
| **Best for** | Learning-style memory, working memory, Agent Memory filters and APIs | Lightweight Redis-native memory or KV object store |
35+
| **Tradeoff** | Operate Agent Memory; HTTP path | Simpler ops for `redis` / `redis_memory`; vector path needs embedder + search-capable Redis |
3636

3737
Use **Redis Agent Memory** when you want the Redis Agent Memory feature set.
3838
Use **`redis_memory`** when you only need a lightweight Redis-native `MemoryEditor`
39-
without AMS.
39+
without automatic Agent Memory.
4040

4141
### Python imports (same as NeMo)
4242

@@ -87,7 +87,7 @@ versions.
8787
- Use `_type: redis_agent_memory_backend` when your workflow already uses NAT memory tools and you want Redis Agent Memory behind the standard `MemoryEditor` contract.
8888
- Use `_type: redis_agent_memory_auto_memory` when you want Redis Agent Memory to own working-memory continuity, prompt hydration, and turn capture on every request. This exposes the richness of Redis Agent Memory in its fullest form.
8989
- Use `_type: redis_memory` when you want the simpler direct-Redis memory from NeMo Agent Toolkit (Redis JSON + vector index, no Redis Agent Memory). You must configure an `embedder` reference and run a Redis deployment that supports the search commands used by the plugin.
90-
- Use `_type: redis` when you need NAT’s Redis-backed **object store** (KV), not vector or AMS-backed semantic memory.
90+
- Use `_type: redis` when you need NAT’s Redis-backed **object store** (KV), not vector or Agent Memory-backed semantic memory.
9191

9292
## Integration Modes
9393

@@ -164,15 +164,17 @@ make build
164164
make check
165165
```
166166

167-
Integration tests are opt-in because they start real Redis and Agent Memory
168-
Server containers:
167+
`make test` runs the whole suite. Integration tests skip themselves when their
168+
infrastructure is absent (no Docker, unreachable Agent Memory Server, or missing
169+
API/cloud credentials), so a bare run stays green anywhere. To run just the
170+
integration tests where that infrastructure exists:
169171

170172
```bash
171173
make test-integration
172174
```
173175

174176
The example Compose files are intended for local development. They bind Redis
175-
and AMS to `127.0.0.1` and run AMS with auth disabled.
177+
and Redis Agent Memory to `127.0.0.1` and run Redis Agent Memory with auth disabled.
176178

177179
See [CONTRIBUTING.md](CONTRIBUTING.md).
178180

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ Supported config fields:
4848

4949
Runtime behavior:
5050

51-
- `add_items()` creates long-term memories with optional AMS fields such as `session_id`, `namespace`, `entities`, `event_date`, and `memory_type`
51+
- `add_items()` creates long-term memories with optional Agent Memory fields such as `session_id`, `namespace`, `entities`, `event_date`, and `memory_type`
5252
- `add_items()` falls back to NAT `conversation_id` for `session_id` when no explicit value is provided
53-
- `search()` requires `user_id` and forwards AMS filters such as `session_id`, `namespace`, `topics`, `entities`, `memory_type`, `distance_threshold`, and `recency`
53+
- `search()` requires `user_id` and forwards Agent Memory filters such as `session_id`, `namespace`, `topics`, `entities`, `memory_type`, `distance_threshold`, and `recency`
5454
- `search()` falls back to NAT `user_id` when the current runtime context provides one
5555
- `remove_items()` supports direct deletion by `memory_id` / `memory_ids` or filtered deletion by search
5656

examples/agent_auto_memory/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The example expects:
4141
## Start Services
4242

4343
Compose starts Redis Stack and Redis Agent Memory containers for local development. Both
44-
ports bind to `127.0.0.1`, and AMS auth is disabled.
44+
ports bind to `127.0.0.1`, and Agent Memory auth is disabled.
4545

4646
```bash
4747
docker compose \

examples/tool_based_memory/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Edit `examples/tool_based_memory/.env`:
3737
## Start Services
3838

3939
Compose starts Redis Stack and Agent Memory Server for local development. Both
40-
ports bind to `127.0.0.1`, and AMS auth is disabled.
40+
ports bind to `127.0.0.1`, and Agent Memory auth is disabled.
4141

4242
```bash
4343
docker compose \

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dependencies = [
2525
"numpy>=1.24",
2626
"nvidia-nat-core>=1.6.0,<2.0.0",
2727
"redis>=5.0.0,<6.0.0",
28+
"redis-agent-memory>=0.0.4,<1.0.0",
2829
"redisvl>=0.16.0,<1.0.0",
2930
]
3031

src/nat/plugins/redis/register.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
from . import memory
2323
from . import object_store
2424
from nvidia_nat_redis.redis_agent_memory import register as _ams_register # noqa: F401
25+
from nvidia_nat_redis.cloud_redis_agent_memory import memory as _cloud_ams_register # noqa: F401
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026, Redis
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
"""Public Redis Agent Memory cloud integration classes exported by this NAT plugin."""
5+
6+
from .editor import CloudRedisAgentMemoryEditor
7+
from .memory import CloudRedisAgentMemoryBackendConfig
8+
9+
__all__ = [
10+
"CloudRedisAgentMemoryBackendConfig",
11+
"CloudRedisAgentMemoryEditor",
12+
]

0 commit comments

Comments
 (0)