Skip to content

Universal Design for Learning (UDL) โ€‹

SpektraBot is built on the principles of Universal Design for Learning -- a framework that ensures the platform works for every user, regardless of ability, neurodivergence, or learning preference. This page explains what UDL means in SpektraBot and how it is implemented.


Executive Overview โ€‹

What is UDL? โ€‹

Universal Design for Learning is a research-backed framework that says people learn and interact in different ways. Instead of designing for the "average" user and then retrofitting accessibility, UDL designs for diversity from the start.

UDL has three core principles:

  1. Multiple means of representation -- Give people different ways to take in information
  2. Multiple means of engagement -- Give people different ways to stay motivated and involved
  3. Multiple means of expression -- Give people different ways to show what they know or ask for help

Why does it matter for SEND families? โ€‹

Parents navigating the SEND system are often under extreme stress. Many are neurodivergent themselves, or have conditions that affect how they process information. A chatbot that only works one way -- long paragraphs of dense text -- will exclude the very people it's designed to help.

SpektraBot applies UDL at every layer:

UDL PrincipleHow SpektraBot implements it
Multiple means of representationUsers can read plain English or detailed legal explanations. Font size, contrast, and message density are adjustable. Responses adapt their complexity to the question.
Multiple means of engagementConversations are paced to the user's needs. The system validates emotions before problem-solving. Users choose how deeply to explore a topic.
Multiple means of expressionUsers can type freely, use quick-action suggestions, or upload documents. The system doesn't require specific phrasing to understand intent.

User-facing accessibility settings โ€‹

Every user can customise their experience through the Settings panel:

SettingOptionsWhat it does
Font sizeSmall (14px), Medium (16px), Large (18px)Scales all text across the interface
High contrastOn / OffIncreases visual contrast for users with low vision
Reduced motionOn / OffDisables animations and transitions
Message densityCompact, Comfortable, SpaciousAdjusts spacing between chat messages
TimestampsOn / OffShow or hide message timestamps
MarkdownOn / OffRender formatted text or plain text
SoundOn / OffAudio notifications for new messages

These settings are saved per user and persist across sessions and devices.


Technical Architecture โ€‹

Database schema โ€‹

User accessibility preferences are stored in the user_preferences table, defined in the Prisma schema:

prisma
model UserPreferences {
  id     String @id @default(uuid()) @db.Uuid
  userId String @unique @map("user_id") @db.Uuid

  // Accessibility (UDL)
  fontSize      FontSize       @default(medium)
  highContrast  Boolean        @default(false)
  reducedMotion Boolean        @default(false)

  // Chat preferences
  messageDensity MessageDensity @default(comfortable)
  showTimestamps Boolean        @default(true)
  enableMarkdown Boolean        @default(true)
  soundEnabled   Boolean        @default(false)

  // Privacy
  chatHistoryEnabled Boolean @default(true)

  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}

enum FontSize {
  small     // 0.875rem (14px)
  medium    // 1rem (16px)
  large     // 1.125rem (18px)
}

enum MessageDensity {
  compact
  comfortable
  spacious
}

API endpoints โ€‹

EndpointMethodDescription
/api/preferencesGETFetch current user preferences (creates defaults if none exist)
/api/preferencesPATCHUpdate specific preference fields
/api/preferences/resetPOSTReset all preferences to defaults

Frontend implementation โ€‹

Preferences are managed through a React Context provider (packages/web/src/lib/preferences-context.tsx) that wraps the entire application:

AuthProvider
  โ””โ”€ PreferencesProvider      โ† Loads preferences on login
       โ””โ”€ ChildProvider
            โ””โ”€ SocketProvider
                 โ””โ”€ App

When preferences change, CSS custom properties are updated on the document root:

typescript
const FONT_SIZE_MAP = {
  small:  "0.875rem",   // 14px
  medium: "1rem",       // 16px
  large:  "1.125rem",   // 18px
};

// Applied to <html> element
root.style.setProperty("--font-size-base", FONT_SIZE_MAP[preferences.fontSize]);

Reduced motion support โ€‹

The system respects both the user's manual setting and the operating system's prefers-reduced-motion media query:

css
/* OS-level preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Manual setting via preferences */
html[style*="--animation-duration"] .animate-fadeIn,
html[style*="--animation-duration"] .animate-bounce,
html[style*="--animation-duration"] .animate-pulse {
  animation-duration: 0.01ms !important;
}

Adaptive response complexity โ€‹

The RAG pipeline adapts response length and complexity based on context and intent through a Response Mode system:

ModeMax wordsWhen used
GATHER120Sparse context -- ask clarifying questions
STANDARD150Standard detailed response
DETAILED400High context, complex query
URGENT100Deadline or crisis situation
TASK1000Letter writing, structured output

This implements UDL's "multiple means of representation" at the AI level -- the system automatically adjusts how much information it presents based on the conversation state, avoiding cognitive overload.

UDL in system prompts โ€‹

The base system prompt (packages/api/src/prompts/modules/base_core.md) embeds UDL principles directly into the AI's behaviour:

Communication principles:

  • Lead with plain language; add legal terms only when helpful
  • Offer choices in how to proceed when multiple pathways exist
  • Break complex processes into clear, numbered steps
  • End with a clear, specific next step
  • Accept that users may need time to process -- don't rush them

UDL provision guidance (when advising on educational provision):

  • Multiple means of engagement: interest-led, movement-based, sensory-friendly
  • Multiple means of representation: not just text-based learning
  • Multiple means of expression: alternative ways to evidence progress
  • Therapeutic and educational provision integrated, not siloed

UDL in the knowledge base โ€‹

The knowledge base validation system (packages/api/src/knowledge-base/validation-prompt.ts) specifically accepts UDL-relevant educational content:

"Teaching strategies for SEN pupils (UDL, differentiation, sensory, communication, ASD, ADHD, dyslexia)"

This ensures the RAG pipeline has access to UDL-focused resources when generating advice about educational provision.

Settings UI โ€‹

The Settings tab (packages/web/src/components/tabs/SettingsTab.tsx) organises preferences into four cards:

  1. Accessibility -- Font size, high contrast, reduced motion
  2. Chat Settings -- Message density, timestamps, markdown, sound
  3. Notifications -- Email preferences, reminders, digest
  4. Privacy -- Chat history retention

Each setting saves immediately on change via the updatePreferences() function, which PATCHes the API and updates the React context simultaneously.

Key files โ€‹

FilePurpose
packages/api/prisma/schema.prismaPreference database schema
packages/api/src/preferences/routes.tsREST API endpoints
packages/api/src/preferences/service.tsPreference CRUD logic
packages/web/src/lib/preferences-context.tsxReact context provider
packages/web/src/components/tabs/SettingsTab.tsxSettings UI
packages/web/src/app/globals.cssCSS custom properties and motion queries
packages/api/src/chat/agentic-rag.tsResponse mode selection
packages/api/src/prompts/modules/base_core.mdUDL communication principles

Confidential ยท Spectrum Dynamics CIC