-
Notifications
You must be signed in to change notification settings - Fork 498
Add MemMachine memory integration for NeMo Agent toolkit #1460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Charlie-Yi-2002
wants to merge
26
commits into
NVIDIA:develop
Choose a base branch
from
Charlie-Yi-2002:develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
19f7193
Add MemMachine memory integration for NeMo Agent toolkit
Charlie-Yi-2002 07ff4df
sS
Charlie-Yi-2002 3a7c40e
Remove group_id and other unused variable references and fix error lo…
Charlie-Yi-2002 f4604a9
Merge branch 'develop' into develop
Charlie-Yi-2002 c0dfc7a
Update packages/nvidia_nat_memmachine/tests/test_add_and_retrieve.py
Charlie-Yi-2002 2cd9a7e
add return hints and fix exception handling
Charlie-Yi-2002 806013a
Merge branch 'develop' of https://github.com/Charlie-Yi-2002/NeMo-Age…
Charlie-Yi-2002 09730e1
Merge branch 'NVIDIA:develop' into develop
Charlie-Yi-2002 cd16e96
Update packages/nvidia_nat_memmachine/tests/test_memmachine_editor.py
Charlie-Yi-2002 ad52f84
add async decerator
Charlie-Yi-2002 8f797da
Merge branch 'develop' into develop
Charlie-Yi-2002 4358bd8
add license, change default port to 8095, skip tests if memmachine no…
Charlie-Yi-2002 2b1523d
Merge pull request #1 from Charlie-Yi-2002/pr-1460
Charlie-Yi-2002 4cf71de
Update packages/nvidia_nat_memmachine/tests/test_memmachine_editor.py
Charlie-Yi-2002 86da880
mark tests as async
Charlie-Yi-2002 064925f
Merge branch 'develop' of https://github.com/Charlie-Yi-2002/NeMo-Age…
Charlie-Yi-2002 3023544
rename helper function to avoid double test collection
Charlie-Yi-2002 5351e16
Update packages/nvidia_nat_memmachine/tests/test_add_and_retrieve.py
Charlie-Yi-2002 bd92150
Merge branch 'NVIDIA:develop' into develop
Charlie-Yi-2002 6f406d0
add async slow decorators and fix error handling for ModuleNotFound
Charlie-Yi-2002 504cf1c
update memmachine-server to latest 0.2.5
Charlie-Yi-2002 09960eb
clarify default port in README
Charlie-Yi-2002 8529fc0
add license header
Charlie-Yi-2002 6692f77
style fixes
Charlie-Yi-2002 a464794
Merge branch 'develop' into develop
Charlie-Yi-2002 3b2e005
change dependency to memmachine-client at 0.2.5, update docs to list …
Charlie-Yi-2002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2024-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. | ||
|
|
||
| # NVIDIA NeMo Agent Toolkit - MemMachine Integration | ||
|
|
||
| This package provides integration with MemMachine for memory management in NeMo Agent toolkit. | ||
|
|
||
| ## Overview | ||
|
|
||
| MemMachine is a unified memory management system that supports both episodic and semantic memory through a single interface. This integration allows you to use MemMachine as a memory backend for your NeMo Agent toolkit workflows. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Python 3.11+ | ||
| - **memmachine-client** is installed automatically with this package. You need a running MemMachine instance (local or hosted) to connect to. To run a local instance, install and configure **memmachine-server** separately (see [MemMachine Server Setup](#memmachine-server-setup) below). | ||
|
|
||
| ## Installation | ||
|
|
||
| Install the package: | ||
|
|
||
| ```bash | ||
| pip install nvidia-nat-memmachine | ||
| ``` | ||
|
|
||
| Or for development: | ||
|
|
||
| ```bash | ||
| uv pip install -e packages/nvidia_nat_memmachine | ||
| ``` | ||
|
|
||
| ## MemMachine Server Setup | ||
|
|
||
| This section is optional. Only follow these steps if you want to run a **local** MemMachine instance. If you use a hosted MemMachine instance, configure `base_url` (and any auth) in your workflow config and skip this section. | ||
|
|
||
| ### Step 1: Install MemMachine Server (local instance only) | ||
|
|
||
| ```bash | ||
| pip install memmachine-server | ||
| ``` | ||
|
|
||
| ### Step 2: Run the Configuration Wizard | ||
|
|
||
| Before starting the server, you need to configure MemMachine using the interactive configuration wizard: | ||
|
|
||
| ```bash | ||
| memmachine-configure | ||
| ``` | ||
|
|
||
| The wizard will guide you through setting up: | ||
|
|
||
| - **Neo4j Database**: Option to install Neo4j automatically or provide connection details for an existing instance. If you enter nothing, Neo4j is installed on your local disk by default. | ||
| - **Large Language Model (LLM) Provider**: Choose from supported providers like OpenAI, AWS Bedrock, or Ollama | ||
| - **Model Selection**: Select specific LLM and embedding models. The default is OpenAI with `gpt-4o-mini` and `text-embedding-3-small`. | ||
| - **API Keys and Credentials**: Input necessary API keys for your selected LLM provider | ||
| - **Server Settings**: Configure server host and port. The default is `localhost:8080` but it is recommended to bind to port `8095` as `8080` is a commonly used port. | ||
|
|
||
| **Note**: | ||
| - The wizard installs Neo4j and Java automatically when you choose to install Neo4j (platform-specific: Windows uses ZIP, macOS uses brew, Linux uses tar.gz) | ||
| - The wizard uses Neo4j as the vector database and SQLite as the relational database by default | ||
| - The configuration file will be generated at `<HOME>/.config/memmachine/cfg.yml` | ||
|
|
||
| ### Step 3: Start the MemMachine Server | ||
|
|
||
| After completing the configuration wizard, start the server: | ||
|
|
||
| ```bash | ||
| memmachine-server | ||
| ``` | ||
|
|
||
| The server will start on `http://localhost:8080` by default (or the port you configured with the configuration wizard). | ||
|
|
||
| For more details, see the [MemMachine Configuration Wizard Documentation](https://docs.memmachine.ai/open_source/configuration-wizard). | ||
|
|
||
| ## Usage in NeMo Agent toolkit | ||
|
|
||
| Add MemMachine memory to your workflow configuration: | ||
|
|
||
| ```yaml | ||
| memory: | ||
| memmachine_memory: | ||
| base_url: "http://localhost:8095" # MemMachine server URL | ||
| org_id: "my_org" # Optional: default organization ID | ||
| project_id: "my_project" # Optional: default project ID | ||
| ``` | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| - [MemMachine Documentation](https://docs.memmachine.ai/) | ||
| - [NeMo Agent toolkit Documentation](https://docs.nvidia.com/nemo/agent-toolkit/latest/) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.