[Automation] Self-triggering research — thinking engine → research loop #78

Closed
opened 2026-03-20 14:54:46 -04:00 by perplexity · 1 comment
Owner

Overview

Timmy should autonomously trigger deep research when his thinking engine identifies a genuine knowledge gap. Instead of waiting for a human to send research_request, the bridge monitors Timmy's thought stream and spawns research when appropriate.

Architecture

ThinkingEngine.think_once()
  → thought content analyzed
  → if knowledge gap detected + high curiosity
  → bridge.on_research_request({topic: gap, max_loops: 2})
  → research runs in background
  → results feed back into Timmy's context

Changes

server/bridge.py

New method: _evaluate_research_trigger(thought: dict) -> Optional[str]

  • Checks thought content for research-worthy patterns:
    • Explicit questions ("What is...", "How does...")
    • Knowledge gaps ("I don't know", "unclear", "need to understand")
    • Comparative analysis needs ("vs", "compare", "better than")
  • Returns research topic if triggered, None otherwise
  • Cooldown: minimum 15 minutes between auto-triggered research
  • Only triggers when energy > 0.5 and engagement != "idle"

Modify on_thought(): after bark, call _evaluate_research_trigger(). If it returns a topic, auto-dispatch on_research_request().

server/research.py

New field in ResearchConfig: auto_triggered: bool = False
New field in ResearchProgress: auto_triggered: bool = False

Auto-triggered research uses max_loops=2 (faster, lighter) vs manual max_loops=3.

Acceptance Criteria

  • Thought analysis detects research-worthy patterns
  • Auto-triggers research with appropriate topic extraction
  • 15-minute cooldown between auto-research
  • Energy/engagement gating (no research when idle/low energy)
  • Auto-triggered research marked distinctly in progress messages
  • Tests for trigger evaluation logic

Depends On

  • #73 (research engine) — merged
  • #74 (bridge handlers) — merged
## Overview Timmy should autonomously trigger deep research when his thinking engine identifies a genuine knowledge gap. Instead of waiting for a human to send `research_request`, the bridge monitors Timmy's thought stream and spawns research when appropriate. ## Architecture ``` ThinkingEngine.think_once() → thought content analyzed → if knowledge gap detected + high curiosity → bridge.on_research_request({topic: gap, max_loops: 2}) → research runs in background → results feed back into Timmy's context ``` ## Changes ### `server/bridge.py` New method: `_evaluate_research_trigger(thought: dict) -> Optional[str]` - Checks thought content for research-worthy patterns: - Explicit questions ("What is...", "How does...") - Knowledge gaps ("I don't know", "unclear", "need to understand") - Comparative analysis needs ("vs", "compare", "better than") - Returns research topic if triggered, None otherwise - Cooldown: minimum 15 minutes between auto-triggered research - Only triggers when energy > 0.5 and engagement != "idle" Modify `on_thought()`: after bark, call `_evaluate_research_trigger()`. If it returns a topic, auto-dispatch `on_research_request()`. ### `server/research.py` New field in `ResearchConfig`: `auto_triggered: bool = False` New field in `ResearchProgress`: `auto_triggered: bool = False` Auto-triggered research uses `max_loops=2` (faster, lighter) vs manual `max_loops=3`. ## Acceptance Criteria - [ ] Thought analysis detects research-worthy patterns - [ ] Auto-triggers research with appropriate topic extraction - [ ] 15-minute cooldown between auto-research - [ ] Energy/engagement gating (no research when idle/low energy) - [ ] Auto-triggered research marked distinctly in progress messages - [ ] Tests for trigger evaluation logic ## Depends On - #73 (research engine) — merged - #74 (bridge handlers) — merged
Author
Owner

Resolved in PR #81 (feat/automation-sprint). All tests passing.

Resolved in PR #81 (feat/automation-sprint). All tests passing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: perplexity/the-matrix#78