Cut Redis plugin over to external nemo-agent-toolkit-redis package#2046
Cut Redis plugin over to external nemo-agent-toolkit-redis package#2046bbednarski9 wants to merge 5 commits into
Conversation
…ty shim to the new nvidia-nemo-agent-toolkit-redis 3p repo Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR migrates the Redis integration from an internal implementation in ChangesRedis External Package Migration
🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
This PR is breaking because it will require folks to install nemo-agent-toolkit-redis, otherwise the compatibility shim should handle the API cutover |
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
85c5145 to
c486515
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
packages/nvidia_nat_redis/tests/test_shim_metadata.py (3)
15-20: 💤 Low valueConsider adding a docstring to document test intent.
While the test name is descriptive, a brief docstring would help document what aspect of the shim is being validated.
📖 Suggested docstring
def test_shim_has_no_python_packages_or_nat_entry_points(): + """Verify that the compatibility shim ships no Python packages or NAT entry points.""" pyproject = _load_pyproject()🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/nvidia_nat_redis/tests/test_shim_metadata.py` around lines 15 - 20, Add a short docstring to the test function test_shim_has_no_python_packages_or_nat_entry_points describing the intent (validate that the shim exposes no Python packages, no nat entry points, and no Python files under src/nat/plugins/redis); update the function header where _load_pyproject(), pyproject assertions, and the glob check against (PACKAGE_ROOT / "src" / "nat" / "plugins" / "redis") are located to include this one-line docstring so future readers understand what the test is verifying.Source: Coding guidelines
23-27: 💤 Low valueConsider adding a docstring to document test intent.
A brief docstring would clarify that this test validates the shim's external dependency declaration.
📖 Suggested docstring
def test_shim_depends_on_external_redis_plugin(): + """Verify that the shim declares exactly one dependency on the external Redis plugin.""" pyproject = _load_pyproject()🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/nvidia_nat_redis/tests/test_shim_metadata.py` around lines 23 - 27, Add a brief docstring to the test_shim_depends_on_external_redis_plugin function that explains its intent: it verifies that the shim's pyproject declares the external Redis dependency. Edit the test_shim_depends_on_external_redis_plugin function (which calls _load_pyproject and asserts dependencies == ["nemo-agent-toolkit-redis>=0.1.0,<2.0.0"]) and add a one- or two-sentence docstring at the top of the function describing that it ensures the package lists the external Redis plugin dependency.Source: Coding guidelines
10-12: 💤 Low valueConsider adding a docstring for clarity.
While this helper function is straightforward, the coding guidelines require Google-style docstrings for functions. A brief docstring would improve maintainability.
📖 Suggested docstring
def _load_pyproject() -> dict: + """Load and parse the package's pyproject.toml file. + + Returns: + Parsed TOML configuration as a dictionary. + """ with (PACKAGE_ROOT / "pyproject.toml").open("rb") as pyproject_file:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/nvidia_nat_redis/tests/test_shim_metadata.py` around lines 10 - 12, Add a Google-style docstring to the helper function _load_pyproject that briefly explains its purpose (loads and returns the parsed pyproject.toml as a dict), describes the return type (dict), and notes any side effects or file assumptions (reads PACKAGE_ROOT / "pyproject.toml"). Place the docstring immediately below the def _load_pyproject() signature and follow Google docstring formatting for a short summary and a Returns section.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/nvidia_nat_redis/tests/test_shim_metadata.py`:
- Around line 1-2: The file currently only has SPDX tags and must include the
full Apache-2.0 license header block; update the top of
packages/nvidia_nat_redis/tests/test_shim_metadata.py to prepend the complete
Apache-2.0 header template (the multi-line comment block used in this repo,
e.g., lines 4–15 from packages/nvidia_nat_redis/pyproject.toml) so the SPDX tags
remain but are followed by the full license header exactly as in other source
files.
---
Nitpick comments:
In `@packages/nvidia_nat_redis/tests/test_shim_metadata.py`:
- Around line 15-20: Add a short docstring to the test function
test_shim_has_no_python_packages_or_nat_entry_points describing the intent
(validate that the shim exposes no Python packages, no nat entry points, and no
Python files under src/nat/plugins/redis); update the function header where
_load_pyproject(), pyproject assertions, and the glob check against
(PACKAGE_ROOT / "src" / "nat" / "plugins" / "redis") are located to include this
one-line docstring so future readers understand what the test is verifying.
- Around line 23-27: Add a brief docstring to the
test_shim_depends_on_external_redis_plugin function that explains its intent: it
verifies that the shim's pyproject declares the external Redis dependency. Edit
the test_shim_depends_on_external_redis_plugin function (which calls
_load_pyproject and asserts dependencies ==
["nemo-agent-toolkit-redis>=0.1.0,<2.0.0"]) and add a one- or two-sentence
docstring at the top of the function describing that it ensures the package
lists the external Redis plugin dependency.
- Around line 10-12: Add a Google-style docstring to the helper function
_load_pyproject that briefly explains its purpose (loads and returns the parsed
pyproject.toml as a dict), describes the return type (dict), and notes any side
effects or file assumptions (reads PACKAGE_ROOT / "pyproject.toml"). Place the
docstring immediately below the def _load_pyproject() signature and follow
Google docstring formatting for a short summary and a Returns section.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 248891ff-e6fa-4b8e-95c5-d209e8d4cae2
⛔ Files ignored due to path filters (54)
examples/A2A/math_assistant_a2a/uv.lockis excluded by!**/*.lockexamples/A2A/math_assistant_a2a_protected/uv.lockis excluded by!**/*.lockexamples/HITL/por_to_jiratickets/uv.lockis excluded by!**/*.lockexamples/HITL/simple_calculator_hitl/uv.lockis excluded by!**/*.lockexamples/MCP/service_account_auth_mcp/uv.lockis excluded by!**/*.lockexamples/MCP/simple_auth_mcp/uv.lockis excluded by!**/*.lockexamples/MCP/simple_calculator_fastmcp/uv.lockis excluded by!**/*.lockexamples/MCP/simple_calculator_fastmcp_protected/uv.lockis excluded by!**/*.lockexamples/MCP/simple_calculator_mcp/uv.lockis excluded by!**/*.lockexamples/MCP/simple_calculator_mcp_protected/uv.lockis excluded by!**/*.lockexamples/RAG/simple_rag/uv.lockis excluded by!**/*.lockexamples/a365_example/uv.lockis excluded by!**/*.lockexamples/advanced_agents/alert_triage_agent/uv.lockis excluded by!**/*.lockexamples/agents/uv.lockis excluded by!**/*.lockexamples/control_flow/hybrid_control_flow/uv.lockis excluded by!**/*.lockexamples/control_flow/parallel_executor/uv.lockis excluded by!**/*.lockexamples/control_flow/router_agent/uv.lockis excluded by!**/*.lockexamples/control_flow/sequential_executor/uv.lockis excluded by!**/*.lockexamples/custom_functions/automated_description_generation/uv.lockis excluded by!**/*.lockexamples/custom_functions/plot_charts/uv.lockis excluded by!**/*.lockexamples/documentation_guides/uv.lockis excluded by!**/*.lockexamples/documentation_guides/workflows/text_file_ingest/uv.lockis excluded by!**/*.lockexamples/dynamo_integration/latency_sensitivity_demo/uv.lockis excluded by!**/*.lockexamples/dynamo_integration/react_benchmark_agent/uv.lockis excluded by!**/*.lockexamples/evaluation_and_profiling/email_phishing_analyzer/uv.lockis excluded by!**/*.lockexamples/evaluation_and_profiling/simple_calculator_eval/uv.lockis excluded by!**/*.lockexamples/evaluation_and_profiling/simple_web_query_eval/uv.lockis excluded by!**/*.lockexamples/experimental/claude_code_agent_adapter/uv.lockis excluded by!**/*.lockexamples/experimental/codex_agent_adapter/uv.lockis excluded by!**/*.lockexamples/experimental/cursor_agent_adapter/uv.lockis excluded by!**/*.lockexamples/experimental/hermes_agent_adapter/uv.lockis excluded by!**/*.lockexamples/experimental/openclaw_agent_adapter/uv.lockis excluded by!**/*.lockexamples/finetuning/dpo_tic_tac_toe/uv.lockis excluded by!**/*.lockexamples/finetuning/rl_with_openpipe_art/uv.lockis excluded by!**/*.lockexamples/frameworks/adk_demo/uv.lockis excluded by!**/*.lockexamples/frameworks/agno_personal_finance/uv.lockis excluded by!**/*.lockexamples/frameworks/haystack_deep_research_agent/uv.lockis excluded by!**/*.lockexamples/frameworks/multi_frameworks/uv.lockis excluded by!**/*.lockexamples/frameworks/nat_autogen_demo/uv.lockis excluded by!**/*.lockexamples/frameworks/semantic_kernel_demo/uv.lockis excluded by!**/*.lockexamples/frameworks/strands_demo/uv.lockis excluded by!**/*.lockexamples/front_ends/per_user_workflow/uv.lockis excluded by!**/*.lockexamples/front_ends/simple_auth/uv.lockis excluded by!**/*.lockexamples/front_ends/simple_calculator_custom_routes/uv.lockis excluded by!**/*.lockexamples/getting_started/simple_calculator/uv.lockis excluded by!**/*.lockexamples/getting_started/simple_web_query/uv.lockis excluded by!**/*.lockexamples/memory/redis/uv.lockis excluded by!**/*.lockexamples/notebooks/uv.lockis excluded by!**/*.lockexamples/object_store/user_report/uv.lockis excluded by!**/*.lockexamples/observability/simple_calculator_observability/uv.lockis excluded by!**/*.lockexamples/prompt_from_file/uv.lockis excluded by!**/*.lockexamples/safety_and_security/retail_agent/uv.lockis excluded by!**/*.lockpackages/nvidia_nat_redis/uv.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (18)
docs/source/build-workflows/memory.mddocs/source/build-workflows/object-store.mddocs/source/components/agents/auto-memory-wrapper/auto-memory-wrapper.mddocs/source/extend/custom-components/memory.mddocs/source/get-started/installation.mdpackages/nvidia_nat_redis/pyproject.tomlpackages/nvidia_nat_redis/src/nat/meta/pypi.mdpackages/nvidia_nat_redis/src/nat/plugins/redis/__init__.pypackages/nvidia_nat_redis/src/nat/plugins/redis/memory.pypackages/nvidia_nat_redis/src/nat/plugins/redis/object_store.pypackages/nvidia_nat_redis/src/nat/plugins/redis/redis_editor.pypackages/nvidia_nat_redis/src/nat/plugins/redis/redis_object_store.pypackages/nvidia_nat_redis/src/nat/plugins/redis/register.pypackages/nvidia_nat_redis/src/nat/plugins/redis/schema.pypackages/nvidia_nat_redis/tests/test_redis_editor.pypackages/nvidia_nat_redis/tests/test_redis_object_store.pypackages/nvidia_nat_redis/tests/test_shim_metadata.pypyproject.toml
💤 Files with no reviewable changes (8)
- packages/nvidia_nat_redis/tests/test_redis_editor.py
- packages/nvidia_nat_redis/src/nat/plugins/redis/schema.py
- packages/nvidia_nat_redis/src/nat/plugins/redis/redis_object_store.py
- packages/nvidia_nat_redis/src/nat/plugins/redis/object_store.py
- packages/nvidia_nat_redis/src/nat/plugins/redis/redis_editor.py
- packages/nvidia_nat_redis/src/nat/plugins/redis/memory.py
- packages/nvidia_nat_redis/tests/test_redis_object_store.py
- packages/nvidia_nat_redis/src/nat/plugins/redis/register.py
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
c00bb65 to
03bdd71
Compare
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
acbd4e7 to
da9d2d4
Compare
|
Making the call to kick this to 1.9, too close to 1.8 release to bring in this breaking change without QA |
Had previously removed this prior to validating updates to the nemo-agent-toolkit-redis third-party distribution. The feedback has been incorporated and a release that is compatible with nemo-agent-toolkit v1.8 is on the way. This does not mean that we have closed out #2046. for NAT 1.8, both the NAT-native library and the third-party package will be viable paths. But we will not cutover the documentation until NAT 1.9 because requiring the uv install is a breaking change for existing Redis users. ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/NeMo-Agent-Toolkit/blob/develop/docs/source/resources/contributing/index.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. ## Summary by CodeRabbit * **Documentation** * Updated release notes and README to acknowledge NeMo-Agent-Toolkit-Redis as a newly supported third-party plugin toolkit available through the Public Plugin API, complementing existing plugin references and providing users a comprehensive view of integration options for extending the platform. Authors: - Bryan Bednarski (https://github.com/bbednarski9) Approvers: - David Gardner (https://github.com/dagardner-nv) URL: #2051
Description
Closes N/A
Cut the Redis integration over from the in-tree
nvidia-nat-redisimplementation to the Redis-managednemo-agent-toolkit-redisplugin while keeping the historicalnvidia-nat-redisdistribution as a compatibility shim.This PR:
redisandmostextras to resolvenemo-agent-toolkit-redis;packages/nvidia_nat_redisinto a no-code compatibility package depending onnemo-agent-toolkit-redis;nat.plugins.redisimplementation and old direct Redis tests from NAT;Validation:
uv run ruff check packages/nvidia_nat_redis/tests/test_shim_metadata.pyuv run python -m pytest packages/nvidia_nat_redis/tests/test_shim_metadata.pyuv run --extra redis python -m pytest ../nemo-agent-toolkit-redis-fork/tests/test_entry_points.py ../nemo-agent-toolkit-redis-fork/tests/test_nat_api_imports.py ../nemo-agent-toolkit-redis-fork/tests/test_auto_memory.py ../nemo-agent-toolkit-redis-fork/tests/test_redis_agent_memory_editor.py ../nemo-agent-toolkit-redis-fork/tests/test_redis_editor.pyuv run --with-editable packages/nvidia_nat_redis python ...direct shim install smokeuv run --extra redis nat info componentsuv run --extra redis --extra langchain --extra phoenix nat validate --config_file examples/memory/redis/configs/config.ymluv run --extra redis --extra langchain --with-editable examples/object_store/user_report nat validate --config_file examples/object_store/user_report/configs/config_redis.ymlcd examples/object_store/user_report && uv run python -m pytest tests/test_objext_store_example_user_report_tool.py -qcd examples/memory/redis && REDIS_PASSWORD= uv run python -m pytest tests/test_memory_redis.py -q -rs --run_integrationwith local Redis on 6379 and a local trace receiver on 6006python3 ci/scripts/license_diff.py release/1.8uv run python ci/scripts/sbom_list.py --uvlock uv.lock --output /tmp/nat-redis-cutover-sbom.tsvLicense review:
Note: this branch currently uses a local/source override to the Redis fork while the external package changes are being staged.
By Submitting this PR I confirm:
Summary by CodeRabbit
Documentation
Chores
Tests