Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidMemoryTypes = []MemoryType{ MemoryTypeRule, MemoryTypeFact, MemoryTypeEpisode, MemoryTypeProcedure, MemoryTypePreference, }
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" 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 ¶
SearchResult wraps a Memory with its similarity score.
Click to show internal directories.
Click to hide internal directories.