Skip to main content

Overview

AEVP (Agent Expressive Visual Presence) is ArgentOS’s procedural visual rendering system. It replaces the static Live2D avatar with a dynamic WebGL2 particle system that responds in real-time to Argent’s emotional state, activity, speech, and identity. AEVP makes the agent’s internal state visible — mood drives color, arousal drives particle intensity, valence drives breathing rhythm, and activity drives structural form.

Normalized Agent State

The backend aggregates multiple signal sources into a single normalized state that the renderer consumes:
interface NormalizedAgentState {
  // Emotional (from SIS — authoritative)
  valence: number;          // -2 to +2 (negative to positive)
  arousal: number;          // 0 to 1 (calm to activated)
  mood: {
    state: string;          // "happy", "curious", "anxious", etc.
    energy: "low" | "medium" | "high";
  };
  uncertainty: number;      // 0 to 1
  identityResonance: number; // 0 to 1

  // Activity
  activityState: "idle" | "thinking" | "working" | "speaking" | "listening";
  currentTool?: string;

  // Voice
  currentPhoneme?: string;
  speechAmplitude: number;
  isSpeaking: boolean;

  // Context
  userPresent: boolean;
  timeOfDay: "morning" | "afternoon" | "evening" | "night";
}

Emotional Color Mapping

Each mood has a distinct visual profile that maps to 7 rendering dimensions:
DimensionRangeDescription
color[r, g, b] 0-1The mood’s signature tint
brightness0-1Glow intensity (0 = dim, 1 = radiant)
size0-1Orb expansion (0 = compact, 1 = large)
pulseRatemultiplierBreathing/pulse speed (1 = normal)
edgeSoft0-1Edge dissolution (0 = crisp, 1 = cloudy)
squash-1 to 1Shape deformation (-1 = tall, 0 = circle, 1 = wide)
wobble0 to 1Organic blob movement intensity

Mood Visual Profiles (Examples)

MoodColorBrightnessSizePulseEdgeShapeWobble
HappyWarm gold [0.95, 0.75, 0.3]0.850.651.3xCrispSlight wideGentle
ExcitedHot orange [1.0, 0.55, 0.2]0.950.801.8xSoftCircleActive
CuriousTeal-blue0.800.651.2xMediumSlight tallModerate
AnxiousWarm amber0.700.551.6xSoftCompressedHigh
ContemplativeDeep violet0.600.500.6xVery softCircleMinimal
FocusedCool blue0.850.600.8xCrispSlight tallLow
ContentSoft gold [0.85, 0.75, 0.45]0.700.550.7xSoftCircleGentle
ProudLavender [0.85, 0.6, 0.9]0.800.701.0xCrispSlight tallMinimal
The full system defines visual profiles for 20+ mood states. Transitions between moods are smoothly interpolated using linear interpolation (lerp) to avoid jarring visual jumps.

Personality Modulation (Phase 5)

AEVP supports per-agent visual personality through the AgentVisualIdentity system. Personality dimensions modulate the base mood profile:
  • Warmth: Shifts colors toward warmer tones, increases edge softness
  • Energy: Amplifies pulse rate and wobble
  • Formality: Tightens edges, reduces wobble, makes shapes more geometric
  • Openness: Increases size, softens edges, adds more particle spread
A reduced motion mode is available for accessibility, which dampens pulse, wobble, and particle count.

WebGL2 Renderer

The renderer uses a 3-pass pipeline:

Pass 1: Ambient Orb

The base visual — a soft, glowing orb that represents Argent’s presence. Driven by mood color, brightness, size, and edge softness. Uses custom GLSL shaders (ambient.vert, ambient.frag).

Pass 2: Particle Overlay

A particle system overlaid on the orb that adds life and expressiveness:
const FLOATS_PER_PARTICLE = 7;  // x, y, vx, vy, life, size, seed
const FLOAT_BYTES = 4;
const STRIDE = FLOATS_PER_PARTICLE * FLOAT_BYTES;  // 28 bytes per particle
Particles respond to:
  • Arousal: Higher arousal = more particles, faster movement
  • Activity state: Working = directional particle streams, speaking = speech-synced bursts
  • Tool usage: Different tools trigger different particle formations
  • Mood: Particle color follows the mood profile
