Skip to content

Add Redis Agent Memory Server as memory type#1702

Open
justin-cechmanek wants to merge 39 commits intoNVIDIA:developfrom
justin-cechmanek:feat/add-agent-memory-server
Open

Add Redis Agent Memory Server as memory type#1702
justin-cechmanek wants to merge 39 commits intoNVIDIA:developfrom
justin-cechmanek:feat/add-agent-memory-server

Conversation

@justin-cechmanek
Copy link
Copy Markdown

@justin-cechmanek justin-cechmanek commented Mar 2, 2026

Description

This PR adds a new package nvidia_nat_agent_memory_server which enables using Redis Agent Memory Server as a memory type.
Closes #1635

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • 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

  • New Features

    • Added Redis Agent Memory Server integration as a new memory backend option, available as an optional dependency (agent-memory-server). Enables persistent agent memory storage and retrieval with semantic search capabilities and namespace support.
  • Documentation

    • Added PyPI documentation for the new NVIDIA NeMo Agent Toolkit subpackage.

dagardner-nv and others added 27 commits March 17, 2025 17:05
Merge 1.0.0: upstream/develop to upstream/main
Merge pull request NVIDIA#92 from NVIDIA/develop
Updated changelog with another bug fix (NVIDIA#93)
## Description
<!-- Note: The pull request title will be included in the CHANGELOG. -->
<!-- Provide a standalone description of changes in this PR. -->
<!-- Reference any issues closed by this PR with "closes NVIDIA#1234". All PRs
should have an issue they close-->
<!--
SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION &
AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

## ❄️ Code freeze for `develop` and `v1.2.0` release

### What does this mean?
Only critical/hotfix level issues should be merged into `develop` until
release (merging of this PR).

### What is the purpose of this PR?
- Update documentation
- Allow testing for the new release
- Enable a means to merge `develop` into `main` for the release

## 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.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.
<!--
SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION &
AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

## ❄️ Code freeze for `v1.2.1` release

### What does this mean?
Only critical/hotfix level issues should be merged into `develop` until
release (merging of this PR).

### What is the purpose of this PR?
- Update documentation
- Allow testing for the new release
- Enable a means to merge `develop` into `main` for the release
Signed-off-by: David Gardner <dagardner@nvidia.com>
<!--
SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION &
AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

## ❄️ Code freeze for `release/1.3` and `v1.3.0` release

### What does this mean?
Only critical/hotfix level issues should be merged into `release/1.3`
until release (merging of this PR).

### What is the purpose of this PR?
- Update documentation
- Allow testing for the new release
- Enable a means to merge `release/1.3` into `main` for the release
Signed-off-by: David Gardner <dagardner@nvidia.com>
<!--
SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION &
AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

## ❄️ Code freeze for `release/1.3` and `v1.3.1` release

### What does this mean?
Only critical/hotfix level issues should be merged into `release/1.3`
until release (merging of this PR).

### What is the purpose of this PR?
- Update documentation
- Allow testing for the new release
- Enable a means to merge `release/1.3` into `main` for the release
Signed-off-by: David Gardner <dagardner@nvidia.com>
<!--
SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION &
AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

## ❄️ Code freeze for `v1.4.0` release

### What does this mean?
Only critical/hotfix level issues should be merged into `release/1.4`
until release (merging of this PR).

### What is the purpose of this PR?
- [RELEASE] NeMo-Agent-Toolkit v1.4.0
Signed-off-by: Michael Demoret <mdemoret@nvidia.com>
- Add package pyproject.toml, LICENSE, and LICENSE-3rd-party
- Package will provide Redis Agent Memory Server as a NAT memory type

Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
Made-with: Cursor
- Register packages/nvidia_nat_agent_memory_server in [tool.uv.workspace] members

Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
- Add nvidia-nat[agent-memory-server] extra and include in 'most' bundle

Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
- Add AgentMemoryServerEditor (add_items, search, remove_items) using agent-memory-client
- Add AgentMemoryServerMemoryConfig with base_url and default_namespace
- Register memory type via @register_memory and nat.components entry point
- Add agent-memory-client dependency and setuptools/entry-point config in pyproject.toml

Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
- Add tests/test_agent_memory_editor.py following nvidia_nat_redis structure
- Test add_items (success, empty list, conversation-derived text, skip no-text)
- Test search (success, missing user_id, empty memories)
- Test remove_items (by memory_id, by user_id, no-op when client lacks methods)
- Fix editor to import ClientMemoryRecord/MemoryTypeEnum from agent_memory_client.models
- Add nvidia-nat-agent-memory-server to tool.uv.sources (workspace = true) for resolution

Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
ClientMemoryRecord has no metadata attribute; remove invalid assignment
to fix type error and runtime.

Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Mar 2, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 2, 2026

Walkthrough

Added a new nvidia-nat-agent-memory-server package that integrates Redis Agent Memory Server as a MemoryManager type within NeMo Agent Toolkit, including configuration, client abstraction, registration, tests, and root-level workspace integration.

Changes

Cohort / File(s) Summary
License & Package Metadata
packages/nvidia_nat_agent_memory_server/LICENSE.md, packages/nvidia_nat_agent_memory_server/pyproject.toml
Added Apache License 2.0 and project build configuration (setuptools, SCM versioning, dependencies on nvidia-nat-core and agent-memory-client, entry point registration).
Package Structure & Documentation
packages/nvidia_nat_agent_memory_server/src/nat/__init__.py, packages/nvidia_nat_agent_memory_server/src/nat/plugins/__init__.py, packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/__init__.py, packages/nvidia_nat_agent_memory_server/src/nat/meta/pypi.md
Added package initialization files (with license headers) and PyPI documentation describing the subpackage as Redis Agent Memory Server integration.
Core Implementation
packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/agent_memory_editor.py, packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/memory.py, packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/register.py
Implemented AgentMemoryServerEditor (async MemoryEditor wrapping Redis client with add_items, search, remove_items methods), defined AgentMemoryServerMemoryConfig with client factory, and registered the memory type via side-effect import.
Tests
packages/nvidia_nat_agent_memory_server/tests/test_agent_memory_editor.py
Added comprehensive pytest suite covering AgentMemoryServerEditor operations: item addition with text derivation, search with user filtering and similarity scoring, item removal by ID or user forgetting, and edge cases (empty inputs, missing fields, absent methods).
Root Integration
pyproject.toml
Added agent-memory-server optional dependency extra (mapping to nvidia-nat-agent-memory-server), included it in the most aggregate, and registered the package as a workspace member under tool.uv.workspace.

Sequence Diagram

sequenceDiagram
    actor NAT as NAT Framework
    participant Builder
    participant Factory as Memory Factory
    participant Client as Agent Memory<br/>Server Client
    participant Editor as AgentMemoryServerEditor
    
    NAT->>Builder: build(AgentMemoryServerMemoryConfig)
    Builder->>Factory: call async factory
    Factory->>Client: create_memory_client(base_url,<br/>namespace)
    Client-->>Factory: client instance
    Factory->>Editor: wrap client
    Editor-->>Factory: editor instance
    Factory-->>Builder: yield editor
    Builder-->>NAT: ready
    
    rect rgba(100, 200, 100, 0.5)
    NAT->>Editor: add_items(items)
    Editor->>Client: create_long_term_memory(records)
    Client-->>Editor: success
    end
    
    rect rgba(100, 150, 200, 0.5)
    NAT->>Editor: search(query, top_k, user_id=...)
    Editor->>Client: search_long_term_memory(text,<br/>limit, filters)
    Client-->>Editor: memories (with dist)
    Editor-->>NAT: MemoryItems
    end
    
    rect rgba(200, 150, 100, 0.5)
    NAT->>Editor: remove_items(memory_id=...<br/>or user_id=...)
    Editor->>Client: delete_long_term_memory()<br/>or forget()
    Client-->>Editor: success
    end
    
    NAT->>Factory: cleanup
    Factory->>Client: close()
    Client-->>Factory: closed
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Redis Agent Memory Server as memory type' clearly and concisely summarizes the main objective of the PR.
Linked Issues check ✅ Passed All coding objectives from issue #1635 are met: Redis Agent Memory Server is added as a new memory type with AgentMemoryServerEditor and AgentMemoryServerMemoryConfig, integrated with NAT ecosystem via entry points, and tested.
Out of Scope Changes check ✅ Passed All changes are in-scope: new nvidia_nat_agent_memory_server package with memory implementation, tests, configuration, and integration with root workspace are directly aligned with adding Redis Agent Memory Server functionality.
Docstring Coverage ✅ Passed Docstring coverage is 94.74% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@dnandakumar-nv dnandakumar-nv self-requested a review March 3, 2026 18:32
@dnandakumar-nv dnandakumar-nv added feature request New feature or request non-breaking Non-breaking change labels Mar 3, 2026
dagardner-nv and others added 2 commits March 12, 2026 19:56
<!--
SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION &
AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

## ❄️ Code freeze for `develop` and `v1.5.0` release

### What does this mean?
Only critical/hotfix level issues should be merged into `develop` until
release (merging of this PR).

### What is the purpose of this PR?
- Update documentation
- Allow testing for the new release
- Enable a means to merge `develop` into `main` for the release
Signed-off-by: Anuradha Karuppiah <26330987+AnuradhaKaruppiah@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale Activity is stale; may be automatically closed without update label Apr 3, 2026
- Add package pyproject.toml, LICENSE, and LICENSE-3rd-party
- Package will provide Redis Agent Memory Server as a NAT memory type

Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
Made-with: Cursor
- Register packages/nvidia_nat_agent_memory_server in [tool.uv.workspace] members

Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
- Add nvidia-nat[agent-memory-server] extra and include in 'most' bundle

Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
- Add AgentMemoryServerEditor (add_items, search, remove_items) using agent-memory-client
- Add AgentMemoryServerMemoryConfig with base_url and default_namespace
- Register memory type via @register_memory and nat.components entry point
- Add agent-memory-client dependency and setuptools/entry-point config in pyproject.toml

Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
- Add tests/test_agent_memory_editor.py following nvidia_nat_redis structure
- Test add_items (success, empty list, conversation-derived text, skip no-text)
- Test search (success, missing user_id, empty memories)
- Test remove_items (by memory_id, by user_id, no-op when client lacks methods)
- Fix editor to import ClientMemoryRecord/MemoryTypeEnum from agent_memory_client.models
- Add nvidia-nat-agent-memory-server to tool.uv.sources (workspace = true) for resolution

Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
Made-with: Cursor
Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
ClientMemoryRecord has no metadata attribute; remove invalid assignment
to fix type error and runtime.

Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
Made-with: Cursor
…into feat/add-agent-memory-server

Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
Made-with: Cursor

# Conflicts:
#	uv.lock
…ry-server' into feat/add-agent-memory-server

Signed-off-by: Justin Cechmanek <justin.cechmanek@redis.com>
Made-with: Cursor

# Conflicts:
#	uv.lock
@justin-cechmanek justin-cechmanek marked this pull request as ready for review April 9, 2026 00:54
@justin-cechmanek justin-cechmanek requested review from a team as code owners April 9, 2026 00:54
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/register.py (1)

16-20: Narrow linter suppression to the import line only.

Line 16 and Line 17 disable checks for the entire file. Since the only lint-sensitive statement is the side-effect import on Line 20, use a targeted suppression there instead.

♻️ Proposed change
-# flake8: noqa
-# isort:skip_file
-
 # Import to register the agent_memory_server memory type with NAT.
-from . import memory
+from . import memory  # noqa: F401

As per coding guidelines: “Use ruff via ruff check --fix as configured in pyproject.toml; fix warnings unless explicitly ignored in pyproject.toml.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/register.py`
around lines 16 - 20, Remove the file-level flake8/isort suppressions and
instead apply a targeted inline suppression to the side-effect import statement
"from . import memory"; specifically delete the top "# flake8: noqa" and "#
isort:skip_file" lines and add an inline noqa (and/or isort:skip comment) on the
"from . import memory" line so only that import is ignored by linters, then run
ruff check --fix to validate no other warnings remain.
packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/memory.py (1)

39-50: Add return typing and a public docstring to the async memory factory.

Line 39 defines a public API without an explicit return type, and the function is missing a docstring.

♻️ Proposed change
+from collections.abc import AsyncIterator
+
 `@register_memory`(config_type=AgentMemoryServerMemoryConfig)
-async def agent_memory_server_memory_client(config: AgentMemoryServerMemoryConfig, builder: Builder):
+async def agent_memory_server_memory_client(
+    config: AgentMemoryServerMemoryConfig,
+    builder: Builder,
+) -> AsyncIterator[AgentMemoryServerEditor]:
+    """Create and yield an `AgentMemoryServerEditor` backed by Agent Memory Server."""
     from agent_memory_client import create_memory_client

As per coding guidelines: “All public APIs require Python 3.11+ type hints on parameters and return values” and “Provide Google-style docstrings for every public module, class, function and CLI command.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/memory.py`
around lines 39 - 50, The async factory agent_memory_server_memory_client lacks
an explicit return type and a public Google-style docstring; add a Python 3.11+
return annotation (an async generator type that yields AgentMemoryServerEditor,
e.g., AsyncGenerator[AgentMemoryServerEditor, None]) and add a top-of-function
Google-style docstring describing purpose, parameters (config:
AgentMemoryServerMemoryConfig, builder: Builder) and return value; update
imports if necessary to reference typing.AsyncGenerator and the
AgentMemoryServerEditor type for the annotation so the function signature and
docstring satisfy the public API guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/agent_memory_editor.py`:
- Around line 91-98: The code currently converts m.topics into tags using "tags
if isinstance(tags, list) else list(tags)" which will split a string into
characters; update the logic in agent_memory_editor.py around the MemoryItem
construction (the tags variable and the MemoryItem(...) call) to detect strings
and wrap them as a single-element list (e.g., if isinstance(tags, str) then
[tags]) while still converting other iterables to list and defaulting to [] when
None so topics returned as a string become a single tag instead of a character
list.

In `@packages/nvidia_nat_agent_memory_server/tests/test_agent_memory_editor.py`:
- Line 121: Remove the redundant `@pytest.mark.asyncio` decorator in
tests/test_agent_memory_editor.py: locate the test decorated with
`@pytest.mark.asyncio` (the decorator shown on line 121) and delete that decorator
so the async test relies on the repo's async test runner; ensure no other tests
in this file add `@pytest.mark.asyncio` and keep the async test function (the
function immediately following the removed decorator) unchanged.

---

Nitpick comments:
In
`@packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/memory.py`:
- Around line 39-50: The async factory agent_memory_server_memory_client lacks
an explicit return type and a public Google-style docstring; add a Python 3.11+
return annotation (an async generator type that yields AgentMemoryServerEditor,
e.g., AsyncGenerator[AgentMemoryServerEditor, None]) and add a top-of-function
Google-style docstring describing purpose, parameters (config:
AgentMemoryServerMemoryConfig, builder: Builder) and return value; update
imports if necessary to reference typing.AsyncGenerator and the
AgentMemoryServerEditor type for the annotation so the function signature and
docstring satisfy the public API guidelines.

In
`@packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/register.py`:
- Around line 16-20: Remove the file-level flake8/isort suppressions and instead
apply a targeted inline suppression to the side-effect import statement "from .
import memory"; specifically delete the top "# flake8: noqa" and "#
isort:skip_file" lines and add an inline noqa (and/or isort:skip comment) on the
"from . import memory" line so only that import is ignored by linters, then run
ruff check --fix to validate no other warnings remain.
🪄 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: Pro

Run ID: bed22676-3a0f-426d-b7a8-29fe892fc400

📥 Commits

Reviewing files that changed from the base of the PR and between 160edc6 and 39a9561.

⛔ Files ignored due to path filters (49)
  • examples/A2A/currency_agent_a2a/uv.lock is excluded by !**/*.lock
  • examples/A2A/math_assistant_a2a/uv.lock is excluded by !**/*.lock
  • examples/A2A/math_assistant_a2a_protected/uv.lock is excluded by !**/*.lock
  • examples/HITL/por_to_jiratickets/uv.lock is excluded by !**/*.lock
  • examples/HITL/simple_calculator_hitl/uv.lock is excluded by !**/*.lock
  • examples/MCP/kaggle_mcp/uv.lock is excluded by !**/*.lock
  • examples/MCP/service_account_auth_mcp/uv.lock is excluded by !**/*.lock
  • examples/MCP/simple_auth_mcp/uv.lock is excluded by !**/*.lock
  • examples/MCP/simple_calculator_fastmcp/uv.lock is excluded by !**/*.lock
  • examples/MCP/simple_calculator_fastmcp_protected/uv.lock is excluded by !**/*.lock
  • examples/MCP/simple_calculator_mcp/uv.lock is excluded by !**/*.lock
  • examples/MCP/simple_calculator_mcp_protected/uv.lock is excluded by !**/*.lock
  • examples/RAG/simple_rag/uv.lock is excluded by !**/*.lock
  • examples/advanced_agents/alert_triage_agent/uv.lock is excluded by !**/*.lock
  • examples/agents/uv.lock is excluded by !**/*.lock
  • examples/control_flow/hybrid_control_flow/uv.lock is excluded by !**/*.lock
  • examples/control_flow/parallel_executor/uv.lock is excluded by !**/*.lock
  • examples/control_flow/router_agent/uv.lock is excluded by !**/*.lock
  • examples/control_flow/sequential_executor/uv.lock is excluded by !**/*.lock
  • examples/custom_functions/automated_description_generation/uv.lock is excluded by !**/*.lock
  • examples/custom_functions/plot_charts/uv.lock is excluded by !**/*.lock
  • examples/documentation_guides/uv.lock is excluded by !**/*.lock
  • examples/documentation_guides/workflows/text_file_ingest/uv.lock is excluded by !**/*.lock
  • examples/dynamo_integration/latency_sensitivity_demo/uv.lock is excluded by !**/*.lock
  • examples/dynamo_integration/react_benchmark_agent/uv.lock is excluded by !**/*.lock
  • examples/evaluation_and_profiling/email_phishing_analyzer/uv.lock is excluded by !**/*.lock
  • examples/evaluation_and_profiling/simple_calculator_eval/uv.lock is excluded by !**/*.lock
  • examples/evaluation_and_profiling/simple_web_query_eval/uv.lock is excluded by !**/*.lock
  • examples/finetuning/dpo_tic_tac_toe/uv.lock is excluded by !**/*.lock
  • examples/finetuning/rl_with_openpipe_art/uv.lock is excluded by !**/*.lock
  • examples/frameworks/adk_demo/uv.lock is excluded by !**/*.lock
  • examples/frameworks/agno_personal_finance/uv.lock is excluded by !**/*.lock
  • examples/frameworks/haystack_deep_research_agent/uv.lock is excluded by !**/*.lock
  • examples/frameworks/multi_frameworks/uv.lock is excluded by !**/*.lock
  • examples/frameworks/nat_autogen_demo/uv.lock is excluded by !**/*.lock
  • examples/frameworks/semantic_kernel_demo/uv.lock is excluded by !**/*.lock
  • examples/frameworks/strands_demo/uv.lock is excluded by !**/*.lock
  • examples/front_ends/per_user_workflow/uv.lock is excluded by !**/*.lock
  • examples/front_ends/simple_auth/uv.lock is excluded by !**/*.lock
  • examples/front_ends/simple_calculator_custom_routes/uv.lock is excluded by !**/*.lock
  • examples/getting_started/simple_calculator/uv.lock is excluded by !**/*.lock
  • examples/getting_started/simple_web_query/uv.lock is excluded by !**/*.lock
  • examples/memory/redis/uv.lock is excluded by !**/*.lock
  • examples/notebooks/uv.lock is excluded by !**/*.lock
  • examples/object_store/user_report/uv.lock is excluded by !**/*.lock
  • examples/observability/simple_calculator_observability/uv.lock is excluded by !**/*.lock
  • examples/prompt_from_file/uv.lock is excluded by !**/*.lock
  • examples/safety_and_security/retail_agent/uv.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • packages/nvidia_nat_agent_memory_server/LICENSE.md
  • packages/nvidia_nat_agent_memory_server/pyproject.toml
  • packages/nvidia_nat_agent_memory_server/src/nat/__init__.py
  • packages/nvidia_nat_agent_memory_server/src/nat/meta/pypi.md
  • packages/nvidia_nat_agent_memory_server/src/nat/plugins/__init__.py
  • packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/__init__.py
  • packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/agent_memory_editor.py
  • packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/memory.py
  • packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/register.py
  • packages/nvidia_nat_agent_memory_server/tests/test_agent_memory_editor.py
  • pyproject.toml

Comment on lines +40 to +47
def __init__(self, client):
"""
Initialize with an agent-memory-client instance (MemoryAPIClient or similar).

Args:
client: Client from create_memory_client() or MemoryAPIClient.
"""
self._client = client
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add missing type hints on public API parameters.

client (Line 40) and **kwargs (Lines 72 and 104) are currently untyped in public methods.

Suggested change
 import logging
+from typing import Any
@@
-    def __init__(self, client):
+    def __init__(self, client: Any) -> None:
@@
-    async def search(self, query: str, top_k: int = 5, **kwargs) -> list[MemoryItem]:
+    async def search(self, query: str, top_k: int = 5, **kwargs: Any) -> list[MemoryItem]:
@@
-    async def remove_items(self, **kwargs) -> None:
+    async def remove_items(self, **kwargs: Any) -> None:

As per coding guidelines, “All public APIs require Python 3.11+ type hints on parameters and return values.”

Also applies to: 72-72, 104-104

Comment on lines +91 to +98
tags = getattr(m, "topics", None) or []
out.append(
MemoryItem(
user_id=user_id,
memory=text,
conversation=[{"role": "user", "content": text}],
tags=tags if isinstance(tags, list) else list(tags),
metadata=meta if isinstance(meta, dict) else {},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Prevent accidental character-splitting when topics are returned as a string.

If m.topics is a string, list(tags) creates a character list instead of a single tag value.

Suggested change
-            tags = getattr(m, "topics", None) or []
+            raw_tags = getattr(m, "topics", None)
+            if raw_tags is None:
+                tags = []
+            elif isinstance(raw_tags, list):
+                tags = raw_tags
+            elif isinstance(raw_tags, str):
+                tags = [raw_tags]
+            else:
+                tags = list(raw_tags)
@@
-                    tags=tags if isinstance(tags, list) else list(tags),
+                    tags=tags,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/nvidia_nat_agent_memory_server/src/nat/plugins/agent_memory_server/agent_memory_editor.py`
around lines 91 - 98, The code currently converts m.topics into tags using "tags
if isinstance(tags, list) else list(tags)" which will split a string into
characters; update the logic in agent_memory_editor.py around the MemoryItem
construction (the tags variable and the MemoryItem(...) call) to detect strings
and wrap them as a single-element list (e.g., if isinstance(tags, str) then
[tags]) while still converting other iterables to list and defaulting to [] when
None so topics returned as a string become a single tag instead of a character
list.

mock_client.create_long_term_memory.assert_not_called()


@pytest.mark.asyncio
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove redundant @pytest.mark.asyncio decorator.

Line 121 should drop the decorator to match the repo async-test convention.

Suggested change
-@pytest.mark.asyncio
 async def test_search_success(

As per coding guidelines, “Do NOT add @pytest.mark.asyncio to any test. Async tests are automatically detected and run by the async runner.”

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@pytest.mark.asyncio
async def test_search_success(
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/nvidia_nat_agent_memory_server/tests/test_agent_memory_editor.py` at
line 121, Remove the redundant `@pytest.mark.asyncio` decorator in
tests/test_agent_memory_editor.py: locate the test decorated with
`@pytest.mark.asyncio` (the decorator shown on line 121) and delete that decorator
so the async test relies on the repo's async test runner; ensure no other tests
in this file add `@pytest.mark.asyncio` and keep the async test function (the
function immediately following the removed decorator) unchanged.

@github-actions github-actions bot removed the Stale Activity is stale; may be automatically closed without update label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Redis Agent Memory Server as a memory type

5 participants