Skip to main content

Install

pip install synap-nemo-agent-toolkit

What’s included

ExportPurpose
SynapMemoryEditorImplements nat.memory.interfaces.MemoryEditor for NAT workflows
@register_memoryDecorator to register SynapMemoryEditor in NAT’s memory registry
synap_memory_clientFactory that creates a ready-to-use SynapMemoryEditor from config

Quick start

from synap_nemo_agent_toolkit import SynapMemoryEditor

editor = SynapMemoryEditor(
    sdk=sdk,
    customer_id="acme",   # optional
    mode="accurate",       # "fast" or "accurate"
)

# Store memories
await editor.add_items([
    MemoryItem(user_id="alice", memory="Prefers concise bullet-point summaries", tags=["preference"]),
    MemoryItem(user_id="alice", memory="Working on Q3 roadmap planning", tags=["project"]),
])

# Search memories
results = await editor.search("communication preferences", top_k=5, user_id="alice")
for item in results:
    print(item.memory, item.score)

MemoryEditor interface

SynapMemoryEditor implements the full MemoryEditor protocol:
MethodDescription
add_items(items)Batch-ingest MemoryItem objects into Synap
search(query, top_k, user_id)Semantic search, returns scored MemoryItem list
update_items(items)Update existing memories by ID
get_items(user_id, limit)Retrieve all memories for a user

YAML configuration

NAT supports declaring memory backends in YAML pipeline configs. Register SynapMemoryEditor with the @register_memory decorator:
from synap_nemo_agent_toolkit import register_memory

@register_memory("synap")
class SynapMemoryEditor(SynapMemoryEditor):
    pass
Then reference it in your NAT YAML:
memory:
  type: synap
  config:
    instance_id: ${SYNAP_INSTANCE_ID}
    api_key: ${SYNAP_API_KEY}
    mode: accurate
    customer_id: acme

Factory function

For programmatic setup outside of YAML:
from synap_nemo_agent_toolkit import synap_memory_client

editor = synap_memory_client(
    instance_id=os.environ["SYNAP_INSTANCE_ID"],
    api_key=os.environ["SYNAP_API_KEY"],
    customer_id="acme",
    mode="accurate",
)
synap_memory_client initializes the SDK internally, so you don’t need to manage the SDK lifecycle separately.

Next steps

Semantic Kernel

Plugin for Microsoft Semantic Kernel.

Pydantic AI

Type-safe deps and tools for Pydantic AI.