Documentation
Architecture
Ralph Integration

Ralph Integration

How Ralph's autonomous iteration patterns integrate with the Nity agent system.

Ralph's Role

Ralph provides the learning layer — cross-adapter effectiveness tracking, the SimpleMem memory substrate, and the Voyager brain/skills integration. Ralph doesn't execute tasks; it optimizes how they're executed.

Integration Points

1. Cross-Adapter Learning

Ralph tracks adapter performance across task categories and feeds recommendations into strategy planning:

StrategyPlanner.plan(analysis)
  └─→ RalphUniversal.getRecommendation(taskCategory)
       → { adapter: 'claude-sonnet', confidence: 87, reason: '...' }

The effectiveness matrix is updated after every episode:

EpisodeRecorder.record(episode)
  └─→ RalphUniversal.recordUsage(category, adapter, outcome)
       → update matrix, recalculate success rates

2. SimpleMem Memory Substrate

SimpleMem provides the persistence layer that both Ralph and Nity depend on:

┌─────────────────┐     ┌─────────────────┐
│   Nity Memory   │     │  Ralph Universal │
│  (brain, eps)   │     │  (effectiveness) │
└────────┬────────┘     └────────┬─────────┘
         │                       │
         └───────────┬───────────┘

              ┌──────▼──────┐
              │  SimpleMem  │
              │   Bridge    │
              └──────┬──────┘

              ┌──────▼──────┐
              │ Python CLI  │
              └─────────────┘

Both systems write to and read from the same SimpleMem instance, using different namespaces:

  • episodes — Nity's episode recordings
  • brain — Session brain state
  • ralph — Adapter effectiveness data

3. Voyager Brain/Skills Integration

Ralph's Voyager module extends the brain concept with skill-level context:

FeatureNity BrainRalph Voyager
ScopeSessionCross-session
ContentObservations, decisionsSkills, patterns, strategies
Persistence.voyager/brain.md.voyager/skills/
LoadingOn session startOn skill activation

The integration works through the skill registry:

TaskAnalyzer.analyze(task)
  └─→ SkillRegistry.match(task)
       └─→ loads from .voyager/skills/
            └─→ injects skill-specific context

Data Flow

task completion

  ├─→ Nity records episode
  │     └─→ SimpleMem.store('episodes', ...)

  ├─→ Ralph records adapter usage
  │     └─→ SimpleMem.store('ralph', ...)

  └─→ next session starts

        ├─→ Ralph loads effectiveness matrix
        │     └─→ SimpleMem.query('ralph', ...)

        └─→ StrategyPlanner uses recommendations
              └─→ better adapter selection

Ralph's learning is cumulative. Each session contributes data that improves future sessions. The effectiveness matrix converges over time — early sessions use heuristics, later sessions use data-driven recommendations.