Skip to content

Function: scoreAndRecallLessons() ​

ts
function scoreAndRecallLessons(
   candidates, 
   scoring, 
   context?
): readonly LessonRecord[];

Defined in: runtime/lessons/lesson-scoring.ts:144

Scores, filters, and ranks candidate lessons for Turn-0 recall (SPEC.md §3.4.3).

Evaluates computeLessonScore for each candidate, retains lessons with score >= recall.minScore, sorts descending by score (tie-breaking by id), and slices to recall.maxItems.

Parameters ​

ParameterTypeDescription
candidatesreadonly LessonRecord[]Candidate lessons returned by LessonStore.queryCandidates().
scoringLessonScoringConfigLesson scoring and recall thresholds.
context?| readonly string[] | LessonScoreContextParamsActive partitions and partition epoch map.

Returns ​

readonly LessonRecord[]

Frozen top-$N$ recalled lessons ordered by descending score.

Released under the MIT License.