Documentation
¶
Overview ¶
Package importer bulk-loads memories exported from other memory systems (agentmemory, mem0, mnemory) or memini's own format. The local backend embeds content and writes to the store, preserving source IDs and timestamps; the remote backend POSTs to a running memini's REST API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
Importer bulk-loads records via a configured backend.
func NewRemote ¶
func NewRemote(c *RemoteClient) *Importer
NewRemote builds an Importer that POSTs records to a remote memini server.
type Options ¶
type Options struct {
// DefaultNamespace scopes records whose source carried no namespace.
DefaultNamespace string
// BatchSize bounds how many records are written per batch.
BatchSize int
}
Options tune an import run.
type Record ¶
type Record struct {
ID string
Namespace string
Tier memory.Tier
Content string
Summary string
Tags []string
Metadata map[string]any
Importance float64
CreatedAt time.Time // zero -> import time
UpdatedAt time.Time // zero -> CreatedAt
ExpiresAt *time.Time // nil -> tier default measured from CreatedAt
}
Record is the portable, source-agnostic shape every adapter produces.
type RemoteClient ¶
type RemoteClient struct {
// contains filtered or unexported fields
}
RemoteClient writes records to a running memini via its REST API (POST /v1/memories).
func NewRemoteClient ¶
func NewRemoteClient(baseURL, token, nsHeader string) *RemoteClient
NewRemoteClient targets a memini server at baseURL (e.g. https://memini.example.com), authenticating with token (optional) and scoping each record via nsHeader.
type Report ¶
type Report struct {
Total int `json:"total"`
Imported int `json:"imported"`
Skipped int `json:"skipped"` // dropped before write (empty content)
Errors []string `json:"errors,omitempty"`
}
Report summarizes an import run.
type Source ¶
type Source string
Source identifies the export format of the data being imported.
const ( // SourceMemini is memini's own export shape (a JSON array of Records). SourceMemini Source = "memini" // SourceAgentMemory is rohitg00/agentmemory's export bundle. SourceAgentMemory Source = "agentmemory" // SourceMem0 is mem0ai/mem0's get_all / export output. SourceMem0 Source = "mem0" // SourceMnemory is fpytloun/mnemory's export output. SourceMnemory Source = "mnemory" )