Skip to main content

NeMo Agent Toolkit Memanto Plugin

Long-term memory for NVIDIA NeMo Agent Toolkit workflows, backed by Memanto.

The plugin registers a memory backend with _type: memanto. It works with the toolkit's built-in memory tools (add_memory, get_memory, delete_memory) and with the automatic memory wrapper (auto_memory_agent).

How it stores memory

  • One Memanto agent per user. Each user_id maps to its own agent, <agent_prefix>_<first 32 hex characters of sha256(user_id)>. Users are isolated by namespace, and user ids never appear in agent names.
  • Explicit memories are stored as written. When a MemoryItem has memory text, as the add_memory tool usually produces, that text is stored with the item's tags.
  • Conversations are distilled. When an item has only a conversation, as the automatic memory wrapper produces, Memanto extracts the durable facts, preferences and decisions in it and stores those as typed memories. Small talk stores nothing.
  • Reads never create agents. Searching or deleting for a user with no memories returns nothing and creates nothing.

MemoryItem.metadata is not stored. Search results carry each memory's id, type, title, confidence, provenance, source and timestamps in metadata, and its relevance in similarity_score, where higher is more similar.

Install

uv add nemo-agent-toolkit-memanto

or:

pip install nemo-agent-toolkit-memanto

The package must be installed in the same Python environment as nvidia-nat-core. Confirm the toolkit discovers it:

nat info components -t memory -q memanto

Credentials

Set your Moorcheh API key, from console.moorcheh.ai:

export MOORCHEH_API_KEY=...

If it is not set, the key saved by memanto setup is used. The on-prem backend needs no key.

Configuration

memory:
  user_memory:
    _type: memanto
Field Default Description
api_key MOORCHEH_API_KEY Moorcheh API key.
agent_prefix nat Prefix of the per-user agent ids, matching [A-Za-z0-9_-]{1,32}. Use a different prefix for each application so they never share memories.
max_memories 20 Maximum memories extracted from one conversation, from 1 to 100.

Automatic memory

The wrapper saves every user message, recalls relevant memories before the inner agent answers, and saves the agent's replies. The user identity comes from the toolkit runtime.

memory:
  user_memory:
    _type: memanto

llms:
  nim_llm:
    _type: nim
    model_name: meta/llama-3.3-70b-instruct

functions:
  current_datetime:
    _type: current_datetime
  my_react_agent:
    _type: react_agent
    llm_name: nim_llm
    tool_names: [current_datetime]

workflow:
  _type: auto_memory_agent
  description: Assistant that remembers each user
  inner_agent_name: my_react_agent
  memory_name: user_memory
  llm_name: nim_llm
  search_params:
    top_k: 5

Automatic memory needs the LangChain integration, nvidia-nat-langchain. This example is in examples/auto_memory.yml; it uses an NVIDIA NIM model, so set NVIDIA_API_KEY as well:

nat run --config_file examples/auto_memory.yml --input "I'm vegetarian and I live in Toronto."
nat run --config_file examples/auto_memory.yml --input "Suggest a restaurant for me."

Memory tools

memory:
  user_memory:
    _type: memanto

functions:
  add_memory:
    _type: add_memory
    memory: user_memory
    user_id: alex
  get_memory:
    _type: get_memory
    memory: user_memory
    user_id: alex
  delete_memory:
    _type: delete_memory
    memory: user_memory
    user_id: alex

A fixed user_id suits a single-user deployment. For multiple authenticated users, set a trusted user_id_resolver instead, as described in the toolkit's guide to authenticating memory tool users.

Tool-level user_id and user_id_resolver need NeMo Agent Toolkit 1.9 or later. On 1.8, leave them out: the agent passes user_id in each tool call.

Backend API

MemoryEditor call Memanto operation
add_items(items) remember for items with memory; conversation extraction for items with only conversation
search(query, top_k, user_id=...) recall. Also accepts the Memanto filters type, tags and min_similarity, for example through search_params
remove_items(user_id=...) Deletes the user's agent and all of its memories
remove_items(user_id=..., memory_id=...) Deletes one memory

MemantoEditor.agent_id_for(user_id) returns the agent that holds a user's memories, so you can inspect them with the memanto CLI or UI:

from nemo_agent_toolkit_memanto.memanto_editor import MemantoEditor

print(MemantoEditor(agent_prefix="nat").agent_id_for("alex"))

Supported versions

Package Versions
NeMo Agent Toolkit (nvidia-nat-core) 1.8, 1.9
Python 3.11, 3.12, 3.13
Memanto 0.2.28 or later

Development

uv sync --extra test
uv run pytest

The integration tests call the live Memanto backend, including a full auto_memory_agent workflow with two users. They need MOORCHEH_API_KEY and the toolkit's --run_integration flag:

MOORCHEH_API_KEY=... uv run pytest --run_integration -m integration

Each run uses a random agent prefix and deletes the agents it creates.

Reporting bugs

License

Apache-2.0. See LICENSE.

Metadata

Release files for nemo-agent-toolkit-memanto 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nemo-agent-toolkit-memanto 0.2.0
File Size Uploaded Provenance Actions
nemo_agent_toolkit_memanto-0.2.0.tar.gz 170.0 kB Without provenance Details for nemo_agent_toolkit_memanto-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nemo-agent-toolkit-memanto 0.2.0
File Interpreter ABI Platform Actions
nemo_agent_toolkit_memanto-0.2.0-py3-none-any.whl Python 3 none any Details for nemo_agent_toolkit_memanto-0.2.0-py3-none-any.whl

Total release size: 181.8 kB

Release files / nemo_agent_toolkit_memanto-0.2.0.tar.gz

Download URL nemo_agent_toolkit_memanto-0.2.0.tar.gz
Size 170.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3caba935b157d685d46f6d26bdd06c9fe13664a11681cf3d76b26aa082de6e9c
BLAKE2b-256 checksum
How to use checksums
8cf72ab607b72ccd7dcb088f681a6042079b623cc1ec85a66bc31e6fc3f2b1a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / nemo_agent_toolkit_memanto-0.2.0-py3-none-any.whl

Download URL nemo_agent_toolkit_memanto-0.2.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b82e6f1013b35d1ac0bde636d59187b594720449a3ff15e7b328535c6f171ea8
BLAKE2b-256 checksum
How to use checksums
58f78edba98ab687114d0213c864767bd7a564a08fe884183d17669f7229f1fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for nemo-agent-toolkit-memanto 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page