Skip to content

feat: Evolution and learning system for Pichu #7

@jeffwweee

Description

@jeffwweee

Feature Request

Add an evolution and learning system to Pichu that can learn from sessions and evolve into better patterns.

Background

Reference: everything-claude-code (ecc) has a sophisticated learning system with:

v1: Stop Hook Learning

  • Evaluates sessions at end (10+ messages)
  • Extracts patterns: error_resolution, user_corrections, workarounds, debugging_techniques
  • Saves to ~/.claude/skills/learned/

v2: Instinct-Based Learning

  • PreToolUse/PostToolUse hooks - 100% reliable observation
  • Atomic instincts - one trigger, one action with confidence scoring (0.3-0.9)
  • Project-scoped - prevents cross-project contamination
  • Evolution path - instincts → cluster → skill/command/agent
  • Commands: /instinct-status, /evolve, /instinct-export, /instinct-import, /promote

Instinct Model

id: prefer-functional-style
trigger: "when writing new functions"
confidence: 0.7
domain: "code-style"
source: "session-observation"
scope: project

Proposed Implementation for Dev Workspace

Phase 1: Observation Layer

  • Add hooks to observe Telegram conversations
  • Capture: user corrections, successful patterns, error resolutions
  • Store observations in state/learning/observations.jsonl

Phase 2: Instinct System

  • Create instinct extraction from observations
  • Implement confidence scoring
  • Store instincts in state/learning/instincts/
  • Add domain tagging (telegram, git, debugging, workflow)

Phase 3: Evolution

  • Cluster related instincts
  • Generate skills from clusters
  • Auto-update Commander with learned behaviors
  • /evolve command via Telegram

Phase 4: Memory Integration

  • Update state/memory/knowledge/ from learned patterns
  • Persist high-confidence instincts across sessions
  • Export/import learning with other workspaces

Commands to Add

Command Description
/learn-status Show learned instincts and confidence
/evolve Cluster instincts into skills
/learn-export Export learning data
/learn-import Import learning from another workspace

Benefits

  • Pichu gets smarter over time
  • Learns user preferences automatically
  • Reduces repetitive corrections
  • Evolves with the project

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions