bluememo

Judge

Decides how a new sentence relates to the memories already held.

type Judge interface {
	Judge(ctx context.Context, proposition string, candidates []string) (Judgement, error)
}

DistributionJudge is the implementation bluememo ships. It asks up to three closed questions through a Chooser and reads the probability of each single-digit answer: how much the sentence is worth (1 to 5), how it relates to the candidates, and which candidate that is. A rating of 1 is noise and the sentence is dropped. The relation is only asked when there are candidates. When the leading answer is not ahead of the runner-up by 0.10, or by 0.25 for same, the verdict falls back to unrelated, which keeps both sentences. Keeping two sentences apart can be fixed later; merging them loses one.

type Chooser interface {
	Choose(ctx context.Context, request ChoiceRequest) (map[string]float64, error)
}

A host that already has a decision model returning answer probabilities adapts it to Chooser in a few lines. ollama.Client implements it with the log probabilities Ollama returns.