lerim icon indicating copy to clipboard operation
lerim copied to clipboard

MiniMax-M2.5 doesn't distinguish user vs assistant content in extraction

Open kargarisaac opened this issue 8 months ago • 0 comments

Problem

The extraction prompt includes "only extract what the USER decided, preferred, or learned" but MiniMax-M2.5 doesn't follow this well. It extracts assistant-generated explanations as "learnings."

Examples

From a session where the assistant explained Claude Code features:

  • "Effort levels: low, medium, high, and max (Opus 4.6 only)" — this is Claude Code documentation the assistant recited, not a user learning
  • "Claude Code effort precedence order" — same
  • "Status line customization via settings.json" — same
  • 5 near-duplicate memories about "effort level configuration" that should be 1

Context

This was discovered during the extraction quality improvement work (improved prompts with "future-self test" + DO NOT EXTRACT rules + deterministic filter). The prompt improvements helped (0-candidate sessions now exist, average dropped from 6.3 to ~4.1 candidates/session) but MiniMax-M2.5 doesn't reliably distinguish speakers.

Suggested Approaches

  1. Pre-process transcript with speaker labels: Before passing to DSPy, annotate each message with [USER] / [ASSISTANT] prefixes so the model can clearly see who said what
  2. Post-extraction filter: Check if the memory body contains phrases typical of assistant explanations (documentation-style language, feature descriptions)
  3. Use stronger model for extraction: Test with Claude Haiku or GPT-4o-mini which may follow the speaker distinction better
  4. Add few-shot examples: Use DSPy's dspy.Example mechanism to show the model what user-vs-assistant distinction looks like

Files

  • src/lerim/memory/extract_pipeline.py — MemoryExtractSignature docstring
  • src/lerim/memory/schemas.py — source_speaker field (already added)

🤖 Generated with Claude Code

kargarisaac avatar Mar 22 '26 16:03 kargarisaac