Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScoredResult ¶
type ScoredResult struct {
Memory memory.Memory `json:"memory"`
SimilarityScore float64 `json:"similarity_score"`
RecencyScore float64 `json:"recency_score"`
FrequencyScore float64 `json:"frequency_score"`
FinalScore float64 `json:"final_score"`
}
ScoredResult wraps a search result with hybrid scoring details.
type Scorer ¶
type Scorer struct {
// contains filtered or unexported fields
}
Scorer applies multi-signal ranking to search results.
func (*Scorer) Rank ¶
func (s *Scorer) Rank(results []memory.SearchResult, now time.Time) []ScoredResult
Rank takes vector search results and re-ranks them using multi-signal scoring.
func (*Scorer) SetHalfLife ¶
SetHalfLife configures the recency decay half-life in hours. After this many hours, recency score drops to 0.5.
type Weights ¶
type Weights struct {
Similarity float64 `json:"similarity" yaml:"similarity"` // vector cosine score
Recency float64 `json:"recency" yaml:"recency"` // time decay
Frequency float64 `json:"frequency" yaml:"frequency"` // access count boost
}
Weights controls the relative importance of each scoring signal.
Click to show internal directories.
Click to hide internal directories.