Docs /Templates/ sinapsis-mem0

Mem0ManagedAdd

sinapsis-mem0Mem0chatbotsmem0memorymemory_management

Python template · sinapsis_mem0.templates.managed.add

Overview

Template to add the current conversation turn to managed Mem0.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-mem0==1.0.0
uv pip install sinapsis-mem0==1.0.0
uv add sinapsis-mem0==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

add_args

Extra arguments passed to `mem0.MemoryClient.add`.

Mem0ManagedAddArgs
Optional
Default: null
infer

Whether Mem0 should infer memories from the messages. Defaults to `True`.

bool
Optional
Default: true
app_id

Optional app scope.

str | None
Optional
Default: null
async_mode

Whether the managed API should process the add request asynchronously. This template defaults to `False` to keep add operations synchronous unless explicitly overridden.

bool
Optional
Default: true
custom_categories

Optional custom categories used during memory extraction.

list[sinapsis_mem0.helpers.schemas.Mem0CustomCategory] | None
Optional
Default: null
custom_instructions

Optional extraction instructions forwarded to Mem0.

str | None
Optional
Default: null
custom_categories[]
object
Optional
Default: Not specified
nameRequired

Category name sent to Mem0.

str
Required
Default: null
descriptionRequired

Human-readable explanation of the category.

str
Required
Default: null
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
memory_config
Mem0ManagedMemoryConfig
Optional
Default: null
host

The host address for the memory configuration. Defaults to None.

str | None
Optional
Default: null
org_id

The organization ID associated with the memory configuration. Defaults to None.

str | None
Optional
Default: null
project_id

The project ID associated with the memory configuration. Defaults to None.

str | None
Optional
Default: null

Configuration example

Example from the Python docstring:

yaml
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: Mem0ManagedAdd
  class_name: Mem0ManagedAdd
  template_input: InputTemplate
  attributes:
    memory_config:
      host: null
      org_id: null
      project_id: null
    add_args:
      app_id: null
      infer: true
      custom_instructions: null
      custom_categories: null
      async_mode: false
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "Mem0ManagedAdd"
    class_name: "Mem0ManagedAdd"
    attributes:
      add_args:
        infer: true
        app_id: null
        async_mode: true
        custom_categories: null
        custom_instructions: null
        custom_categories[]:
          name: "<required>"
          description: "<required>"
      memory_config:
        host: null
        org_id: null
        project_id: null

Inheritance

Immediate parent: sinapsis_mem0.templates.managed.base.Mem0ManagedBase

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.