Skip to content

Migrates the current redis package from NAT repo to this repo#2

Open
justin-cechmanek wants to merge 5 commits intomainfrom
feat/migrate-redis-memory
Open

Migrates the current redis package from NAT repo to this repo#2
justin-cechmanek wants to merge 5 commits intomainfrom
feat/migrate-redis-memory

Conversation

@justin-cechmanek
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the “direct Redis” NAT components (memory + object store) into this repository alongside the existing Redis Agent Memory integration, wiring them into NAT via a new nat_redis entry point and documenting the additional configuration surfaces.

Changes:

  • Adds nat.plugins.redis package implementing _type: redis_memory (RediSearch + RedisJSON vector memory) and _type: redis (plain Redis-backed object store).
  • Registers the new components via the nat.components entry point nat_redis and updates packaging metadata/dependencies.
  • Adds unit/integration tests plus documentation updates describing when to use each Redis integration mode.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tests/test_redis_editor.py Unit tests for the new direct-Redis RedisEditor memory implementation.
tests/integration/test_redis_object_store.py Integration test validating RedisObjectStore roundtrip behavior.
src/nvidia_nat_redis/init.py Updates package docstring to reflect multiple Redis integration surfaces.
src/nat/plugins/redis/init.py Introduces the direct-Redis plugin package namespace.
src/nat/plugins/redis/register.py Entry-point import hook to register the direct-Redis components.
src/nat/plugins/redis/schema.py RediSearch/RedisJSON schema + index creation helper for vector memory.
src/nat/plugins/redis/redis_editor.py Implements the MemoryEditor backed by RedisJSON + vector search.
src/nat/plugins/redis/memory.py Registers _type: redis_memory and constructs Redis client + index.
src/nat/plugins/redis/redis_object_store.py Implements the Redis-backed ObjectStore.
src/nat/plugins/redis/object_store.py Registers _type: redis and yields a RedisObjectStore.
README.md Documents both Redis Agent Memory and the newly added direct-Redis plugins.
docs/configuration.md Adds configuration docs for _type: redis_memory and _type: redis.
pyproject.toml Adds dependencies, entry point (nat_redis), and package inclusion for nat.plugins.*.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


from .redis_object_store import RedisObjectStore

async with RedisObjectStore(**config.model_dump(exclude={"type"})) as store:
Comment thread src/nat/plugins/redis/memory.py
Comment thread src/nat/plugins/redis/redis_editor.py
Comment thread src/nat/plugins/redis/redis_editor.py
Comment thread src/nat/plugins/redis/redis_editor.py
Comment thread src/nat/plugins/redis/redis_editor.py Outdated
Comment on lines +240 to +242
keys = await self._client.keys(pattern)
if keys:
await self._client.delete(*keys)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justin-cechmanek shouldn't we use a search index pagination of some kind to fetch keys and run deletes/unlinks? Scans are generally bad.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I think scan_iter() is the more standard approach over search. We can tweak it with a count hint and unlink instead of delete.

Comment thread src/nat/plugins/redis/schema.py
Comment thread tests/test_redis_editor.py
Comment thread tests/test_redis_editor.py
Comment thread tests/test_redis_editor.py
@justin-cechmanek
Copy link
Copy Markdown
Collaborator Author

Delaying Copilot's change suggestions and maintaining parity with the current NAT Redis package for now.

Comment thread docs/configuration.md
Comment thread src/nvidia_nat_redis/__init__.py Outdated
Comment thread docs/configuration.md
2. Create or load Redis Agent Memory working memory for that identity.
3. Call `memory_prompt(...)`, invoke the inner chat function with the hydrated request, and append the finished turn back into working memory.

## Direct Redis memory (`redis_memory`)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a good look at the readme -- maybe dream a bit with codex/claude -- to think about how to make it easier, and clearer to understand that there are two redis memory types here and some different flavors. Maybe we LEAD with the plugin approach (MemoryEditor) and then underneath list the two options and clearly highlight tradeoffs of each and how they work.

I also think we need a bit more front matter (maybe logos) and hype to draw a bit more attention when landing on the readme. Thanks!!!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some additions to the README. Let me know what you think

Copy link
Copy Markdown
Collaborator

@tylerhutcherson tylerhutcherson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justin-cechmanek looks great. One main comment on the README and 1-2 naming things. The comment on optimizing scans can wait for now -- to your point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants