Skip to content

lesson-recall default minConfidence (0.1) + decay + auto-prune make most auto-consolidated lessons invisible, with no config override #1065

Description

@nicofirst1

On v0.9.27 our store had 439 lessons, but default memory_lesson_recall calls returned only a handful, which reads as "agentmemory has almost no lessons." Actual distribution: 438 of 439 active lessons sit at confidence 0.05-0.1, below the default recall threshold - only 1 lesson (0.2%) is visible to a default-parameter recall.

Mechanism (all verified in source):

  • mem::lesson-recall defaults minConfidence to 0.1 (src/functions/lessons.ts:101), while a second recall path defaults it to 0 (lessons.ts:157-161) - the two defaults are inconsistent.
  • Lessons decay at decayRate: 0.05, so auto-consolidated lessons drift below 0.1 and vanish from default recalls.
  • lessons.ts:242: if (lesson.confidence <= 0.1 && lesson.reinforcements === 0) deletes the lesson - so a lesson sitting at the visibility floor is also on the verge of silent deletion.
  • src/config.ts has no AGENTMEMORY_* variable for lesson confidence, decay, or minConfidence (only CONSOLIDATION_DECAY_DAYS, which is unrelated).

Ask:

  1. Align the two recall defaults (either both 0 or both 0.1).
  2. Add a config knob (e.g. AGENTMEMORY_LESSON_MIN_CONFIDENCE) or lower the recall-tool default.
  3. Surface "N lessons hidden below minConfidence" in the recall response so users know the store is not empty.

Workaround we use: pass minConfidence: 0 explicitly on every recall.

Related but distinct: #274 (lessons not created in consolidation paths), #457/#458 (context injection), #831 (qualityScore heuristics).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions