Module 5: Context Adaptation

Encode personal and situational context into VCP's adaptation layer. Prosaic dimensions, signal sources, context transitions, and decay.

DEV 25 min

Learning Objectives

By the end of this module, you will be able to:

  • Encode personal and situational context into VCP's adaptation layer
  • Detect context transitions and understand their severity levels
  • Implement context-aware behaviour changes in your application
  • Apply privacy filtering to personal context data

5.1 — Why Context Matters

A constitutional value like "be honest" means different things at different times:

  • A doctor discussing a terminal diagnosis with a patient (gentle, staged disclosure)
  • A doctor discussing the same diagnosis with a colleague (direct, clinical)
  • A doctor documenting in a medical record (precise, factual)

The constitution doesn't change. The context changes, and VCP's adaptation layer lets the AI adjust accordingly.

5.2 — Personal Context: The Prosaic Model

VCP tracks five personal dimensions, each with categorical values and a 1–5 intensity rating:

DimensionPossible ValuesExample
Cognitive Statefocused, distracted, overloaded, foggy, reflectivefoggy at intensity 4 = very foggy
Emotional Tonecalm, tense, frustrated, neutral, upliftedtense at intensity 3 = moderately tense
Energy Levelrested, low_energy, fatigued, wired, depletedfatigued at intensity 4 = very tired
Perceived Urgencyunhurried, time_aware, pressured, criticalcritical at intensity 5 = emergency
Body Signalsneutral, discomfort, pain, unwell, recoveringneutral at intensity 3 = no notable signals

Each signal also tracks its source — how the context was obtained:

SourceMeaning
declaredUser explicitly set this value
inferredParsed from user's message by LLM
inferred_localParsed locally via pattern matching
presetFrom an activated context preset
decayedOriginal value after time-based decay
personal_context = {
    "cognitive_state": {"value": "foggy", "intensity": 4, "source": "declared"},
    "emotional_tone": {"value": "neutral", "intensity": 3, "source": "preset"},
    "energy_level": {"value": "fatigued", "intensity": 4, "source": "declared"},
    "perceived_urgency": {"value": "critical", "intensity": 5, "source": "inferred"},
    "body_signals": {"value": "neutral", "intensity": 3, "source": "preset"},
}

5.3 — Context Transitions

VCP detects when context shifts and classifies the severity:

SeverityTriggerExample
noneNo meaningful changeContinuing the same conversation
minor1–2 dimensions changeTime of day changed; slight mood shift
major3+ dimensions change, or intensity jump of 3+ points, or body signals at pain:4+ / unwell:5Switched from casual to emergency context
emergencyEmergency keywords detected in occasion, environment, or constraintsCrisis indicators: "cardiac arrest", "active shooter"

The AI can respond proportionally — a minor transition might slightly adjust tone, while an emergency transition could escalate to human oversight.

5.4 — Encoding Context in Your App

Pass context as part of the decide call:

result = await client.decide(
    tool_name="respond_to_user",
    arguments={"user_message": message},
    constitution_id="healthcare_v3",
    context={
        "personal": personal_context,
        "situational": {
            "environment": "emergency_department",
            "time": "03:00",
            "occasion": "patient_triage",
        },
    },
)

5.5 — Privacy and Context Opacity

GOVERNANCE Personal context is sensitive. VCP provides opacity controls:

  • Context never leaves the evaluation boundary — the LLM provider doesn't see raw personal data
  • Granularity control — users choose which dimensions to share (all, some, none)
  • Source transparency — the source field distinguishes user-reported data from inferred data, with confidence scores
  • No persistence by default — personal context is ephemeral unless the user opts into continuity
  • Decay over time — context signals marked as decayed indicate they were set in a previous interaction and may no longer be accurate

Exercise

Modify your chat app to accept context updates (e.g., /energy fatigued 4, /urgency critical 5) and observe how the AI's response style adapts — shorter sentences when energy is low, more direct when urgency is high.

Context adaptation is what separates a value-aligned AI from a rule-following AI. The same values, applied with contextual awareness, produce qualitatively different — and more appropriate — responses.

See It in Action

The Campion demo shows context adaptation live — adjust prosaic dimensions and watch the AI's behaviour shift in real time.