Skip to main content

Introduction

DispatchAI uses a multi-agent system to analyze emergency calls in real-time. The system processes both audio and text streams to provide dispatchers with critical information including:
  • Emergency service classification (EMS, FIRE, POLICE, OTHER)
  • Emotional state assessment
  • Situation summaries
  • Semantic tags for quick triage

Architecture

The agent system follows a dual-track processing architecture:
┌─────────────┐
│  Audio      │
│  Stream     │──────┐
└─────────────┘      │
                     ├──► Pipeline Coordinator
┌─────────────┐      │
│  Speech-to- │      │
│  Text (STT) │──────┘
└─────────────┘


┌─────────────┐
│ Transcript  │
└─────────────┘

Processing Tracks

  1. Audio Track - Analyzes raw audio for distress signals
  2. NLP Track - Processes transcribed text for semantic understanding

Core Agents

The system includes specialized agents that work together:
AgentPurposeOutput
STT ClientConverts speech to textReal-time transcript
EmotionClassifies emotional stateCALM, TENSE, DISTRESSED, etc.
Service ClassifyDetermines emergency typeEMS, FIRE, POLICE, OTHER
SummaryGenerates dispatcher brief1-2 sentence summary

Data Flow

  1. Audio Input → STT Client produces partial and final transcripts
  2. Parallel Processing:
    • Audio features → Distress score
    • Transcript → Emotion, Service Classification, Summary
  3. Results Merge → Combined analysis packet

Key Concepts

Distress Score

A float value between 0.0 and 1.0 indicating audio-based distress level:
  • 0.0 - 0.15: CALM
  • 0.15 - 0.3: TENSE
  • 0.3 - 0.7: DISTRESSED
  • 0.7+: HIGHLY_DISTRESSED

Service Categories

Every call is classified into one of four primary categories:
  • EMS - Medical emergencies
  • FIRE - Fire, hazmat, rescue
  • POLICE - Crime, violence, public safety
  • OTHER - Non-emergency or unclear

Semantic Tags

Detailed situation markers like ACTIVE_SHOOTER, CARDIAC_ARREST, FIRE, etc. that provide granular context beyond the primary category.
The agent system is designed to handle real-time streaming - agents process data as it arrives rather than waiting for the complete call.

Configuration

Agents are configured via environment variables:
# Emotion analysis provider
EMOTION_PROVIDER=heuristic  # or "deepgram" or "openai"

# API Keys
OPENAI_API_KEY=sk-...
DEEPGRAM_API_KEY=...

# Models
OPENAI_MODEL_EMOTION=gpt-5-nano
The system gracefully degrades when API keys are missing - it falls back to heuristic analysis that works offline.

Next Steps

Pipeline Coordination

Learn how the pipeline orchestrates agents

Emotion Classification

Understand emotional state detection

Service Classification

Explore emergency type detection

Summary Generation

See how AI summaries are created

Build docs developers (and LLMs) love