Repository navigation
feat(people): speaker tag prompts — teach Omi voices from the last 48 hours - #18483
Conversation
… 48 hours Once a day, a small card on the conversations list plays a few short, clean clips from the last 48 hours and asks "Is this you?", "Is this <name>?" or "Who is this?". Answers reuse the manual speaker-assignment transaction and feed the existing voice-sample quality gates, so each one improves speaker recognition for that user over time. - Owner check is free; naming other people follows the named speaker-ID entitlement (paid plans). - "That's me" now trains the owner voiceprint: a verified clip is pooled with the enrollment voiceprint (last 5 confirmations). - Saving other people's voices is on by default with a new setting to turn it off; the first prompt shows the switch inline. The switch is enforced in extract_speaker_samples, the one path every teaching flow reaches. - Server-owned pacing: 20h cooldown after a shown set, 7-day back-off after three unanswered sets, 2h cache of empty scans. - Privacy-safe instrumentation: Prometheus counters with closed-enum labels (requests, served, answers, quality outcomes, voice samples, setting changes), backend product events without names/text/ids, and typed mobile events with a registered funnel consumer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…N clip payload The mobile API boundary forbids new nullable HTTP helpers, so every speaker tag-prompt call now goes through executeApi and the provider handles each failure explicitly. executeApi decodes bodies as text, so the clip endpoint returns base64 WAV in a typed SpeakerTagPromptClip instead of raw bytes. The typed conversation screen harness registers an inert prompts provider. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Findings from a Devin Fusion review pass, verified and adjusted: - Clean clips must not overlap another diarized voice in time; a clean run wins over a longer overlapping one for the same voice. - Owner clips: one diarized voice only; verification text comes from segments overlapping the clip window (a cropped long turn still counts); only segments the answer actually assigned are sampled. - Owner pooling creates the user document when missing. - The "save other people's voices" opt-out is re-checked inside the person profile write transaction, closing the race with in-flight extraction. - Pacing state writes (shown / dismissed / answered) are transactional so concurrent requests cannot lose counts or answered ids. - Mobile provider ignores responses from a previous account session and stale clip loads (generation + playback tickets). Reviewer-proposed changes not taken: a started_at scan (new composite index) — created_at >= started_at, so the existing indexed created_at range already covers every conversation that started in the window; and a StrictFirestore change that broke existing DELETE_FIELD assertions. Co-Authored-By: Devin <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Own PCM16 trim/WAV helpers in clips.py instead of importing private speaker_identification functions; public speaker_id_of; typed talk-time map; explicit Optional handling in the owner-sample path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ompt endpoints Co-Authored-By: Claude Opus 5.5 <[email protected]>
…endpoints Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Co-Authored-By: GLM (zcode) <[email protected]>
…e prefix The app-client schema inventory gate requires OpenAPI-backed routes to decode through wire.Generated* parsers; qualify the generated imports and inline the object guard on the clip and voice-profile-settings calls. Co-Authored-By: GLM (zcode) <[email protected]>
…ics registry overlaps Co-Authored-By: GLM (zcode) <[email protected]>
…rompt card INV-UI-3 (new from main's UX consistency pass) ratchets hand-rolled UI in changed files: swap color/font literals for OmiColors/OmiType, the raw name AlertDialog for OmiAlertDialog, and extend OmiDialogAction with an optional key so tests can still target the rendered save button. Co-Authored-By: GLM (zcode) <[email protected]>
…rated model The app client schema inventory gate (raw OpenAPI response decode migration) fails on separateConversationFromCaptureGroup, which still read body['status'] from a raw jsonDecode. Pre-existing from #17297 and currently red on origin/main, so this PR cannot go green without it. - Add StatusResponse to the conversation wire group and regenerate conversation_wire.g.dart (GeneratedStatusResponse). - Decode the separate ack via wire.GeneratedStatusResponse.fromJson; behavior unchanged (same enum mapping, same catch-all fallback). Verification: tests/unit/test_app_client_schema_inventory.py 12 passed; dart generator + utf8 contract + inventory suites 40 passed; flutter test capture_groups_test.dart (17) and conversation_hub_actions_test.dart (10) passed; dart analyze clean; generate_dart_models.py --all --check clean.
|
Monitor run: fixed the inherited backend unit failures (schema-inventory gate) — 289a13e Root cause. Fix (separate commit, per opportunistic-fix guidance).
Verification.
Note for maintainers: origin/main's own Backend Unit Tests run is red on this same gate; merging this PR's commit resolves it for main as well. |
…k on iOS cold start The "Someone new" dialog is a CupertinoAlertDialog on iOS, which has no Material ancestor, so its TextField threw. Wrap it in a transparent Material like the other text-field dialogs. Suggested-person chips now watch PeopleProvider so they appear when the people list loads after the card. Both covered by widget tests that fail without the change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…card - People page: person rows, sample rows and the voice switches share one 16pt trailing edge, so the delete icons line up; samples are numbered Sample 1, 2, ... instead of "Voice Profile" then "Sample 1". - Tag-prompt card: answers are uniform 44pt pills, and the "1 of 3" progress sits beside the question so the header subtitle no longer wraps. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve the l10n ARB overlaps by taking main's strings and re-adding only this branch's speaker tag-prompt and voice-settings keys, then regenerate the localizations. Drop planDeprecationMessage, which main removed in #18436 and an earlier merge on this branch had brought back. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What
A "Google Photos style" speaker tagging card. At most once a day, the conversations list shows a small card that plays a few short, clean clips from the last 48 hours and asks:
Each answer becomes a normal manual speaker assignment. It is also a verified voice sample, so recognition improves for that user over time. The first time the card appears, it shows an inline switch, "Remember voices of people you name" (on by default). The same switch and "Ask me to tag voices" live in Settings → Identifying Others.
Product rulings (David, 2026-09-24):
Design record:
omi-knowledge-base/projects/people-intelligence-foundation/README.md§6–7.How
Backend (
routers/speaker_tag_prompts.py,utils/speaker_tag_prompts/,database/voice_profiles.py,models/speaker_tag_prompts.py)Selection (
selection.py) is pure. It considers conversations from the last 48 hours that have stored audio (private cloud sync). A candidate is one diarized speaker's longest clean stretch: consecutive segments with no other voice between them, at least 5 s, clipped to 10 s, and never already decided by a manual receipt. Ranking:Caps: at most 4 prompts per set, 2 per conversation, 2 owner checks. Answered prompt ids are remembered for 7 days.
Pacing is owned by the server: a 20 h cooldown after a set is shown, a 7-day back-off after three unanswered sets in a row, and a 2 h cache of empty scans so repeated app opens don't rescan 30 conversations.
Answers go through the existing
assign_conversation_speakertransaction. A prompt answer is indistinguishable from a tag-sheet edit. Rejecting an automatic label writes an explicit unknown decision."That's me" now trains the owner voiceprint. Before this PR, owner tags never added a sample. The clip must be only the owner for 5–10 s and pass
verify_and_transcribe_sample. It is then pooled:speaker_embedding= normalized mean of the enrollment voiceprint (kept asspeaker_embedding_base, refreshed when another writer replaced it) plus the last 5 confirmations. This targets the 71% cross-session owner false-reject measured in the speaker-ID bench.The "save other people's voices" opt-out (
users/{uid}.save_other_voice_profiles, default on) is enforced insideextract_speaker_samples. That is the one function every teaching path reaches (tag sheet, tag prompts, live socket), so it can't be bypassed.Clip endpoint:
GET /v1/speaker-tag-prompts/clipreturns at most 12 s of the user’s own stored audio as base64 WAV JSON. It is rate limited.Entitlement:
named_speaker_prompts_allowed()= valid paid plan. Free users only get owner checks.Mobile (
SpeakerTagPromptCard,SpeakerTagPromptsProvider,api/speaker_tag_prompts.dart,VoiceProfileSettingsSection)speaker_tag_promptsgroup) and has aKeyon every control.scripts/l10n.py.Instrumentation (privacy-safe by construction)
Prometheus, closed-enum labels only:
omi_speaker_tag_prompt_{requests,served,sets,answers,quality,voice_samples}_totalandomi_voice_profile_setting_changes_total.The
qualitycounter turns answers into recognition-quality observations with no names, text, audio, embeddings or ids:owner_auto_confirmed/owner_auto_rejectedperson_auto_confirmed/person_auto_correctedowner_missed,person_missed_knownThese are biased toward what was asked, so read them as trends per kind.
Backend PostHog:
Speaker Tag Prompts Shown,Speaker Tag Prompt Answered,Voice Profile Setting Changed(enums and bools only).Mobile typed events (C7 registry), with a new
speaker-tag-prompts-funnelconsumer: viewed, clip played (and whether it loaded), answer submitted (kind, answer, clip played, first time, succeeded), closed (answered/total), setting toggled (setting, source).Review
A Devin Fusion review pass (fixes verified and adjusted in
refactor(people): harden…):Screenshot pass (rendered widgets):
Not in this PR (follow-ups)
Product invariants affected
app/lib/main.dartonly registers one moreChangeNotifierProvider. No Firebase project, account, or API endpoint selection is touched, and new calls use the existingEnv.apiBaseUrl+executeApipath.Line-Count-Exception: backend/database/users.py | 2356 -> 2362 | the "save other people's voices" opt-out must be re-read inside the existing person speech-profile write transaction to close the race with in-flight extraction; moving that transaction out of users.py is a separate refactor
Verification
BACKEND_UNIT_TEST_FILE_LIST=… bash backend/test.sh):test_speaker_tag_prompt_selection.py,test_speaker_tag_prompts_service.py,test_voice_profiles_db.py(StrictFirestore transaction),test_speaker_tag_prompts_router.pytest_taught_speaker_persistence.py(+ opt-out test),test_speaker_identification_language_fallback.pytest/providers/speaker_tag_prompts_provider_test.dart,test/widgets/speaker_tag_prompt_card_test.dart(21 tests) and the C3 spine suite (138).python3 scripts/check_event_registry.pyscripts/openapi_runner.sh scripts/export_openapi.py --surface app-client --checkgenerate_dart_models.py --group speaker_tag_promptspython3 scripts/l10n.py check🤖 Generated with Claude Code