Documentation
¶
Overview ¶
Package memory defines memini's core domain types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeContent ¶
NormalizeContent collapses whitespace and case so trivially-duplicated memories compare equal. Used by recall dedup and the fsck duplicate audit.
Types ¶
type Memory ¶
type Memory struct {
ID string `json:"id"`
Namespace string `json:"namespace"`
Tier Tier `json:"tier"`
Content string `json:"content"`
Summary string `json:"summary,omitempty"`
// Metadata is arbitrary structured data, persisted as JSON.
Metadata map[string]any `json:"metadata,omitempty"`
// Tags are free-form labels used for keyword retrieval and filtering.
Tags []string `json:"tags,omitempty"`
// Importance biases decay and ranking; higher survives longer. Range [0,1].
Importance float64 `json:"importance"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LastAccessedAt time.Time `json:"last_accessed_at"`
AccessCount int `json:"access_count"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
// SupersededBy points at the memory that replaced this one during
// contradiction resolution; non-nil means this record is tombstoned.
SupersededBy *string `json:"superseded_by,omitempty"`
// Embedding is the dense vector for similarity search. It is required when
// writing to the store and is omitted from API responses.
Embedding []float32 `json:"-"`
}
Memory is a single stored memory, scoped to a namespace (tenant/agent).
type Term ¶
type Term string
Term is the coarse memory horizon: short-term memories are transient and TTL'd; long-term memories are durable and curated.
type Tier ¶
type Tier string
Tier classifies a memory by how consolidated it is: working → episodic → semantic, with procedural held separately for how-to knowledge.
const ( // TierWorking holds raw, short-lived observations (typically session-scoped). TierWorking Tier = "working" // TierEpisodic holds summaries of what happened in a session. TierEpisodic Tier = "episodic" // TierSemantic holds durable extracted facts ("what I know"). TierSemantic Tier = "semantic" // TierProcedural holds workflows and how-to knowledge. TierProcedural Tier = "procedural" )
func (Tier) DefaultTTL ¶
DefaultTTL is the TTL for a tier; zero means never expires.
Click to show internal directories.
Click to hide internal directories.