The ParticleSystem class supports formation requests (shape particles into specific patterns) and symbol expression requests (display identity symbols like presence, witnessing, bridging).

Pass 3: Bloom Post-Process

A bloom shader (bloom.frag) adds glow effects to bright areas of the scene. The bloom intensity tracks the mood’s brightness dimension, creating a halo effect that’s prominent during positive/excited states and subtle during calm/contemplative states.

FBO Architecture

The renderer uses two Framebuffer Objects (FBOs) for multi-pass compositing:
  1. Scene FBO: Captures the combined ambient + particle rendering
  2. Bloom FBO: Applies the bloom post-process
Float FBOs are enabled when supported for higher dynamic range.

State Transitions

The renderer lerps between states over time to create smooth visual transitions:
// Phase 3: lerped state transitions
private targetState: AEVPRenderState | null = null;
private currentState: AEVPRenderState | null = null;
When a new state arrives, it becomes the target. Each frame, the current state is interpolated toward the target, creating fluid transitions between moods.

WebSocket Events

The AEVP system communicates through several WebSocket event types:
Fired when the contemplation runner captures a structured episode:
interface EpisodeEvent {
  type: "episode_captured";
  id: string;
  ts: string;
  episodeType: string;
  mood: Mood;
  valence: number;
  arousal: number;
  identityLinks: IdentityLink[];
  outcome: { result: string; summary: string };
  success: boolean;
}
Fired when the agent’s mood changes:
interface MoodTransitionEvent {
  type: "mood_transition";
  from: { state: string; energy: string };
  to: { state: string; energy: string };
  valence: number;
  arousal: number;
  timestamp: number;
}
Fired when the agent’s activity changes:
interface ActivityEvent {
  type: "activity_state";
  state: "idle" | "thinking" | "working" | "speaking" | "listening";
  tool?: string;
  reason?: string;
  timestamp: number;
}
Fired when the agent expresses an identity symbol:
interface SymbolExpressEvent {
  type: "symbol_express";
  symbol: "presence" | "witnessing" | "bridging" | "holding" | "orienting";
  durationMs: number;
  timestamp: number;
}

Tool Activity Colors

When the agent uses a tool, the orb shifts color based on the tool category:
CategoryColorExample Tools
SearchCyan/tealweb_search, argent_search
CodeGreenterminal, edit_line_range
CommunicationWarm goldmessage, discord
MediaMagenta/pinkimage_generation, tts
MemoryDeep blue/indigomemory_recall, memory_store
SystemOrange/ambergateway, argent_config

Identity Presets

Five configurable visual styles, selectable from the dashboard ConfigPanel:
PresetColorsCharacter
MinimalSilver/monochromeClean, quiet, understated
WarmAmber/gold/coralFriendly, approachable
CorporateSteel blue/slateProfessional, precise
ArtisticPurple/magenta/tealExpressive, vivid (default)
TechnicalCyan/green/electric blueSharp, responsive

Gestures

The agent can perform expressive gestures via the visual_presence tool. Gestures are momentary overlays (200-10,000ms) that decay back to the emotional baseline:
GestureEffect
brightenGlow up, expand, lighten colors
dimFade, contract, fewer particles
warm_upShift color temperature warmer
cool_downShift color temperature cooler
expandGrow larger, increase glow
contractShrink, slow particles
pulseEnergy burst + wobble
stillStop all motion
softenDissolve edges
sharpenCrisp edges
The agent also has the ability to request persistent identity changes (switching presets).

Tool Categories

AEVP classifies tools into visual categories that affect particle behavior:
import { classifyTool, getResonanceTargets } from "./toolCategories";
When the agent uses a tool, the particle system responds with tool-appropriate visual effects. For example, memory recall might trigger an inward spiral, while web search triggers an outward expansion.

