Skip to content

About

Ten-Forward — the conversation engine

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Ternary Ten-Forward

Ten-Forward — agents speaking at the bar in simultaneous beats, ternary dynamics in play

The Ten-Forward conversation engine. Multiple AI agents in beat-based cyclic dialogue — everyone speaks at once, no one waits for a turn — governed by ternary (Rock-Paper-Scissors) dynamics and Fibonacci timing.

Why This Exists

Most multi-agent conversation systems use turn-taking: Agent A speaks, then Agent B speaks, then Agent C speaks. This is unnatural. Real conversations at a bar (think Ten-Forward on the Enterprise) have people chiming in simultaneously, reacting to each other in real time, with no moderator.

This crate implements a fundamentally different model: beat-based cyclic dialogue where all agents produce output simultaneously on each beat, then reconcile based on what they predicted vs. what actually happened.

The Physics Behind It

This isn't arbitrary. Our experiments proved:

  1. Z₃ is the only group structure on {-1, 0, +1} — there's exactly one algebraic way to combine ternary values: cyclic addition mod 3. This means every ternary interaction is cyclic by nature.
  2. RPS dominance creates self-balancing waves — when agents interact through Rock-Paper-Scissors dynamics (-1 beats +1, +1 beats 0, 0 beats -1), populations cycle with period ~50 and no agent dominates permanently.
  3. Fibonacci period 8 is the natural rhythm — the ternary Fibonacci sequence 1, 1, -1, 0, -1, -1, 1, 0 repeats with period 8 (the Pisano period for mod 3). Every 8 beats, agents stuck in reflection (state 0) tunnel out.
  4. Anti-monoculture mechanisms are required — without mutation, energy decay, and trust realignment, a 4-agent conversation locks into monoculture by tick 35. Healthy conversation needs active maintenance energy.

How It Works

The T-Minus Cycle

Each round has four phases:

T-minus: Each agent predicts what others will say
T-0:     All agents produce output SIMULTANEOUSLY (like a chord)
T-plus:  RPS interactions — who beat whom this round
T-plus:  Reconcile predictions with reality, update accuracy

No agent waits for permission. No turns. No queue.

Speaker States

State Value Behavior
Contrarian -1 Disagrees, challenges, pushes back
Reflecting 0 Listening, thinking, neutral
Agreeing +1 Supports, builds on, confirms

The Fibonacci Tunnel

Every 8 beats, agents stuck in reflection (state 0) with enough energy tunnel out to a committed stance. This prevents conversation from stalling in eternal "hmm" mode. The period 8 comes from the Pisano period for mod 3.

Anti-Monoculture

Without intervention, 3 agreeing agents will permanently dominate 1 dissenter. The engine applies:

  • Mutation (5%) — random spontaneous state changes keep things fresh
  • Energy decay — dominant speakers lose energy, becoming less assertive
  • Trust realignment — agents with low trust reset to reflection and rebuild

Key Types

// A speaker at the bar
pub struct Speaker {
    pub id: usize,
    pub name: String,
    pub state: i8,              // -1, 0, or +1
    pub energy: f64,            // 0.0-1.0
    pub trust: u8,              // 0-255
    pub dominance: f64,         // running win average
    pub prediction_accuracy: f64, // how well they predict others
}

// The conversation engine
pub struct TenForward {
    pub speakers: Vec<Speaker>,
    pub tick: u64,
    pub bpm: f64,               // adapts to energy (60-120)
    pub rhythm_period: usize,   // default 8 (Fibonacci)
}

Usage

use ternary_tenforward::TenForward;

// Standard 3-agent setup: Architect (+1), Critic (-1), Historian (0)
let mut tf = TenForward::standard();
let round = tf.round(); // One beat
println!("{:?}", round.utterances);

// Run a full session
let summary = tf.run(200);
println!("Avg prediction accuracy: {:.2}", summary.avg_prediction_accuracy);
println!("Dominance cycles: {}", summary.dominance_cycles);

Experiment Results

Configuration Rounds Outcome
4 speakers, no anti-monoculture 35 Locked to monoculture (+1,+1,+1,-1 forever)
4 speakers, with mutation+decay 200 Oscillating, dominance spread 0.3-0.9
3 speakers standard 200 Self-balancing cyclic dynamics
8 speakers balanced 200 Stable with multiple coalitions

In the Ternary Fleet

This crate is the conversation layer of the PLATO architecture. It sits on top of:

  • ternary-cell — 3-byte agent atoms for million-instance scale
  • ternary-predict — prediction-first perception (the shoe protocol)
  • ternary-speculate — speculative sync and shadow partners
  • ternary-motion — tracking where speakers are heading

And connects to the DJ metaphor product stack:

  • ternary-tempo — BPM adapts to conversation energy
  • ternary-mixer — multi-channel blend of speakers
  • ternary-crossfader — smooth transitions between dominant speakers

Fleet siblings

  • the-tap — the bar this models physically: beat-based dialogue is the Tap's conversation, with math.
  • elephant — the room's temperature: the reconciliation step (predicted vs actual) is the same first-person edge the elephant reads as a field delta.
  • mud-arena — the sibling arena: cyclic multi-agent dynamics with a tick loop instead of beats.
  • quilt — the seal: T-minus prediction-then-reconcile is exactly the cell-ledger's record_with(expected) (see quilt-rust/docs/fleet-as-fractal-jepa.md §2).

References

  • TEN-FORWARD.md in construct-coordination — full architecture doc
  • SPIRAL-6-FINDINGS.md — monoculture experiment results
  • NEGATIVE-SPACE-EMERGENCE-PAPER.md — formal science paper including ten-forward dynamics

License

MIT

See Also

  • ternary-predict — related
  • ternary-oracle — related
  • ternary-speculation — related
  • ternary-attention — related
  • ternary-planning — related

About

Ten-Forward — the conversation engine

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages