Project Info
This project did not submit a demo video on Devpost.
Inspiration
This project was inspired by my family friend's loss of their dog during a critical moment of crisis. It shed light on an overlooked issue: emergency pet health service. As a pet owner, it terrifies me that there is no 911 for our loved pets. So with the power of AI - I took on the challenge.
What it does
PET911 is a voice-activated emergency assistant that guides pet owners through life-threatening situations β completely hands-free. It simulates a real 911-style call for pets and responds with calm, intelligent, and timely support. Here's what it does: π£οΈ Understands your voice in real-time Users can call a real phone number and speak naturally. PET911 uses voice streaming through Vapi to transcribe speech instantly and maintain a fluid, multi-turn conversation. π€ Provides life-saving guidance using AI Powered by Claude, the assistant triages emergencies by asking crucial questions and delivering context-specific, step-by-step instructions (e.g., performing the Heimlich maneuver for a choking dog based on its breed and weight). π§ Remembers what you said The assistant uses memory from the conversation so it doesnβt repeat itself or forget details like the petβs condition or size β enabling natural, human-like dialogue even in high-stress moments. π Finds the closest emergency vet clinic PET911 uses your ZIP code or live coordinates to identify and link you to the closest open emergency clinicβensuring fast, location-aware care when every second counts. π Sends an SMS with directions PET911 identifies a nearby emergency clinic and sends a text message with a direct link to the location. This allows the user to begin navigation immediately β skipping the stress of searching online or fumbling with maps during a crisis. π Transfers to a live vet If needed, PET911 offers to transfer the call to a pre-set backup assistant, simulating the experience of speaking with a real vet receptionist in the area β for needed escalation. β€οΈ Offers emotional support The AI is designed to be calm, empathetic, and reassuring β because pet emergencies are overwhelming, and users need to feel safe and heard.
How we built it
PET911 runs on a modular multi-agent system built with a Flask backend. A voice interface powered by Vapi captures real-time input, which is routed through specialized agents: a Triage Agent for rapid emergency assessment, a Memory Agent for contextual continuity, and a Decision Agent to determine next steps. Claude serves as the core reasoning engine. For location support, we integrated OpenStreetMap, and emergency routing is handled via SMS through Textbelt.
Challenges we ran into
We hit roadblocks integrating Fetch.aiβs Python SDK due to package conflicts, which led us to rethink how we handled real-time vet discovery. Vapi's real-time voice streaming also came with unexpected 404 webhook issues and delayed responses, requiring deep debugging. On top of that, prompting Claude for step-by-step, non-overwhelming instructions demanded careful prompt engineering to simulate a calm, conversational emergency assistant.
Accomplishments we're proud of
Built a fully functional voice AI emergency system from scratch using Vapi and Claude, with natural, multi-turn memory and contextual awareness. Integrated a simulated agent ecosystem combining triage, decision-making, and location support under emergency pressure. Engineered real-time responses that adapt to user input instead of overwhelming themβjust like a real 911 operator would. Successfully routed emergency info via SMS, with geolocation-based vet directions and calming follow-ups. Debugged complex streaming issues and webhooks under time pressure and got everything running seamlessly across tools.
What we learned
Building PET911 taught me how to design for urgency, empathy, and clarity under pressure. I deepened my skills in real-time voice interaction, multi-agent system design, and external API integration. I also learned how to troubleshoot complex streaming and webhook errors, all while keeping the user experience as the top priorityβespecially in life-or-death scenarios.
πΎ PET911 - AI-Powered Pet Emergency Assistant
A voice-activated AI assistant for pet emergencies with real-time SMS notifications and vet locator services.
π Features
Core Functionality
- Voice-Activated Emergency Response - Natural conversation with pet owners during emergencies
- Real-Time SMS Notifications - Automatic vet locator links sent via SMS when calls start
- Intelligent Triage System - Step-by-step first-aid guidance for common pet emergencies
- Live Vet Transfer - Seamless transfer to emergency veterinarians when needed
- Bilingual Support - English and Spanish language support
- Vet Locator Service - Web-based emergency clinic finder with directions
Technical Features
- Real-Time Decision Logic - Dynamic webhook processing with intelligent event routing
- Robust Phone Number Detection - Recursive payload analysis for reliable SMS delivery
- Quota Management - Smart SMS limiting to prevent API abuse
- Error Handling - Graceful fallbacks and comprehensive logging
- Memory-Free Design - Consistent, reliable responses every time
π οΈ Tech Stack
- Backend: Flask (Python)
- Voice Platform: Vapi.ai
- LLM: Anthropic Claude 3 Haiku
- SMS Service: Textbelt API
- Geolocation: OpenStreetMap Nominatim API
- Voice Synthesis: ElevenLabs
- Speech Recognition: Deepgram Nova-2
π Prerequisites
- Python 3.8+
- ngrok (for webhook tunneling)
- Vapi.ai account
- Anthropic API key
- Textbelt API key
- ElevenLabs API key
π Quick Start
1. Clone the Repository
git clone https://github.com/yourusername/pet911.git
cd pet911
2. Install Dependencies
pip install -r requirements.txt
3. Environment Setup
Create a .env file in the root directory:
ANTHROPIC_API_KEY=your_anthropic_key_here
TEXTBELT_API_KEY=your_textbelt_key_here
ELEVENLABS_API_KEY=your_elevenlabs_key_here
4. Start ngrok Tunnel
ngrok http 5000
5. Configure Vapi Assistant
- Go to Vapi.ai Dashboard
- Create a new assistant
- Set the webhook URL to your ngrok URL +
/vapi-webhook - Configure voice settings (ElevenLabs recommended)
- Set up phone number routing
6. Run the Application
python app.py
π Project Structure
petSOS/
βββ agents/
β βββ __init__.py
β βββ llm_agent.py # Claude LLM integration
β βββ triage_agent.py # Emergency triage logic
βββ vet_locator/
β βββ main_agent.py # Vet locator service
β βββ sms_service.py # SMS integration
β βββ templates/
β βββ index.html # Vet locator web interface
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ test_sms.py # SMS testing utility
βββ README.md # This file
π§ Configuration
SMS Settings
- Target Numbers: Configure in
app.pyline 264 - SMS Quota: Adjust
MAX_SMS_PER_SESSIONinapp.pyline 30 - Vet Locator URL: Update
VET_LOCATOR_URLinapp.pyline 28
Emergency Response
- Transfer Number: Set in Vapi assistant configuration
- First Aid Protocols: Customize in
agents/llm_agent.py - Language Support: Configure in system prompts
π§ͺ Testing
Test SMS Functionality
python test_sms.py
Test Vet Locator
- Start the Flask server
- Visit
http://localhost:5000/vet-locator - Enter a location to find nearby clinics
Test Voice Assistant
- Call your configured Vapi phone number
- Describe a pet emergency
- Verify SMS is sent automatically
- Test vet transfer functionality
π API Endpoints
POST /vapi-webhook/chat/completions- LLM chat completionsPOST /vapi-webhook- Vapi event webhooksGET /vet-locator- Vet locator web interfacePOST /vet-locator/api/clinics- Clinic search APIGET /vet-locator/api/health- Health check
π Security Considerations
- API keys stored in environment variables
- SMS quota limiting to prevent abuse
- Input validation on all endpoints
- Error handling without sensitive data exposure
π€ Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Vapi.ai for voice platform infrastructure
- Anthropic for Claude LLM capabilities
- OpenStreetMap for geolocation services
- Textbelt for SMS delivery
- ElevenLabs for voice synthesis
π Support
For support, email support@pet911.com or create an issue in this repository.
Built with β€οΈ for pet safety and emergency response
Analysis
View
Metric
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- FlaskIn code
- HTMLIn code
- PythonIn code
- JavaScriptClaimed
4 of 5 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
53 KB
Source files
10
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
ashleyvarghesee/petsos
15 files Β· 56 KB Β· @ 3b030b3
Structure
Interface
1 file Β· 7%Screens, components and styles rendered to the user.
Application logic
8 files Β· 53%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here β open the file browser to check anything the diagram implies.
Languages
- Python67%
- Markdown17%
- HTML16%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
requirements.txt
pypi Β· 4- anthropic
- Flask
- python-dotenv
- requests
vet_locator/requirements.txt
pypi Β· 4- flask
- python-dotenv
- requests
- twilio
Declared in the repositoryβs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This projectβs features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.