models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ValidMemoryTypes is the set of all valid memory types.

Functions

This section is empty.

Types

type CapturedMemory

type CapturedMemory struct {
	Content    string     `json:"content"`
	Type       MemoryType `json:"type"`
	Confidence float64    `json:"confidence"`
	Tags       []string   `json:"tags"`
}

CapturedMemory is a memory extracted from a conversation by the LLM.

type CollectionStats

type CollectionStats struct {
	TotalMemories int64            `json:"total_memories"`
	ByType        map[string]int64 `json:"by_type"`
	ByScope       map[string]int64 `json:"by_scope"`
	OldestMemory  time.Time        `json:"oldest_memory"`
	NewestMemory  time.Time        `json:"newest_memory"`
}

CollectionStats holds summary statistics about the memory collection.

type Memory

type Memory struct {
	ID           string           `json:"id"`
	Type         MemoryType       `json:"type"`
	Scope        MemoryScope      `json:"scope"`
	Visibility   MemoryVisibility `json:"visibility"`
	Content      string           `json:"content"`
	Confidence   float64          `json:"confidence"`
	Source       string           `json:"source"`
	Tags         []string         `json:"tags"`
	Project      string           `json:"project,omitempty"`
	TTLSeconds   int64            `json:"ttl_seconds,omitempty"`
	CreatedAt    time.Time        `json:"created_at"`
	UpdatedAt    time.Time        `json:"updated_at"`
	LastAccessed time.Time        `json:"last_accessed"`
	AccessCount  int64            `json:"access_count"`
	Metadata     map[string]any   `json:"metadata,omitempty"`
}

Memory is the core data structure for a stored memory.

type MemoryScope

type MemoryScope string

MemoryScope defines the persistence scope of a memory.

const (
	ScopePermanent MemoryScope = "permanent"
	ScopeProject   MemoryScope = "project"
	ScopeSession   MemoryScope = "session"
	ScopeTTL       MemoryScope = "ttl"
)

type MemoryType

type MemoryType string

MemoryType classifies the kind of memory.

const (
	MemoryTypeRule       MemoryType = "rule"
	MemoryTypeFact       MemoryType = "fact"
	MemoryTypeEpisode    MemoryType = "episode"
	MemoryTypeProcedure  MemoryType = "procedure"
	MemoryTypePreference MemoryType = "preference"
)

func (MemoryType) IsValid

func (mt MemoryType) IsValid() bool

IsValid returns true if the memory type is recognized.

type MemoryVisibility

type MemoryVisibility string

MemoryVisibility controls access to a memory.

const (
	VisibilityPrivate   MemoryVisibility = "private"
	VisibilityShared    MemoryVisibility = "shared"
	VisibilitySensitive MemoryVisibility = "sensitive"
)

type RecallResult

type RecallResult struct {
	Memory          Memory  `json:"memory"`
	SimilarityScore float64 `json:"similarity_score"`
	RecencyScore    float64 `json:"recency_score"`
	FrequencyScore  float64 `json:"frequency_score"`
	TypeBoost       float64 `json:"type_boost"`
	ScopeBoost      float64 `json:"scope_boost"`
	FinalScore      float64 `json:"final_score"`
}

RecallResult wraps a Memory with multi-factor ranking details.

type SearchResult

type SearchResult struct {
	Memory Memory  `json:"memory"`
	Score  float64 `json:"score"`
}

SearchResult wraps a Memory with its similarity score.

Jump to

Keyboard shortcuts

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