nvidia-nat-zep-cloud 1.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nat/meta/pypi.md ADDED
@@ -0,0 +1,23 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ -->
17
+
18
+ ![NVIDIA NeMo Agent Toolkit](https://media.githubusercontent.com/media/NVIDIA/NeMo-Agent-Toolkit/refs/heads/main/docs/source/_static/banner.png "NeMo Agent toolkit banner image")
19
+
20
+ # NVIDIA NeMo Agent Toolkit Subpackage
21
+ This is a subpackage for Zep memory integration in NeMo Agent toolkit.
22
+
23
+ For more information about the NVIDIA NeMo Agent toolkit, please visit the [NeMo Agent toolkit GitHub Repo](https://github.com/NVIDIA/NeMo-Agent-Toolkit).
File without changes
@@ -0,0 +1,54 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from nat.builder.builder import Builder
17
+ from nat.cli.register_workflow import register_memory
18
+ from nat.data_models.memory import MemoryBaseConfig
19
+ from nat.data_models.retry_mixin import RetryMixin
20
+ from nat.utils.exception_handlers.automatic_retries import patch_with_retry
21
+
22
+
23
+ class ZepMemoryClientConfig(MemoryBaseConfig, RetryMixin, name="zep_memory"):
24
+ base_url: str | None = None
25
+ timeout: float | None = None
26
+ follow_redirects: bool | None = None
27
+
28
+
29
+ @register_memory(config_type=ZepMemoryClientConfig)
30
+ async def zep_memory_client(config: ZepMemoryClientConfig, builder: Builder):
31
+ import os
32
+
33
+ from zep_cloud.client import AsyncZep
34
+
35
+ from nat.plugins.zep_cloud.zep_editor import ZepEditor
36
+
37
+ zep_api_key = os.environ.get("ZEP_API_KEY")
38
+
39
+ if zep_api_key is None:
40
+ raise RuntimeError("Zep API key is not set. Please specify it in the environment variable 'ZEP_API_KEY'.")
41
+
42
+ zep_client = AsyncZep(api_key=zep_api_key,
43
+ base_url=config.base_url,
44
+ timeout=config.timeout,
45
+ follow_redirects=config.follow_redirects)
46
+ memory_editor = ZepEditor(zep_client)
47
+
48
+ if isinstance(config, RetryMixin):
49
+ memory_editor = patch_with_retry(memory_editor,
50
+ retries=config.num_retries,
51
+ retry_codes=config.retry_on_status_codes,
52
+ retry_on_messages=config.retry_on_errors)
53
+
54
+ yield memory_editor
@@ -0,0 +1,22 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # pylint: disable=unused-import
17
+ # flake8: noqa
18
+ # isort:skip_file
19
+
20
+ # Import any providers which need to be automatically registered here
21
+
22
+ from . import memory
@@ -0,0 +1,105 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from __future__ import annotations
17
+
18
+ import asyncio
19
+
20
+ from zep_cloud.client import AsyncZep
21
+ from zep_cloud.types import Message
22
+
23
+ from nat.memory.interfaces import MemoryEditor
24
+ from nat.memory.models import MemoryItem
25
+
26
+
27
+ class ZepEditor(MemoryEditor):
28
+ """
29
+ Wrapper class that implements NAT interfaces for Zep Integrations Async.
30
+ """
31
+
32
+ def __init__(self, zep_client: AsyncZep):
33
+ """
34
+ Initialize class with Predefined Mem0 Client.
35
+
36
+ Args:
37
+ zep_client (AsyncZep): Async client instance.
38
+ """
39
+ self._client = zep_client
40
+
41
+ async def add_items(self, items: list[MemoryItem]) -> None:
42
+ """
43
+ Insert Multiple MemoryItems into the memory. Each MemoryItem is translated and uploaded.
44
+ """
45
+
46
+ coroutines = []
47
+
48
+ # Iteratively insert memories into Mem0
49
+ for memory_item in items:
50
+ conversation = memory_item.conversation
51
+ session_id = memory_item.user_id
52
+ messages = []
53
+ for msg in conversation:
54
+ messages.append(Message(content=msg["content"], role_type=msg["role"]))
55
+
56
+ coroutines.append(self._client.memory.add(session_id=session_id, messages=messages))
57
+
58
+ await asyncio.gather(*coroutines)
59
+
60
+ async def search(self, query: str, top_k: int = 5, **kwargs) -> list[MemoryItem]:
61
+ """
62
+ Retrieve items relevant to the given query.
63
+
64
+ Args:
65
+ query (str): The query string to match.
66
+ top_k (int): Maximum number of items to return.
67
+ **kwargs: Other keyword arguments for search.
68
+
69
+ Returns:
70
+ list[MemoryItem]: The most relevant MemoryItems for the given query.
71
+ """
72
+
73
+ session_id = kwargs.pop("user_id") # Ensure user ID is in keyword arguments
74
+ limit = top_k
75
+
76
+ search_result = await self._client.memory.search_sessions(session_ids=[session_id],
77
+ text=query,
78
+ limit=limit,
79
+ search_scope="messages",
80
+ **kwargs)
81
+
82
+ # Construct MemoryItem instances
83
+ memories = []
84
+
85
+ for res in search_result.results:
86
+ memories.append(
87
+ MemoryItem(conversation=[],
88
+ user_id=session_id,
89
+ memory=res.message.content,
90
+ metadata={
91
+ "relevance_score": res.score,
92
+ "created_at": res.message.created_at,
93
+ "updated_at": res.message.updated_at
94
+ }))
95
+
96
+ return memories
97
+
98
+ async def remove_items(self, **kwargs):
99
+
100
+ if "session_id" in kwargs:
101
+ session_id = kwargs.pop("session_id")
102
+ await self._client.memory.delete(session_id)
103
+
104
+ else:
105
+ raise ValueError("session_id not provided as part of the tool call. ")
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: nvidia-nat-zep-cloud
3
+ Version: 1.2.0
4
+ Summary: Subpackage for Zep integration in NeMo Agent toolkit
5
+ Keywords: ai,agents,memory
6
+ Classifier: Programming Language :: Python
7
+ Requires-Python: <3.13,>=3.11
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: nvidia-nat==v1.2.0
10
+ Requires-Dist: zep-cloud~=2.2.0
11
+
12
+ <!--
13
+ SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
14
+ SPDX-License-Identifier: Apache-2.0
15
+
16
+ Licensed under the Apache License, Version 2.0 (the "License");
17
+ you may not use this file except in compliance with the License.
18
+ You may obtain a copy of the License at
19
+
20
+ http://www.apache.org/licenses/LICENSE-2.0
21
+
22
+ Unless required by applicable law or agreed to in writing, software
23
+ distributed under the License is distributed on an "AS IS" BASIS,
24
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25
+ See the License for the specific language governing permissions and
26
+ limitations under the License.
27
+ -->
28
+
29
+ ![NVIDIA NeMo Agent Toolkit](https://media.githubusercontent.com/media/NVIDIA/NeMo-Agent-Toolkit/refs/heads/main/docs/source/_static/banner.png "NeMo Agent toolkit banner image")
30
+
31
+ # NVIDIA NeMo Agent Toolkit Subpackage
32
+ This is a subpackage for Zep memory integration in NeMo Agent toolkit.
33
+
34
+ For more information about the NVIDIA NeMo Agent toolkit, please visit the [NeMo Agent toolkit GitHub Repo](https://github.com/NVIDIA/NeMo-Agent-Toolkit).
@@ -0,0 +1,10 @@
1
+ nat/meta/pypi.md,sha256=BMN_V2SVyWPMymcWAX8PypnNKJphAqckAbCEqGPaN6I,1111
2
+ nat/plugins/zep_cloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ nat/plugins/zep_cloud/memory.py,sha256=WrRbHBn_bnHdDVa6hThKR5BPl0wSPOJfKXbbR_XOroM,2198
4
+ nat/plugins/zep_cloud/register.py,sha256=_ffKNKnMfkB2HzX4Nk_9EW0pwebg3GuzAE-iB-CoC3E,839
5
+ nat/plugins/zep_cloud/zep_editor.py,sha256=JrLS6S956PzR2-Jaheaq2EvDCrlYKDEc5eD1HIdzsWA,3770
6
+ nvidia_nat_zep_cloud-1.2.0.dist-info/METADATA,sha256=LoFzY1wZheIjgbiIs5xgPBfi7P49YG6FZgmTPoqRNys,1444
7
+ nvidia_nat_zep_cloud-1.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ nvidia_nat_zep_cloud-1.2.0.dist-info/entry_points.txt,sha256=r7vO0ft8P0EBtuNO3cm0nYo4FScapvptPjHwtlfnvcA,64
9
+ nvidia_nat_zep_cloud-1.2.0.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
10
+ nvidia_nat_zep_cloud-1.2.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [nat.components]
2
+ nat_zep_cloud = nat.plugins.zep_cloud.register