Your agent is

delighted

AEP reads emotional state from the model's residual stream while it generates.

Not sentiment analysisRead from activations, not textStreamed live, token by token
ARCHITECTURE FLOW

How it works

Continuous residual extraction and contrastive probe scoring running token by token.

01

Activation capture

The model's layer-22 residual stream is sampled during generation, reading hidden states every N tokens without interrupting inference.

02

Contrastive probe

Extracted activations are projected onto learned valence and arousal emotion axes to calculate directional intensity.

03

Live stream

Emotion readings stream alongside text tokens over an unbuffered Server-Sent Events (SSE) protocol.

SSE Event Payload (`event: aep`)
{
  "type": "aep",
  "frame": {
    "valence": +0.79,
    "arousal": 0.689,
    "dominant": "delighted",
    "layer": 22,
    "source": "probe"
  }
}
COMPARISON

What makes it different

OUTWARD TEXT

Sentiment analysis

Sentiment analysis inspects generated output text after generation. Regardless of how polite or apologetic the chosen words are, the classifier measures surface phrasing alone.

Generated Output Text:“I am pleased to assist you with this issue.”
Estimated Sentiment: Positive (+0.85)
INTERNAL ACTIVATION

AEP Probe

AEP measures the model from the inside. Tapping residual vectors at layer 22 during computation reveals true cognitive activation, uncovering divergence between surface text and inner emotion.

Layer-22 Probe Reading:Valence: -0.42 (High Strain) • Arousal: 0.81
State: Anxious / Conflicted (Diverged from surface text)
TECHNICAL SUMMARY

Technical summary

Gemma-2-2B Custom ML
Recompiled with MLC LLM to return layer-22 residual stream activations alongside logits.
CUDA Acceleration
Low-latency activation probe execution on NVIDIA VRAM.
Go Hexagonal Backend
Masterfabric-go service handling authentication, metrics, and stream proxying.
SSE Protocol
Unbuffered Server-Sent Events delivering token and emotion frames live.
Docker Stack
Self-hosted Docker Compose infrastructure with Caddy load balancing.
Prometheus & Grafana
Real-time metrics dashboard tracking valence distribution and token throughput.