Skip to content
VijayabaskarR-06Public

About

Never miss a lead: a five-second Arabic or English voice note becomes a customer record and a scheduled follow-up. On-device speech plus Apple Foundation Models, in SwiftUI/SwiftData, with a widget, a Siri intent and a WhatsApp share extension. No server, no API key.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

Repository files navigation

Sayd (صيد) — never miss a lead

A repair shop in Abu Dhabi takes forty calls a day and writes down none of them. The customer's name, the device, the day they need it back — all of it lives in the owner's head until it doesn't, and the lead is gone.

Sayd is a five-second voice note that becomes a customer record and a scheduled follow-up. The owner speaks — in Arabic, English, or the mix of both people actually use — and the app transcribes it, pulls out the name, the request, the phone number and when to chase, and puts a reminder on the calendar. Every step runs on the phone. There is no server, no API key, and no account.

The four main screens

Capture, the Today list sorted by what is about to be lost, a lead's detail, and the whole app in Arabic with a right-to-left layout.


The problem this is actually solving

Piloted with BILAL GSM, a mobile repair shop in Abu Dhabi. The owner's day is his hands: he is holding a phone open with a spudger when the next customer calls. Typing a name into a CRM is not something that happens, and by evening he can remember maybe half of who wanted what.

Three constraints fall out of that, and they shape the whole app:

  1. Capture has to cost nothing. One tap, five seconds of speech, no typing. If logging a lead is slower than not logging it, nothing gets logged.
  2. The list has to be sorted by risk, not by time. "What did I write down first" is useless. "Who am I about to lose" is the only question worth asking.
  3. The customer list cannot leave the phone. It is the shop's commercial asset. A privacy promise that quietly degrades is not a promise.

How it works

The on-device pipeline

SFSpeechRecognizer runs with requiresOnDeviceRecognition = true, which makes it refuse when on-device recognition is unavailable rather than silently posting the audio to Apple's servers. The transcript then goes to Apple's on-device SystemLanguageModel through a @Generable struct, so the model is constrained to return the four fields the app needs and cannot hand back malformed JSON. When Apple Intelligence is unavailable — an older iPhone, the model still downloading — LeadExtractor.heuristic takes over with plain string rules. Capture never fails.

Nothing is written to the database until the owner has looked at it. An extraction that is right nine times in ten still loses one customer in ten; a one-tap confirmation is cheaper than a lost lead.


The widget is the point

The best version of this app is one the owner rarely opens. The medium widget puts the leads going cold — and the week's follow-up rate — on the home screen, so glancing is enough.

The home-screen widget in both states

The widget, the Share Extension and the Siri intent all read the same SwiftData store through an App Group, so they cannot drift apart.


Quick start

brew install xcodegen
xcodegen generate        # produces Sayd.xcodeproj from project.yml
open Sayd.xcodeproj

Then set your team ID in project.yml (DEVELOPMENT_TEAM) and confirm the App Group group.com.sayd.shared exists on all three targets.

Requirements

  • Xcode 26 or later
  • iOS 26 deployment target
  • A physical iPhone — the Speech framework's on-device recogniser and the Foundation Models framework are unreliable or unavailable in the Simulator
  • Apple Intelligence enabled, for extraction (there is a rule-based fallback if not)

