Documentation
¶
Index ¶
- Constants
- func DefaultDecayCurve(createdAt time.Time, now time.Time) float64
- func MemoryEntryRelevance(entry Entry, query string) float64
- type Entry
- type RetentionAction
- type RetentionCandidate
- type RetentionPolicy
- type ScoredEntry
- type Scorer
- func (s *Scorer) EffectiveImportance(entry Entry, now time.Time) float64
- func (s *Scorer) Rank(entries []Entry, relevanceByID map[string]float64, now time.Time) []ScoredEntry
- func (s *Scorer) RankByQuery(entries []Entry, query string, now time.Time) []ScoredEntry
- func (s *Scorer) ReviewRetentionCandidates(entries []Entry, policy RetentionPolicy) []RetentionCandidate
- func (s *Scorer) Score(entry Entry, relevanceScore float64, now time.Time) float64
Constants ¶
View Source
const DefaultDecayHalfLife = 30 * 24 * time.Hour // 30 days
Variables ¶
This section is empty.
Functions ¶
func MemoryEntryRelevance ¶
Types ¶
type Entry ¶
type Entry struct {
ID string `json:"id"`
Content string `json:"content"`
Tags []string `json:"tags"`
Importance float64 `json:"importance"`
SessionID string `json:"session_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Metadata map[string]string `json:"metadata,omitempty"`
}
Entry is the scoring input shape for agent-managed memory.
type RetentionAction ¶
type RetentionAction string
const ( RetentionActionSummarize RetentionAction = "summarize" RetentionActionForget RetentionAction = "forget" )
type RetentionCandidate ¶
type RetentionPolicy ¶
type ScoredEntry ¶
type Scorer ¶
type Scorer struct {
// contains filtered or unexported fields
}
func (*Scorer) EffectiveImportance ¶
func (*Scorer) RankByQuery ¶
func (*Scorer) ReviewRetentionCandidates ¶
func (s *Scorer) ReviewRetentionCandidates(entries []Entry, policy RetentionPolicy) []RetentionCandidate
Click to show internal directories.
Click to hide internal directories.