typedmemory

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConflictResolution

type ConflictResolution struct {
	Winner   *MemoryEntry
	Loser    *MemoryEntry
	Reason   string
	Resolved bool
}

func ResolveConflict

func ResolveConflict(existing, incoming *MemoryEntry) ConflictResolution

type MemoryEntry

type MemoryEntry struct {
	ID         string
	Type       MemoryType
	Content    string
	Confidence float64
	Durability float64
	CreatedAt  time.Time
	UpdatedAt  time.Time
	LastUsedAt time.Time
}

type MemoryType

type MemoryType string
const (
	MemoryTypeIdentity   MemoryType = "identity"
	MemoryTypePreference MemoryType = "preference"
	MemoryTypeGoal       MemoryType = "goal"
	MemoryTypeHabit      MemoryType = "habit"
	MemoryTypeEpisode    MemoryType = "episode"
	MemoryTypeReflection MemoryType = "reflection"
)

type TypedMemoryStore

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

func NewTypedMemoryStore

func NewTypedMemoryStore() *TypedMemoryStore

func (*TypedMemoryStore) Create

func (s *TypedMemoryStore) Create(entry *MemoryEntry) error

func (*TypedMemoryStore) Delete

func (s *TypedMemoryStore) Delete(id string) bool

func (*TypedMemoryStore) GetAverageConfidence

func (s *TypedMemoryStore) GetAverageConfidence(memType MemoryType) float64

func (*TypedMemoryStore) GetPruningCandidates

func (s *TypedMemoryStore) GetPruningCandidates(now time.Time) []*MemoryEntry

func (*TypedMemoryStore) GetStats

func (s *TypedMemoryStore) GetStats() map[MemoryType]int

func (*TypedMemoryStore) ListAll

func (s *TypedMemoryStore) ListAll() []*MemoryEntry

func (*TypedMemoryStore) ListByType

func (s *TypedMemoryStore) ListByType(memType MemoryType) []*MemoryEntry

func (*TypedMemoryStore) Prune

func (s *TypedMemoryStore) Prune(now time.Time) int

func (*TypedMemoryStore) Read

func (s *TypedMemoryStore) Read(id string) (*MemoryEntry, bool)

func (*TypedMemoryStore) Update

func (s *TypedMemoryStore) Update(id string, updateFn func(*MemoryEntry)) bool

func (*TypedMemoryStore) UpsertWithConflictResolution

func (s *TypedMemoryStore) UpsertWithConflictResolution(entry *MemoryEntry) ConflictResolution

Jump to

Keyboard shortcuts

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