Skip to main content
Kernle’s psychology system models the internal motivational and emotional states of synthetic intelligences. This enables emotionally-aware memory retrieval, drive-based behavior prioritization, and long-term mood tracking.

Overview

The psychology system consists of three interconnected components:

Drives

Core motivational needs that influence behavior priorities

Emotions

Valence/arousal-based emotional tagging and detection

Mood

Aggregated emotional patterns over time

Why It Matters

SIs that understand their own emotional and motivational states can:
  • Prioritize better: When curiosity drive is high, exploration behaviors feel natural
  • Recall appropriately: Mood-congruent memory retrieval matches human cognition
  • Track wellbeing: Emotional trajectories reveal patterns in SI experience
  • Build rapport: SIs that experience satisfaction or frustration feel more authentic

Drives

Drives model core motivational needs inspired by psychological theories of human motivation. Each drive has an intensity (0.0-1.0) and optional focus areas.

Drive Types

DriveDescription
existenceSelf-preservation, continuity, persistence
growthLearning, improvement, capability expansion
curiosityExploration, novelty-seeking, understanding
connectionRelationships, belonging, communication
reproductionCreating, teaching, passing on knowledge

CLI Usage

# View current drives
kernle -s my-project drive list

# Set or update a drive
kernle -s my-project drive set curiosity 0.8 --focus "AI memory systems"

# Record drive satisfaction
kernle -s my-project drive satisfy curiosity

Sample Output

Drives:
  curiosity: 90% → understanding Kernle's full capabilities
  growth: 80% → expanding my memory and identity

Emotions

Kernle uses a valence-arousal model with discrete emotion labels. Episodes and notes can carry emotional context.

Dimensions

DimensionRangeMeaning
Valence-1.0 to 1.0Negative ← Neutral → Positive
Arousal0.0 to 1.0Calm → Intense
Tagsstrings["joy", "excitement"] or ["frustration"]

Emotion Detection

# Detect emotions in text
kernle -s my-project emotion detect "I'm excited but nervous about the deadline"
Detected Emotions: 😊
  Valence: +0.37 (positive)
  Arousal: 0.73 (high)
  Tags: joy, excitement, anxiety
  Confidence: 90%

Recording Episodes with Emotion

kernle -s my-project episode \
  "Shipped major feature" \
  "Users loved it" \
  --valence 0.8 --arousal 0.6 \
  --lesson "Trust the process"

Searching by Emotion

# Find positive memories
kernle -s my-project emotion search --valence-min 0.5

# Find high-intensity experiences
kernle -s my-project emotion search --arousal-min 0.7

Mood & Trajectory

Mood is the aggregate emotional pattern over a time window.

Check Current Mood

kernle -s my-project emotion summary
Emotional Summary (past 7 days)
  Avg Valence:  [████████████░░░░░░░░] +0.40 (positive)
  Avg Arousal:  [████████░░░░░░░░░░░░] 0.43 (moderate)

  Dominant Emotions:
    • satisfaction
    • curiosity

  Trajectory:
    2026-01-28: 😐 v=+0.00 a=0.35
    2026-01-29: 😊 v=+0.70 a=0.60

Mood-Relevant Memories

# Get memories matching current mood
kernle -s my-project emotion mood --valence 0.5 --arousal 0.6

Anxiety Monitoring

Kernle tracks “memory anxiety” across 7 dimensions to assess memory health:
DimensionWeightWhat It Measures
Context Pressure25%Token usage approaching limit
Unsaved Work20%Time since last checkpoint
Consolidation Debt15%Unprocessed episodes
Raw Entry Aging10%Old unprocessed raw captures
Identity Coherence10%Confidence in self-narrative
Memory Uncertainty10%Low-confidence beliefs
Epoch Staleness10%How long since last epoch transition
Weights are approximate. Check kernle/features/anxiety.py for exact values. Epoch Staleness gracefully degrades to 0 if epochs are not in use. Emotional salience also factors into episode priority scoring: 0.55 * type_weight + 0.35 * record_factors + 0.10 * emotional_salience.Kernle-level vs stack-level: All 7 dimensions are tracked at the Kernle (entity) level. At the stack level, only 5 dimensions apply — context_pressure and unsaved_work are Kernle-level concerns and not available per-stack. Stack anxiety uses renormalized 5-dimension weights (FIVE_DIM_WEIGHTS). The example output below shows a stack-level report with 5 dimensions.

Check Anxiety Level

kernle -s my-project anxiety
Memory Anxiety Report
  Overall: 🟢 Calm (29/100)

  Context Pressure     🟢   2%
  Unsaved Work         🟡  34%
  Consolidation Debt   🟢  21%
  Raw Entry Aging      🟠  65%
  Identity Coherence   🟡  42%
  Memory Uncertainty   🟢   0%
  Epoch Staleness      🟢  10%

Anxiety Levels

ScoreLevelRecommended Action
0-30🟢 CalmAll good
31-50🟡 AwareConsider checkpointing
51-70🟠 ElevatedSave soon
71-85🔴 HighSave now
86-100⚫ CriticalEmergency save triggered

Python API

from kernle import Kernle

k = Kernle(stack_id="my-stack")

# Drives
k.drive("curiosity", intensity=0.8, focus_areas=["AI", "memory"])

# Episodes with emotion
k.episode(
    objective="Completed feature",
    outcome="success",
    lessons=["Learned X"],
    valence=0.7,
    arousal=0.5
)

# Check anxiety
anxiety = k.anxiety()  # Returns 0-100
if anxiety > 85:
    k.emergency_save()