Docs /Templates/ sinapsis-mem0

Mem0OSSAdd

sinapsis-mem0Mem0chatbotsmem0memorymemory_management

Python template · sinapsis_mem0.templates.oss.add

Overview

Template to add the current conversation turn to OSS 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.Memory.add`.

Mem0OSSAddArgs
Optional
Default: null
infer

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

bool
Optional
Default: true
prompt

Optional prompt used by Mem0 during extraction.

str | None
Optional
Default: null
memory_type

Optional Mem0 memory type.

str | None
Optional
Default: null
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
memory_config
MemoryConfig
Optional
Default: null
llm

Configuration for the language model

LlmConfig
Optional
Default: null
config

Configuration for the specific LLM

typing.Optional[dict]
Optional
Default: {}
provider

Provider of the LLM (e.g., 'ollama', 'openai')

str
Optional
Default: "openai"
version

The version of the API

str
Optional
Default: "v1.1"
embedder

Configuration for the embedding model

EmbedderConfig
Optional
Default: null
config

Configuration for the specific embedding model

typing.Optional[dict]
Optional
Default: {}
provider

Provider of the embedding model (e.g., 'ollama', 'openai')

str
Optional
Default: "openai"
reranker

Configuration for the reranker

typing.Optional[mem0.configs.rerankers.config.RerankerConfig]
Optional
Default: null
config

Provider-specific reranker configuration

typing.Optional[dict]
Optional
Default: null
provider

Reranker provider (e.g., 'cohere', 'sentence_transformer')

str
Optional
Default: "cohere"
vector_store

Configuration for the vector store

VectorStoreConfig
Optional
Default: null
config

Configuration for the specific vector store

typing.Optional[typing.Dict]
Optional
Default: null
provider

Provider of the vector store (e.g., 'qdrant', 'chroma', 'upstash_vector')

str
Optional
Default: "qdrant"
history_db_path

Path to the history database

str
Optional
Default: "/home/ariel/.mem0/history.db"
custom_instructions

Custom instructions for fact extraction

typing.Optional[str]
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: Mem0OSSAdd
  class_name: Mem0OSSAdd
  template_input: InputTemplate
  attributes:
    memory_config:
      vector_store:
        provider: qdrant
        config: null
      llm:
        provider: openai
        config: {}
      embedder:
        provider: openai
        config: {}
      history_db_path: /path/to/.mem0/history.db
      graph_store:
        provider: neo4j
        config:
        url: null
        username: null
        password: null
        database: null
        base_label: null
        llm: null
        custom_prompt: null
      version: v1.1
      custom_fact_extraction_prompt: null
      custom_update_memory_prompt: null
    add_args:
      infer: true
      memory_type: null
      prompt: null
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "Mem0OSSAdd"
    class_name: "Mem0OSSAdd"
    attributes:
      add_args:
        infer: true
        prompt: null
        memory_type: null
      memory_config:
        llm:
          config: {}
          provider: "openai"
        version: "v1.1"
        embedder:
          config: {}
          provider: "openai"
        reranker:
          config: null
          provider: "cohere"
        vector_store:
          config: null
          provider: "qdrant"
        history_db_path: "/home/ariel/.mem0/history.db"
        custom_instructions: null

Inheritance

Immediate parent: sinapsis_mem0.templates.oss.base.Mem0OSSBase

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.