AwwScribe is an AI-powered clinical scribe designed specifically for veterinary practices. It uses ambient voice transcription and medical AI to automatically generate professional SOAP notes from veterinary appointments, freeing veterinarians to focus on patient care.
- Real-time voice transcription using ElevenLabs Scribe v2
- Medical terminology optimized for veterinary context
- Sub-100ms latency for immediate feedback
- Voice Activity Detection (VAD) with automatic segmentation
- One-click SOAP generation from complete transcripts
- AI-powered medical documentation using Google Gemini 2.0 Flash
- Structured output with Subjective, Objective, Assessment, Plan sections
- Medical entity extraction (vitals, diagnoses, medications)
- Professional veterinary terminology
- Copy-to-clipboard for easy integration with existing systems
- Conversational AI phone assistant for appointment scheduling
- Natural language understanding for booking requests
- Real-time availability checking
- Automated confirmations via SMS/email
- Automated appointment reminders via phone calls
- Customizable reminder schedules (24hr, 1hr before)
- Natural voice interactions using ElevenLabs TTS
┌─────────────────────────────────────────────────────────────┐
│ AwwScribe Frontend │
│ (Next.js 16 / React 19) │
└─────────────────────────────────────────────────────────────┘
│
┌───────────────┴───────────────┐
│ │
▼ ▼
┌──────────────────────────┐ ┌──────────────────────────┐
│ ElevenLabs Scribe v2 │ │ Google Vertex AI │
│ (Speech-to-Text) │ │ (Gemini 2.0 Flash) │
│ │ │ │
│ • Medical terminology │ │ • SOAP note generation │
│ • Sub-100ms latency │ │ • Medical entity NER │
│ • VAD segmentation │ │ • Structured output │
└──────────────────────────┘ └──────────────────────────┘
// Live Scribe Component (Implemented)
components/live-scribe.tsx
├─ ElevenLabs Scribe v2 SDK integration
├─ Real-time transcript display
├─ Patient context management
└─ SOAP generation trigger
// API Routes (Implemented)
app/api/scribe-token/route.ts // Generate single-use tokens
app/api/generate-soap/route.ts // Gemini SOAP generation
// API Routes (Placeholder)
app/api/check-availability/route.ts // Future: Calendar integration
app/api/book-appointment/route.ts // Future: Appointment booking- Node.js 18+ (with npm or pnpm)
- ElevenLabs API Key (Get it here)
- Google Cloud Project with Vertex AI API enabled
- Google Cloud Service Account JSON key file
-
Clone the repository
git clone https://github.com/your-org/aww_scribe.git cd aww_scribe -
Install dependencies
npm install # or pnpm install -
Set up environment variables
cp .env.example .env.local
Edit
.env.local:# ElevenLabs API Key (server-side only) ELEVENLABS_API_KEY=sk_your_elevenlabs_api_key_here # Google Cloud Configuration GOOGLE_CLOUD_PROJECT_ID=your_gcp_project_id GOOGLE_CLOUD_LOCATION=us-central1 # Path to service account JSON key GOOGLE_APPLICATION_CREDENTIALS=./service-account-key.json # Future: Phone Booking Agent NEXT_PUBLIC_ELEVENLABS_AGENT_ID=agent_your_agent_id_here
-
Set up Google Cloud credentials
Download your service account key:
- Go to Google Cloud Console
- Navigate to IAM & Admin → Service Accounts
- Create or select a service account
- Click Keys → Add Key → Create New Key → JSON
- Save as
service-account-key.jsonin project root
Important:
service-account-key.jsonis in.gitignore- never commit this file! -
Enable required Google Cloud APIs
gcloud services enable aiplatform.googleapis.com -
Run the development server
npm run dev # or pnpm dev
- Enter patient information (or use demo patient Luna)
- Click "Start Listening" to begin ambient transcription
- Speak naturally with the pet owner during the appointment
- Watch real-time transcript appear as you speak
- Click "Stop Listening" when the appointment is complete
- Click "Generate SOAP Note" to create structured documentation
- Copy to clipboard and paste into your practice management system
Dr. Smith: Hi! What brings Luna in today?
Owner: She's been limping on her right front leg for about three days.
It started after we went to the dog park. She doesn't want to put
weight on it.
Dr. Smith: Let me examine that leg. Luna, can you stand for me?
I'm feeling some swelling around the carpus. Does this hurt?
Any yelping or crying at home?
Owner: She yelped once when she first hurt it, but since then she's
been quiet, just not using the leg much.
Dr. Smith: Her vitals look good - temperature is 101.8, heart rate
is 110. I think this is a soft tissue injury, likely a sprain.
Let's start with rest and an anti-inflammatory. I'm prescribing
Carprofen, 75mg twice daily for 7 days. Keep her calm, no running
or jumping. If she's not better in a week, we'll do X-rays.
{
"subjective": "Luna, a 4-year-old Golden Retriever, presents with a
3-day history of right front leg lameness following a visit to the
dog park. Owner reports reluctance to bear weight and initial yelping
when injury occurred.",
"objective": "T: 101.8°F, HR: 110 bpm. Physical exam reveals swelling
around the right carpus. Patient shows pain on palpation. Otherwise
bright, alert, responsive.",
"assessment": "Soft tissue injury of right front limb, likely carpal
sprain. No radiographic evidence of fracture indicated at this time.",
"plan": "1. Carprofen 75mg PO BID x 7 days\n2. Strict rest - no running
or jumping\n3. Recheck in 7 days if no improvement\n4. Consider
radiographs if lameness persists\n5. Client education provided on
activity restriction",
"vitals": {
"temperature": "101.8°F",
"heartRate": "110 bpm",
"respiratoryRate": null,
"weight": "65 lbs"
},
"chiefComplaint": "Right front leg lameness x 3 days",
"diagnosis": "Carpal sprain, soft tissue injury"
}aww_scribe/
├── app/
│ ├── api/
│ │ ├── scribe-token/route.ts # ElevenLabs token generation
│ │ ├── generate-soap/route.ts # Gemini SOAP generation
│ │ ├── check-availability/route.ts # [Placeholder] Calendar API
│ │ └── book-appointment/route.ts # [Placeholder] Booking API
│ ├── globals.css
│ ├── layout.tsx
│ └── page.tsx # Main app page
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── live-scribe.tsx # Main scribe component
│ └── phone-booking-agent.tsx # [Placeholder] Phone agent
├── lib/
│ ├── elevenlabs.ts # ElevenLabs config
│ └── utils.ts
├── archive/
│ └── old-conversational-approach/ # Deprecated code
├── .env.example # Environment template
├── .env.local # Your local config (gitignored)
├── service-account-key.json # Google Cloud key (gitignored)
└── package.json
Audio configuration in components/live-scribe.tsx:
const scribe = useScribe({
modelId: 'scribe_v2_realtime',
onPartialTranscript: handlePartialTranscript,
onCommittedTranscript: handleCommittedTranscript,
onError: handleError,
})
await scribe.connect({
token: singleUseToken,
microphone: {
echoCancellation: true,
noiseSuppression: true,
},
languageCode: 'en',
audioFormat: 'pcm_16000',
commitStrategy: 'vad', // Voice Activity Detection
vadSilenceThresholdSecs: 2.0, // 2 seconds of silence commits
vadThreshold: 0.4,
})Model configuration in app/api/generate-soap/route.ts:
const model = vertexAI.getGenerativeModel({
model: 'gemini-2.0-flash-exp',
generationConfig: {
temperature: 0.3, // Lower = more consistent medical docs
maxOutputTokens: 2048,
topP: 0.95,
},
})| Service | Usage | Cost |
|---|---|---|
| ElevenLabs Scribe v2 | 10 minutes | ~$0.033 |
| Google Gemini 2.0 Flash | ~2K input + 1K output tokens | ~$0.000029 |
| Total per appointment | ~$0.033 |
- 10 appointments/day = ~$10/month
- 30 appointments/day = ~$30/month
- 100 appointments/day = ~$100/month
Prices as of December 2024. Check current pricing at ElevenLabs and Google Cloud.
// Client requests a single-use token
GET /api/scribe-token
→ Server calls ElevenLabs API
→ Returns 15-minute expiring token
→ Client uses token to connect WebSocket// Real-time audio streaming
Client (LiveScribe)
→ getUserMedia() // Get microphone access
→ scribe.connect(token) // Establish WebSocket
→ scribe.startRecording() // Stream audio
→ onPartialTranscript() // Interim results (streaming)
→ onCommittedTranscript() // Final segments (on VAD silence)// AI-powered documentation
POST /api/generate-soap
{
transcript: "full appointment text",
patientName: "Luna",
patientBreed: "Golden Retriever",
...
}
→ Google Gemini processes with medical prompt
→ Extracts entities (vitals, diagnoses, meds)
→ Structures into SOAP format
→ Returns JSON with all sectionsnpm test
# or
pnpm testnpm run build
npm run startnpm run lint- Live ambient transcription with Scribe v2
- SOAP note generation with Gemini
- Real-time transcript display
- Chat Copilot
- Copy-to-clipboard functionality
- Phone booking agent integration
- Automated reminder calls
- Multi-user support
- Analytics dashboard
Contributions are welcome! Please follow these steps:
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- ElevenLabs for the amazing Scribe v2 speech-to-text API
- Google Cloud for Vertex AI and Gemini models
- V0 by Vercel for the initial UI scaffolding
- shadcn/ui for the beautiful component library
Built with ❤️ for veterinarians who care about their patients and their time.