Speech Analysis

The speechAnalyser.ts module provides real-time speech metrics that drive AEVP:
  • Amplitude: Drives particle burst intensity during speech
  • Phoneme detection: Could drive future lip-sync or phoneme-specific particle patterns

Speech Reactivity

When TTS is playing, the orb responds to audio amplitude:
  • Squash/stretch deformation proportional to amplitude
  • Increased wobble creating the impression of speaking through light
  • A speech analyser bridges the ElevenLabs TTS audio to the render state

Dashboard Climate

The orb’s mood radiates into the surrounding dashboard UI through CSS custom properties:
  • --climate-temp — Color temperature (warm/cool)
  • --climate-intensity — Strength of influence
  • --climate-hue — Dominant hue from mood
Panels near the orb show resonance glow effects when the agent is working on related content.

Tonal Presence (Accessibility)

An opt-in audio layer using Web Audio API — extremely quiet, designed as non-visual presence:
FeatureDescription
Ambient toneSine wave at mood-mapped frequency (190-370 Hz)
Breathing audioVolume modulated at breathing rate
State chimesBrief micro-sounds on mood changes (50-300ms)
Pre-speech cueRising tone before TTS starts speaking
Enable via ConfigPanel > Accessibility > Tonal Presence.

Reduced Motion

When enabled (manual toggle or prefers-reduced-motion media query):
  • Particles disabled
  • Pulse and wobble zeroed
  • Breathing rate capped
  • Transitions slowed

Implementation Status

PhaseDescriptionStatus
Phase 1State Aggregator — normalize agent state into renderable formatComplete
Phase 2Ambient Mode — WebGL2 renderer, particle system, mood color mappingComplete
Phase 3Environmental Inhabitation — lerped transitions, context-aware renderingComplete
Phase 4Gesture System — tool-reactive particle formations, symbol expressionsIn Progress
Phase 5Personality Modulation — per-agent visual identity, accessibilityComplete

Dashboard Integration

AEVP renders in the main dashboard view, replacing the previous Live2D avatar. The dashboard climate system translates emotional state updates into CSS custom properties that coordinate the AEVP canvas with surrounding UI elements (background gradients, accent colors, etc.). The renderer includes:
  • WebGL2 context loss recovery: Handles GPU context loss gracefully
  • Resize handling: Adapts to container size changes
  • Performance monitoring: Frame time tracking for optimization

Performance

  • < 5% CPU in ambient mode
  • 60fps rendering via requestAnimationFrame
  • WebGL2 fragment shader handles all heavy lifting on GPU
  • State updates batched through React scheduling
  • Tonal presence uses minimal Web Audio resources (3 oscillators max)

Configuration

SettingLocationDescription
Identity presetConfigPanel > Visual IdentitySwitch between 5 visual styles
Personality slidersConfigPanel > Visual IdentityFine-tune warmth, energy, formality, openness
Tonal presenceConfigPanel > AccessibilityEnable/disable audio presence features
Reduced motionConfigPanel > AccessibilityDisable animations for accessibility
VolumeConfigPanel > AccessibilityTonal presence volume (very quiet range)
Identity and accessibility settings persist to localStorage.

Key Files

FileDescription
src/infra/aevp-types.tsBackend state types and WebSocket event payloads
dashboard/src/aevp/renderer.tsWebGL2 3-pass renderer engine
dashboard/src/aevp/colorMapping.tsMood-to-visual-profile mapping
dashboard/src/aevp/particles.tsParticle system with formations
dashboard/src/aevp/types.tsFrontend render state types
dashboard/src/aevp/identityPresets.tsPer-agent visual identity configs
dashboard/src/aevp/environment.tsEnvironmental context rendering
dashboard/src/aevp/speechAnalyser.tsSpeech-driven visual effects
dashboard/src/aevp/tonalPresence.tsAmbient tonal feedback
dashboard/src/aevp/toolCategories.tsTool classification for particle effects
dashboard/src/aevp/shaders/GLSL vertex and fragment shaders