Skip to content

Commit 22f75e7

Browse files
Merge pull request #12 from bbednarski9/fix/issue-8-nat-plugins-entrypoint
Use nat.plugins entry point group
2 parents 0833ba1 + a45a497 commit 22f75e7

6 files changed

Lines changed: 35 additions & 7 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ AMS runs as a separate service; these surfaces talk to it via the agent-memory c
2222

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

25-
Loaded via the `nat_redis` setuptools entry point (same name as the historical
26-
monorepo package):
25+
Loaded via the `nat.plugins` setuptools entry point `nat_redis` (same name as
26+
the historical monorepo package):
2727

2828
- `_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.
2929
- `_type: redis` — NAT **object store** on plain Redis key–value storage (not semantic long-term memory).
@@ -42,7 +42,7 @@ without AMS.
4242

4343
Direct Redis support is implemented only under **`nat.plugins.redis`** (for example
4444
`from nat.plugins.redis.redis_editor import RedisEditor`), matching NeMo Agent
45-
Toolkit. The setuptools entry point **`nat_redis`** loads
45+
Toolkit. The `nat.plugins` setuptools entry point **`nat_redis`** loads
4646
`nat.plugins.redis.register`. Redis Agent Memory code lives under
4747
**`nvidia_nat_redis.redis_agent_memory`**.
4848

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Direct Redis memory provides a more standard semantic memory layer for LLM appli
1313
1. Long-term memory backend: `_type: redis_agent_memory_backend`
1414
2. Native automatic wrapper: `_type: redis_agent_memory_auto_memory`
1515

16-
**Direct Redis (entry point `nat_redis``nat.plugins.redis.register`)**
16+
**Direct Redis (`nat.plugins` entry point `nat_redis``nat.plugins.redis.register`)**
1717

1818
3. In-Redis vector memory: `_type: redis_memory`
1919
4. Object store: `_type: redis`

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ documentation = "https://github.com/redis-developer/nemo-agent-toolkit-redis/tre
4040
issues = "https://github.com/redis-developer/nemo-agent-toolkit-redis/issues"
4141
source = "https://github.com/redis-developer/nemo-agent-toolkit-redis"
4242

43-
[project.entry-points.'nat.components']
43+
[project.entry-points.'nat.plugins']
4444
nat_redis = "nat.plugins.redis.register"
4545

4646
[dependency-groups]

src/nat/plugins/redis/register.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# isort:skip_file
1818

1919
# Import any providers which need to be automatically registered here.
20-
# The ``nat.components`` entry point ``nat_redis`` targets this module.
20+
# The ``nat.plugins`` entry point ``nat_redis`` targets this module.
2121

2222
from . import memory
2323
from . import object_store

src/nvidia_nat_redis/redis_agent_memory/register.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
Load Redis Agent Memory NAT components for entry-point registration.
66
7-
Imported by ``nat.plugins.redis.register``, the ``nat.components`` entry point
7+
Imported by ``nat.plugins.redis.register``, the ``nat.plugins`` entry point
88
target (``nat_redis``). Importing this module runs the NAT registration
99
decorators for the Redis Agent Memory backend and auto-memory wrapper.
1010
"""

tests/test_entry_points.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026, Redis
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
from __future__ import annotations
5+
6+
from importlib.metadata import entry_points
7+
8+
9+
def test_nat_redis_entry_point_loads_registered_components() -> None:
10+
"""The package must expose Redis components through NAT's third-party plugin group."""
11+
from nat.cli.type_registry import GlobalTypeRegistry
12+
13+
plugins = entry_points(group="nat.plugins")
14+
redis_entry_points = [
15+
plugin for plugin in plugins if plugin.name == "nat_redis" and plugin.value == "nat.plugins.redis.register"
16+
]
17+
18+
assert redis_entry_points, "Expected nat_redis to target nat.plugins.redis.register in the nat.plugins group"
19+
20+
redis_entry_points[0].load()
21+
22+
registry = GlobalTypeRegistry.get()
23+
memory_types = {registered.local_name for registered in registry.get_registered_memorys()}
24+
object_store_types = {registered.local_name for registered in registry.get_registered_object_stores()}
25+
26+
assert "redis_memory" in memory_types
27+
assert "redis_agent_memory_backend" in memory_types
28+
assert "redis" in object_store_types

0 commit comments

Comments
 (0)