Thinking engine: break the rumination loop #38

Closed
opened 2026-03-14 16:49:42 +00:00 by hermes · 1 comment
Collaborator

Problem

Timmy's thinking engine generates repetitive, ungrounded thoughts that don't build on previous thinking.

Evidence from journal:

  • March 14: 14 thoughts, every one observes "still no chat messages" and "Alexander's name is in profile but pending is unchecked" — same observation 14 times
  • March 13: 3 thoughts, same themes
  • March 12: Hundreds of thoughts, devolves into "mystical forest" metaphor for pages

Root Cause

thinking.py _load_memory_context() loads MEMORY.md + soul.md each cycle but doesn't load recent journal entries or previous thoughts. The LLM has no visibility into what it already said.

Anti-loop detection checks for exact content matches but doesn't catch semantic repetition.

Acceptance Criteria

  • Thinking engine loads last 3-5 thoughts as context before generating new ones
  • Semantic dedup: if new thought >0.8 similar to any recent thought, regenerate with different seed
  • Journal shows progressive reasoning — each thought builds on or diverges from previous
  • Fact distillation filters meta-observations, only stores actionable knowledge
  • "Pending Actions" contradictions get resolved automatically

Files

  • src/timmy/thinking.py — main target

Priority: MEDIUM

Blocked by: memory consolidation

## Problem Timmy's thinking engine generates repetitive, ungrounded thoughts that don't build on previous thinking. Evidence from journal: - March 14: 14 thoughts, every one observes "still no chat messages" and "Alexander's name is in profile but pending is unchecked" — same observation 14 times - March 13: 3 thoughts, same themes - March 12: Hundreds of thoughts, devolves into "mystical forest" metaphor for pages ## Root Cause `thinking.py` `_load_memory_context()` loads MEMORY.md + soul.md each cycle but doesn't load recent journal entries or previous thoughts. The LLM has no visibility into what it already said. Anti-loop detection checks for exact content matches but doesn't catch semantic repetition. ## Acceptance Criteria - [ ] Thinking engine loads last 3-5 thoughts as context before generating new ones - [ ] Semantic dedup: if new thought >0.8 similar to any recent thought, regenerate with different seed - [ ] Journal shows progressive reasoning — each thought builds on or diverges from previous - [ ] Fact distillation filters meta-observations, only stores actionable knowledge - [ ] "Pending Actions" contradictions get resolved automatically ## Files - `src/timmy/thinking.py` — main target ## Priority: MEDIUM ## Blocked by: memory consolidation
Owner

Fixed in commit b30b5c6 (loop-cycle-6).

Changes:

  • Added _is_too_similar() using difflib.SequenceMatcher — compares new thoughts against last 5 stored thoughts
  • think_once() now retries up to 2 times with different seeds when similarity ≥ 60%
  • If all retries are repetitive, discards the thought rather than storing it
  • 7 new tests covering exact match, near match, retry, and max-retry discard

Not addressed (lower priority):

  • Semantic dedup via embeddings (SequenceMatcher is good enough for catching the obvious rumination loops)
  • Pending Actions contradiction resolution (separate issue)
  • Fact distillation filtering was already partly addressed in existing code
Fixed in commit b30b5c6 (loop-cycle-6). **Changes:** - Added `_is_too_similar()` using `difflib.SequenceMatcher` — compares new thoughts against last 5 stored thoughts - `think_once()` now retries up to 2 times with different seeds when similarity ≥ 60% - If all retries are repetitive, discards the thought rather than storing it - 7 new tests covering exact match, near match, retry, and max-retry discard **Not addressed (lower priority):** - Semantic dedup via embeddings (SequenceMatcher is good enough for catching the obvious rumination loops) - Pending Actions contradiction resolution (separate issue) - Fact distillation filtering was already partly addressed in existing code
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#38