Docs /Templates/ sinapsis-mem0

Mem0ManagedSearch

sinapsis-mem0Mem0chatbotsmem0memorymemory_management

Python template · sinapsis_mem0.templates.managed.search

Overview

Template to search managed Mem0 using the packet query.

Template attributes take precedence over packet identity when both are present. Packet-derived `agent_id` is intentionally excluded from the managed identity merge because Mem0 managed scopes stored memories by `user_id` and `run_id` in the tested flows.

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.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
search_args

Search parameters passed to the managed client. Template attributes take precedence over packet identity when both are present.

Mem0ManagedSearchArgs
Optional
Default: null
top_k

Optional maximum number of search results.

int | None
Optional
Default: null
app_id

Optional app scope.

str | None
Optional
Default: null
fields

Optional fields to include in the response.

list[str] | None
Optional
Default: null
rerank

Whether Mem0 should rerank the returned memories.

bool | None
Optional
Default: null
filters

Optional Mem0 v2 filters. Packet identity is translated into this structure automatically.

dict[str, typing.Any] | None
Optional
Default: null
threshold

Optional minimum similarity score.

float | None
Optional
Default: null
keyword_search

Whether Mem0 should enable keyword search.

bool | None
Optional
Default: null
filter_memories

Whether Mem0 should apply memory-side filtering before ranking.

bool | 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: Mem0ManagedSearch
  class_name: Mem0ManagedSearch
  template_input: InputTemplate
  attributes:
    memory_config:
      host: null
      org_id: null
      project_id: null
    search_args:
      app_id: null
      filters: null
      top_k: null
      threshold: null
      fields: null
      rerank: null
      keyword_search: null
      filter_memories: null
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "Mem0ManagedSearch"
    class_name: "Mem0ManagedSearch"
    attributes:
      search_args:
        top_k: null
        app_id: null
        fields: null
        rerank: null
        filters: null
        threshold: null
        keyword_search: null
        filter_memories: null
      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.