omnimemory

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package omnimemory provides a mem0 provider for omnimemory.

This package implements the omnimemory Provider interface using the mem0 API as the backend. It maps omnimemory concepts to mem0:

  • TenantID → mem0 app_id (or ignored if single-tenant)
  • SubjectID → mem0 user_id
  • Memory → mem0 MemoryItem
  • Memory.AgentID → mem0 agent_id
  • Search/Recall → mem0 Search API

Usage

Import this package to register the mem0 provider:

import (
    "github.com/plexusone/omnimemory"
    "github.com/plexusone/omnimemory/core"
    _ "github.com/plexusone/mem0-go/omnimemory" // Register mem0 provider
)

func main() {
    client, err := omnimemory.NewClient(core.ClientConfig{
        Providers: []core.ProviderConfig{
            {
                Name:   core.ProviderNameMem0,
                APIKey: "your-mem0-api-key",
            },
        },
    })
    // ...
}

Configuration

The provider accepts the following options:

  • api_key: mem0 API key (required, or use MEM0_API_KEY env)
  • base_url: Custom base URL (optional, defaults to api.mem0.ai)

Mapping

mem0 uses a flat structure with user_id for isolation:

  • user_id: The subject that owns the memories (maps to SubjectID)
  • agent_id: The agent that created the memory (maps to AgentID)
  • app_id: Application identifier (maps to TenantID)

The SubjectID in omnimemory is mapped to mem0's user_id. The TenantID is mapped to mem0's app_id for multi-tenant isolation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(config core.ProviderConfig, embedder core.Embedder) (core.Provider, error)

NewProvider creates a new mem0 Provider.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements core.Provider using mem0 API.

func (*Provider) Add

func (p *Provider) Add(ctx context.Context, req *core.AddRequest) (*core.Memory, error)

Add adds a new memory to mem0.

func (*Provider) Close

func (p *Provider) Close() error

Close closes the provider.

func (*Provider) Delete

func (p *Provider) Delete(ctx context.Context, req *core.DeleteRequest) error

Delete deletes a memory by ID.

func (*Provider) Get

func (p *Provider) Get(ctx context.Context, req *core.GetRequest) (*core.Memory, error)

Get retrieves a memory by ID.

func (*Provider) List

func (p *Provider) List(ctx context.Context, req *core.ListRequest) (*core.ListResponse, error)

List lists memories with optional filters.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

func (*Provider) Recall

Recall retrieves relevant memories using mem0 Search API.

func (*Provider) Search

Search performs semantic search using mem0 Search API.

func (*Provider) Update

func (p *Provider) Update(ctx context.Context, req *core.UpdateRequest) (*core.Memory, error)

Update updates an existing memory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL