Emergency Dispatcher Training Simulation project. It explains the entire pipeline, from how each component works to how you can get started and extend the system. You can copy and paste this into a file named README.md
or adapt it to your preferred format.
This repository provides a conversational AI simulation where a distressed caller (played by an AI) interacts with a dispatcher (human user) to practice emergency call handling. The system also provides feedback on the dispatcher’s performance based on real-world 911 dispatcher protocols and guidelines.
- Overview
- Project Architecture
- Agents (Core Components)
- The
app.py
Script - Installation & Setup
- Workflow Summary
- Advanced Features & Future Enhancements
- License (optional)
- Contact / Contributing (optional)
Emergency Dispatchers often encounter high-stress calls requiring adherence to strict protocols (e.g., verifying location, assessing the victim’s state). This project simulates these conversations and automatically generates feedback to improve dispatcher readiness.
- Generate Realistic Emergency Scenarios: Tailored to address common dispatcher mistakes.
- Simulate Distressed Callers: An AI that behaves as a panicked caller, forcing dispatchers to ask the right questions under pressure.
- Provide Actionable Feedback: Highlights positive aspects, missed steps, and suggestions for better call handling.
Below is a high-level architecture of how everything fits together:
+----------------------------+
| TrainerAgent |
| (Generates Scenario) |
+-------------+--------------+
|
(Scenario Prompt)
v
+----------------------------+ +------------------------+
| HumanBotAgent | <-----> | Dispatcher (User) |
| (Distressed Caller AI) | | Real-time Input |
+-------------+--------------+ +-----------+------------+
| |
(Conversation Logs) |
v |
+----------------------------+ |
| FeedbackReportGenerator | <---------------+
| (Analyzes Conversation) |
+-------------+--------------+
|
(Feedback Report)
v
+----------------------------+
| Output / Console |
| (e.g., final report) |
+----------------------------+
- TrainerAgent generates a scenario prompt (e.g., “Late-night call about a heart attack with background noise”).
- HumanBotAgent takes on the role of the distressed caller using that scenario.
- Dispatcher (the human user) tries to handle the call.
- Conversation logs are collected.
- FeedbackReportGenerator reviews the logs and provides a structured, actionable report.
- Purpose: Generates new emergency call scenarios based on past feedback reports.
- Usage:
- Feeds on previous sessions’ issues (e.g., “slow response time”, “missed protocol steps”).
- Creates a refined scenario prompt targeting those weaknesses.
- Key Method:
process_request(feedback_reports)
- Purpose: Simulates the distressed 911 caller.
- Usage:
- Takes the scenario prompt from
TrainerAgent
. - Responds dynamically to dispatcher questions (user input) as if it’s a real caller in distress (crying, forgetting info, etc.).
- Takes the scenario prompt from
- Key Methods:
initialize_conversation(prompt)
: Kickstarts the simulation with an opening scenario.get_bot_response(user_input)
: Generates new responses from the “distressed caller” based on user input.get_conversation_logs()
: Retrieves the entire conversation for feedback analysis.
- Purpose: Analyzes the final conversation logs and produces a feedback report.
- Usage:
- Takes conversation logs (list of role-content messages).
- Uses an LLM prompt to identify missed protocol steps, positive aspects, and improvements.
- Key Method:
generate_feedback(conversation_logs)
-
Clone the Repository
git clone https://github.com/YourUsername/EmergencyDispatcherTraining.git cd EmergencyDispatcherTraining
-
Install Dependencies
- Create and activate a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate # Mac/Linux # For Windows: venv\Scripts\activate
- Install required packages:
pip install -r requirements.txt
Note: You may need API keys if you’re using an external LLM service (e.g., OpenAI).
- Create and activate a virtual environment (recommended):
-
Project Structure:
EmergencyDispatcherTraining/ ├── agents/ │ ├── __init__.py │ ├── trainer_agent.py │ ├── human_bot_agent.py │ └── feedback_report_agent.py ├── rouetrs/ │ ├── __init__.py │ ├── auth.py │ ├── setup.py │ └── users.py ├── services/ │ ├── sql_connection.py ├── utility/ │ ├── auth_bearer.py │ ├── auth_helper.py │ └── data_store.py ├── app.py ├── main_audio.py ├── main.py ├── model.py ├── requirements.txt ├── README.md └── ...
- Feedback Reports (Past Sessions)
- “Session #1: Missed verifying location, slow instructions.”
- TrainerAgent
- Incorporates that data into a new scenario prompt (e.g., “Emphasize location confirmation quickly”).
- HumanBotAgent
- Responds as a frantic caller with partial info, background noise, etc.
- Live Interaction
- User asks questions → AI replies → logs accumulate.
- FeedbackReportGenerator
- Takes the entire conversation → Analyzes with LLM → Identifies missed steps or best practices → Returns a structured feedback summary.
- Multi-Lingual Support
- Real emergencies happen in various languages. Integrate translation for bilingual or multilingual calls.
- Gamification & Scoring
- Assign a numerical score for each call, highlight repeated patterns, or track progress over multiple sessions.
- Protocol Library Integration
- For advanced setups, integrate standard emergency protocols (like MPDS) and check specifically if each step is followed.
- Dashboard & Analytics
- Build a web interface to track each dispatcher’s improvement over time, generate performance graphs, etc.
- Role-Based Access
- Differentiate between Trainee Dispatchers, Trainers, and Admins. Provide each role with relevant data and permissions.
(Optional)
You may want to add a license (e.g., MIT, Apache 2.0) to clarify usage rights.
(Optional)
- Contact: If you have questions or suggestions, reach out to:
- Contributions: PRs are welcome! Fork the repo, add features, and open a pull request.
By following this documentation, you’ll understand each component of the pipeline, how to run it, and how to extend it for more realistic, robust dispatcher training. Good luck with your Emergency Dispatcher Training Simulation!