Creating the project by hand (if you'd rather not use XcodeGen)

  1. Xcode → New Project → iOS → App
    • Product Name: Sayd
    • Interface: SwiftUI, Language: Swift, Storage: SwiftData
  2. Delete the generated ContentView.swift and SaydApp.swift.
  3. Drag the Sayd/ folder from this repo into the project navigator (check Copy items if needed, Create groups).
  4. File → New Target → Widget Extension, name it SaydWidget, uncheck "Include Configuration Intent". Replace its generated Swift file with SaydWidget/SaydWidget.swift.
  5. File → New Target → Share Extension, name it SaydShareExtension, and replace its generated files with the ones in SaydShareExtension/.
  6. Add Sayd/Resources/Localizable.xcstrings to the app target.

Capabilities and Info.plist

On the Sayd target → Signing & Capabilities:

  • + Capability → App Groups → group.com.sayd.shared (must match SaydStore.appGroupID, and must be added to all three targets — without it the widget silently opens its own empty database)
  • + Capability → Background Modes → Remote notifications (optional)

Add the same App Group to the SaydWidget and SaydShareExtension targets.

In Info.plist add:

Key Value
NSMicrophoneUsageDescription Sayd records a short voice note so you can log a customer without typing.
NSSpeechRecognitionUsageDescription Speech is transcribed entirely on your device to turn your note into a lead.

Localisation

Project → Info → Localizations → add Arabic and Turkish. To test the RTL layout: Scheme → Run → Options → App Language → Arabic, or use Right-to-Left Pseudolanguage.


Architecture

Sayd/
├─ Models/
│  └─ Lead.swift                  SwiftData model; owns the "going cold" rule
├─ Services/
│  ├─ SpeechCaptureService.swift  AVAudioEngine + Speech, on-device forced
│  ├─ LeadExtractor.swift         Foundation Models @Generable + rule-based fallback
│  ├─ SaydStore.swift             shared App Group container (app + widget + share)
│  └─ FollowUpScheduler.swift     UNCalendarNotificationTrigger per lead
├─ Views/
│  ├─ CaptureView.swift           mic, live waveform, language toggle
│  ├─ TodayView.swift             going-cold vs scheduled, week stats
│  ├─ LeadDetailView.swift        extracted fields, call / WhatsApp, reschedule
│  └─ ConfirmLeadView.swift       human check before anything is saved
├─ Intents/
│  └─ AddLeadIntent.swift         "Hey Siri, add a lead"
└─ Resources/
   └─ Localizable.xcstrings       Arabic, English, Turkish

SaydWidget/
├─ SaydWidget.swift               medium widget: leads going cold + follow-up rate
└─ Info.plist                     widgetkit extension point

SaydShareExtension/
├─ ShareViewController.swift      forwarded WhatsApp message → lead
└─ Info.plist                     share extension point + activation rule

SaydTests/
└─ SaydTests.swift                Swift Testing: cold-lead rules + extraction fallback

Design decisions worth defending in an interview

On-device is a constraint, not a feature. requiresOnDeviceRecognition = true makes the recogniser fail rather than silently fall back to Apple's servers. A repair shop's customer list is commercially sensitive; a privacy promise that degrades quietly is not a promise.

The model never writes to the database directly. ConfirmLeadView sits between extraction and persistence. An extraction model that is right 90% of the time still loses one customer in ten — a one-tap confirmation is cheaper than a lost lead.

A phone number is only kept if it was actually said. LeadExtractor.sanitise re-checks any number the model returns against the digits in the transcript and drops it otherwise. A hallucinated number is worse than a blank field: the owner dials it, reaches a stranger, and stops trusting the app.

Graceful degradation. LeadExtractor.heuristic runs when Apple Intelligence is unavailable, so the app still works on an older iPhone. Capture never fails.

"Going cold" is the organising idea. The list is not sorted by creation date but by how close a lead is to being lost. The widget exists so the owner often does not need to open the app at all.

Tests

xcodebuild test -scheme Sayd -destination 'platform=iOS,name=<your device>'

Swift Testing covers the two things that are genuinely easy to get wrong: the "going cold" boundary conditions, and the extraction fallback — including that a model number is not mistaken for a phone number, and that a number the model invented is thrown away.


Status / roadmap

  • Voice capture, on-device transcription (AR/EN)
  • On-device extraction with fallback
  • Phone-number extraction with a one-tap call / WhatsApp follow-up
  • Follow-up notifications, Today view, lead detail
  • Siri App Intent, home-screen widget
  • Arabic RTL, English, Turkish localisation
  • WhatsApp Share Extension (parse a forwarded message into a lead)
  • Unit tests, XcodeGen project spec
  • watchOS companion for wrist capture
  • Live Activities for follow-up countdowns
  • Gulf/Levantine dialect accuracy tuning

Licence

MIT — see LICENSE.

About

Never miss a lead: a five-second Arabic or English voice note becomes a customer record and a scheduled follow-up. On-device speech plus Apple Foundation Models, in SwiftUI/SwiftData, with a widget, a Siri intent and a WhatsApp share extension. No server, no API key.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages