8000 feat(lessons): add dynamic experience memory system by rong-hash · Pull Request #723 · MoonshotAI/kimi-cli · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@rong-hash
Copy link
@rong-hash rong-hash commented Jan 27, 2026
  • Add lessons module with LLM-judged extraction from agent trajectories
  • Support automatic lesson creation, updating, and retirement
  • Implement score-based eviction (frequency × freshness × effectiveness × quality)
  • Add dynamic skill discovery at each step for immediate lesson availability
  • Store lessons in project directory (.kimi/skills > .agent/skills > .claude/skills)
  • Add comprehensive debug logging for lesson system tracing

Open with Devin

- Add lessons module with LLM-judged extraction from agent trajectories
- Support automatic lesson creation, updating, and retirement
- Implement score-based eviction (frequency × freshness × effectiveness × quality)
- Add dynamic skill discovery at each step for immediate lesson availability
- Store lessons in project directory (.kimi/skills > .agent/skills > .claude/skills)
- Add comprehensive debug logging for lesson system tracing
Copy link
@devin-ai-integration devin-ai-integration bot left a comment
8000

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View issue and 6 additional flags in Devin Review.

Open in Devin Review

return path, True

# Maximum number of lessons to keep
MAX_LESSONS = 20

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Config value max_lessons_per_scope is ignored - hardcoded MAX_LESSONS=20 is used instead

The LessonsConfig.max_lessons_per_scope configuration value (default 50) is defined but never used. The LessonManager class uses a hardcoded MAX_LESSONS = 20 constant instead.

Click to expand

How the bug manifests

Users can configure max_lessons_per_scope in their config expecting it to control the lesson limit:

[lessons]
max_lessons_per_scope = 100

However, the LessonManager at src/kimi_cli/lessons/manager.py:504 uses a hardcoded value:

MAX_LESSONS = 20

This constant is used in:

  • evict() method at line 522: max_count = self.MAX_LESSONS
  • should_evict() method at line 585: return self.get_lesson_count() >= self.MAX_LESSONS

The config value at src/kimi_cli/config.py:130-133 is never referenced anywhere in the codebase.

Impact

Users who configure max_lessons_per_scope will have their setting silently ignored. The system will always evict lessons when count reaches 20, regardless of the configured value of 50 (default) or any custom value.

Recommendation: Pass the max_lessons_per_scope config value to LessonManager constructor and use it instead of the hardcoded MAX_LESSONS constant. For example, modify Runtime.create() to pass config.lessons.max_lessons_per_scope when creating the LessonManager.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0