Metadata-Version: 2.4
Name: sinapsis-mem0
Version: 0.2.0
Summary: Sinapsis templates for Mem0 memory management.
Author-email: SinapsisAI <dev@sinapsis.tech>
Project-URL: Homepage, https://sinapsis.tech
Project-URL: Documentation, https://docs.sinapsis.tech/docs
Project-URL: Tutorials, https://docs.sinapsis.tech/tutorials
Project-URL: Repository, https://github.com/Sinapsis-AI/sinapsis-chatbots.git
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mem0ai>=1.0.0
Requires-Dist: sinapsis>=0.2.26
Requires-Dist: sinapsis-chatbots-base
Dynamic: license-file

<h1 align="center">
<br>
<a href="https://sinapsis.tech/">
  <img
    src="https://github.com/Sinapsis-AI/brand-resources/blob/main/sinapsis_logo/4x/logo.png?raw=true"
    alt="" width="300">
</a>
<br>
Sinapsis Mem0
<br>
</h1>

<h4 align="center">Sinapsis templates for managed and self-hosted Mem0 memory workflows.</h4>

<p align="center">
<a href="#installation">🐍 Installation</a> •
<a href="#features">🚀 Features</a> •
<a href="#example">📚 Usage example</a> •
<a href="#documentation">📙 Documentation</a> •
<a href="#license">🔍 License</a>
</p>

The `sinapsis-mem0` package adds persistent memory workflows to Sinapsis agents through both the managed Mem0 platform and the open-source self-hosted backend.

<h2 id="installation">🐍 Installation</h2>

Install using your preferred package manager. We strongly recommend using <code>uv</code>.

```bash
uv pip install sinapsis-mem0 --extra-index-url https://pypi.sinapsis.tech
```

Or with raw <code>pip</code>:

```bash
pip install sinapsis-mem0 --extra-index-url https://pypi.sinapsis.tech
```

> [!IMPORTANT]
> Managed Mem0 templates require an API key:
>
> ```bash
> export MEM0_API_KEY="your-api-key"
> ```

<h2 id="features">🚀 Features</h2>

<h3>Templates Supported</h3>

- **Managed Mem0 templates**: `Mem0ManagedAdd`, `Mem0ManagedGetAll`, `Mem0ManagedGetMemory`,
  `Mem0ManagedSearch`, `Mem0ManagedDeleteAll`, `Mem0ManagedDeleteMemory`, `Mem0ManagedReset`
- **OSS Mem0 templates**: `Mem0OSSAdd`, `Mem0OSSGetAll`, `Mem0OSSGetMemory`, `Mem0OSSSearch`,
  `Mem0OSSDeleteAll`, `Mem0OSSDeleteMemory`, `Mem0OSSReset`

<details>
<summary><strong><span style="font-size: 1.25em;">🌍 Managed Templates</span></strong></summary>

- Managed templates use the Mem0 platform through `MemoryClient`.
- `memory_config` can include values such as `host`, `org_id`, and `project_id`.
- Operation-specific arguments are passed through `add_args`, `get_args`, `search_args`, or `delete_args`
  depending on the selected template.
- `Mem0ManagedDeleteAll` uses only the configured `delete_args` scope; it does not derive scope from packet identity.

</details>

<details>
<summary><strong><span style="font-size: 1.25em;">🧱 OSS Templates</span></strong></summary>

- OSS templates use the self-hosted Mem0 backend through `Memory`.
- `memory_config` is used to configure the local backend.
- The same operation families are available: add, get, search, delete, and reset.
- `Mem0OSSDeleteAll` uses only the configured `delete_args` scope; it does not derive scope from packet identity.

</details>

> [!TIP]
> Use CLI command ``` sinapsis info --all-template-names``` to show a list with all the available Template names installed with Sinapsis Mem0.

<h2 id="example">📚 Usage example</h2>

The following agent retrieves all memories for the given `user_id` and `run_id` from the managed Mem0 platform.

<details id='usage'><summary><strong><span style="font-size: 1.0em;"> Config</span></strong></summary>

```yaml
agent:
  name: mem0_managed_get_all_memories
  description: Retrieves all scoped memories from managed Mem0.

templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}

  - template_name: Mem0ManagedGetAll
    class_name: Mem0ManagedGetAll
    template_input: InputTemplate
    attributes:
      get_args:
        user_id: Sarah
        run_id: conv_1234
```

</details>

<h2 id="documentation">📙 Documentation</h2>

Documentation for this and other sinapsis packages is available on the [sinapsis website](https://docs.sinapsis.tech/docs)

Tutorials for different projects within sinapsis are available at [sinapsis tutorials page](https://docs.sinapsis.tech/tutorials)

<h2 id="license">🔍 License</h2>

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the [LICENSE](LICENSE) file.

For commercial use, please refer to our [official Sinapsis website](https://sinapsis.tech) for information on obtaining a commercial license.
