Plug Synap into NVIDIA NeMo Agent Toolkit (NAT) as a first-classDocumentation Index
Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt
Use this file to discover all available pages before exploring further.
MemoryEditor. NAT workflows that declare a memory backend in YAML — or instantiate one programmatically — now get persistent, semantically searchable, per-user memory.
Overview
This guide shows how to add Synap to a NAT workflow to build pipelines that:- Persist
MemoryItemobjects across workflow executions - Retrieve memories via semantic search inside any NAT step
- Be declared in NAT’s YAML config without writing additional integration code
| Export | Purpose |
|---|---|
SynapMemoryEditor | Implements nat.memory.interfaces.MemoryEditor for NAT workflows |
@register_memory | Decorator that registers the editor under a YAML-referenceable name |
synap_memory_client | Factory that builds a ready-to-use SynapMemoryEditor from config |
Setup
Install the package alongside NAT:.env
synap_memory_client factory below to skip the SDK setup — it initializes Synap internally.
See SDK Initialization for the full lifecycle and configuration options.
Basic integration
The smallest useful integration constructs aSynapMemoryEditor and uses it directly:
user_id is supplied per item and per query — a single SynapMemoryEditor instance serves all users in the workflow. customer_id is set once at construction.
Core concepts
MemoryEditor interface
SynapMemoryEditor implements the full MemoryEditor protocol. NAT workflows that accept a MemoryEditor work without modification:
| Method | Behavior |
|---|---|
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 |
fast | accurate | |
|---|---|---|
| Latency | 50-100ms | 200-500ms |
| Search | Vector similarity | Vector + graph + re-ranking |
| Best for | Real-time chat | Multi-entity queries |
search and get_items return empty results and log an error on Synap outages. Writes surface failures — add_items and update_items raise SynapIntegrationError so workflows know if persistence failed.
Registration for YAML configs
NAT lets you declare memory backends in YAML. Use@register_memory to make SynapMemoryEditor resolvable by name:
type: synap to the registered class and instantiates it with the config block.
Factory function
For programmatic setups outside YAML,synap_memory_client builds a ready-to-use editor and initializes the SDK internally — no separate lifecycle to manage:
Complete example: NAT workflow with persistent memory
The pattern below sets up a workflow with Synap-backed memory at startup, ingests a batch of memories, and runs a recall query:- One editor, many users.
user_idtravels on eachMemoryItemand eachsearchcall, so the editor is shared. customer_idis the tenant boundary. All users sharing an editor are inside the samecustomer_id— build a separate editor per tenant for multi-tenant services.- Mode is fixed at construction. Set
mode="fast"for low-latency NAT steps;"accurate"for higher-recall lookups.
Advanced patterns
Multi-tenant scoping
SynapMemoryEditor takes customer_id at construction; user_id is supplied per call. customer_id is required on B2B Synap instances and ignored on single-tenant ones. See Memory Scopes.
Choosing between SDK-managed and factory-managed lifecycles
- Use
SynapMemoryEditor(sdk=...)when your application owns the SDK lifecycle (recommended for production — you control init/shutdown). - Use
synap_memory_client(api_key=...)for scripts, notebooks, or YAML-driven workflows where you’d rather not manage the SDK explicitly.
Failure semantics
The integration follows the Synap-wide contract:searchandget_itemsdegrade gracefully — return empty lists and log an error if Synap is unreachable.add_itemsandupdate_itemssurface failures — raiseSynapIntegrationErrorso the workflow and caller know persistence failed.
Next steps
Semantic Kernel
Plugin for Microsoft Semantic Kernel.
Pydantic AI
Type-safe deps and tools for Pydantic AI.
Memory Scopes
How
user_id and customer_id interact across reads and writes.Ingestion
Direct ingestion API for pipelines that need finer control than
add_items.