“Recognize me” (speech profile speaker ID) not applied after profile re-record + app reset; manual speaker tagging in one convo “activates” it for the rest of the day (likely cache/flag not set on upload path)
Note: The specific docs/code pointers and suspected backend mechanisms mentioned below were suggested by Vetor, the AI help agent (not discovered independently by the reporter).
Report type: Bug
Area: transcription, diarization, speech profile, speaker assignment, caching/flags
What’s broken
Diarization is working (it correctly detects multiple speakers/segments), but the “Recognize me” feature (speech-profile based speaker identification that should map one diarized speaker to the user) fails.
This persists even after:
- re-recording the speech profile (multiple times)
- resetting the app
Expected behavior
After a successful speech profile re-record/upload (and after app reset), new conversations should consistently map diarized speakers to the user when the user speaks.
Actual behavior
- Conversations are diarized into multiple speakers correctly.
- However, the system does not tag the user as the speaker via “Recognize me”.
- Re-recording the speech profile and resetting the app do not reliably restore “Recognize me”.
Reliable workaround (and why this is suspicious)
Workaround pattern:
- Start a conversation and record a short multi-speaker interaction (or any convo where the user speaks).
- In the transcript UI, manually tag the user as the speaker for the relevant diarized speaker/segments.
- End the conversation.
- Subsequent conversations for the rest of the day correctly recognize/tag the user automatically.
This strongly suggests that:
- The upload/re-record path is not fully “activating” the speech profile for speaker ID, even if it stores it.
- The manual tagging workflow triggers a backend path that sets a “profile available/processed/active” flag and/or invalidates a stale cache, after which speaker assignment starts working again.
Hypothesis
There is likely a backend state issue where the “speech profile processed/available” state is not being flipped/refreshed from upload alone, but is set when the user manually tags a speaker (which may trigger a reprocess or speaker-assignment rerun).
Possible root causes:
- A backend “profile activation” flag/cache isn’t set on profile upload, only on later processing.
- Redis cache still indicates “no active speech profile” even after upload (stale key, missing invalidation).
- The include_speech_profile flag/dual-socket path isn’t being applied because
speech_profile_processednever becomes true. - Manual tagging triggers a reprocess that sets the missing flags (or routes through a different speaker assignment pipeline).
Pointers to docs + code paths to inspect (from Vetor)
Docs references:
docs/doc/developer/backend/transcription.mdx- look for
include_speech_profile,speech_profile_processed, dual-socket / profile inclusion behavior
- look for
docs/doc/developer/backend/backend_deepdive.mdx- Redis/GCS speech-profile flags and related caching
- look for flags like
set_user_has_soniox_speech_profile,speech_profile_processedand anything indicating profile readiness
Code/testing references:
- Speaker assignment logic and tests:
backend/tests/unit/test_speaker_assignment.py
- Speech profile upload/router:
backend/routers/speech_profile.py(or equivalent)- any “speech profile router” used by upload/re-record
- Conversation processing / reprocess hooks:
backend/utils/conversations/process_conversation.py(or equivalent)- anything triggered by manual speaker tagging that might rerun assignment
- Storage/cache utils:
backend/utils/other/storage.py(or equivalent)- Redis key writes/reads for “has speech profile”, “processed”, “ready”, “active”
What to check in logs/telemetry (suggested)
Compare a “broken” convo vs “fixed after manual tag” convo and verify:
- Does the transcription request include
include_speech_profile=truein both cases? - Is
speech_profile_processedfalse before manual tag and true after? - Are Redis flags indicating profile readiness missing or stale until manual tagging happens?
- Does manual tagging trigger a reprocess job or speaker assignment rerun that sets/refreshes keys?
- Are there multiple code paths for speaker ID (upload path vs reprocess path) that diverge in flag-setting?
Repro steps (as observed)
- Re-record speech profile.
- Reset app (optional, still fails even with reset).
- Start new conversation, record multi-speaker audio.
- Observe diarization works, but “Recognize me” doesn’t tag the user.
- Apply workaround:
- manually tag the user as speaker in transcript
- end conversation
- Start a new conversation:
- observe “Recognize me” now works for subsequent conversations (typically for the rest of the day).
Workaround
Manual speaker tagging in one conversation, then end convo. Subsequent convos correctly recognize/tag user for the rest of the day.
Requested fix
Ensure speech profile re-record/upload path reliably:
- flips the correct “profile ready/processed/available” backend flags, and
- invalidates any stale Redis cache keys, so that “Recognize me” works immediately without requiring a manual-tag “kick”.
Investigated the code paths end-to-end. The hypothesis in the issue (that manual tagging triggers a backend path that sets a missing activation flag) doesn't hold — the expand_speech_profile call in the manual tagging endpoint is commented out (# thinh's note: disabled for now in conversations.py:408). Manual tagging just updates is_user/person_id on segments in Firestore, no profile reprocessing or flag-setting happens.
The core speech profile flow is:
get_user_has_speech_profile(uid)— checks GCS blob existence (real API call per session)- Speech profile audio downloaded from GCS and sent to STT socket as preseconds
speech_profile_completeevent fires when profile send finishes- Segments after that point get
speech_profile_processed=True can_assigngates speaker assignment on having at least onespeech_profile_processed=Truesegment
This flow works correctly when the profile exists and loads successfully. The reporter's observation that manual tagging 'fixes it for the rest of the day' is likely a timing coincidence (GCS caching, STT service warmup, or client-side state) rather than a causal fix.
The real diarization/speaker-ID accuracy issues are tracked in #5470. Closing as not-planned since the specific bug mechanism described doesn't match the code.