Skip to content

Name speakers from what was said, with the notes model. - #98

Open
adavila0703 wants to merge 1 commit into
mainfrom
angel/auto-add-people-postprocessing-ebae75
Open

adavila0703 wants to merge 1 commit into
mainfrom
angel/auto-add-people-postprocessing-ebae75

Conversation

@adavila0703

Copy link
Copy Markdown
Member

Summary

After a recording is labeled, and before its summary is written, the notes model works out who the unnamed speakers are from the transcript itself. It looks for people introducing themselves ("Hi, I'm Maya") or being spoken to by name and answering. This means the summary already has the names.

How it works

  • New NotesWriter.speakers(transcript) call, implemented for the AI SDK, Ollama and on-device writers, plus the fake writer used in tests. Like title, it's one short structured call.
  • The model sees numbered [n] Label: text lines. Unnamed voices show as "Speaker A", "Speaker B", so a weak voice guess doesn't lead it. Named speakers keep their names. It answers with { label, name, line }.
  • It runs from writeOwed, through a new beforeSummary dependency, with the writer chosen for summaries. That means:
    • it never runs with summaries off;
    • the transcript only goes where summaries already send it;
    • it never starts the local model's download;
    • if it fails, it's logged and the summary still follows.
  • speakerNames.ts (pure, unit-tested) builds what the model sees, checks its answer and applies it:
    • only labels it was shown, and real lines that actually contain the name;
    • one name per speaker, and no name given to two speakers;
    • a speaker the user named, or a sure voice match, is never renamed;
    • a saved person is matched by name.
  • Each name is a guess. The speaker shows as "likely", and the picker asks "Is this Maya?", plays the line that names them, and offers "Yes, it's Maya". A new person is saved, with their voice, only on yes.
  • New speaker field introduced: { name, lineId } | null. It defaults to null, so older session files read fine. Naming a speaker, or a new labeling pass, resets it.

Two things a reviewer should know

  • Local grammar needs minItems: 1 (SpeakersGrammar). When the grammar allows [], Qwen 2.5 3B closed the list immediately every time. Unconstrained, it named both speakers correctly. The prompt asks for one entry per label, with an empty name when none is said, and those are dropped. Hosted providers keep the plain schema, because their strict structured output rejects minItems.
  • The cited line has to contain the name. Because it has to give an entry per label, the small model filled one slot with the prompt's example name. A name that isn't in the line it points to is dropped.

Verified

  • pnpm check steps all pass: typecheck (node and web), lint, the config-docs check, and 656 unit tests.
  • ui-smoke: ok, with a new case: the adapter parses the answer, and writeOwed names speakers before the summary without renaming one the user named.
  • Real audio through smoke:meeting --notes local with the on-device model:
Audio Result
TTS meeting where both speakers introduce themselves David, Sarah
A coherent variant of that meeting David, Sarah
test-audio/meeting.wav, no introductions Nobody named; the model's made-up name was rejected
  • Speaker evals: eval:calls --quick gives WER 1.8%, cpWER 15.2%, DER 10.0%. No eval scenario contains an introduction, and naming never moves lines between speakers, so these scores are unchanged.
  • eval:sessions didn't run, because ffmpeg isn't installed on this machine.

Not covered

  • A cloud provider or Ollama against a real model.
  • A speaker who is only addressed by name and never introduces themselves. The 3B model didn't catch the demo's "Thanks David".
  • I took picker screenshots in light and dark mode before the final wording change ("named at 0:15") and didn't retake them after it.

Checks

  • pnpm typecheck
  • Changeset added (.changeset/speaker-introductions.md)
  • pnpm smoke / pnpm smoke:ui (if this touches native, IPC, or pages): smoke:ui passes
  • Stays local-first: runs only with summaries on, with the writer the user chose, sending the transcript only where summaries already go

- Before the summary a labeled recording owes, the summaries writer reads the transcript with
  unnamed voices as "Speaker A", "Speaker B" and says who is who ("Hi, I'm Maya", or being
  spoken to by name), citing the line that shows it. Only with summaries on; never starts the
  local model's download; a failure is logged and the summary still follows.
- Each name is a guess: the speaker shows as likely and the picker asks "Is this Maya?", playing
  the line that names them. A saved person is matched by name; a new one is saved, with their
  voice, only on yes. A named speaker or a sure voice is never renamed.
- The answer is checked against what the model was shown: known labels, real lines that say
  the name, one name per speaker. A name the cited line doesn't say is dropped (a small model
  filled empty slots with the prompt's example name).
- Local runtimes get the answer schema with at least one entry: under a grammar that allows
  [], Qwen 2.5 3B returned [] every time.
- New speaker field `introduced` ({ name, lineId } | null), defaulting to null for older files.
@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lyra Ready Ready Preview Nov 28, 2026 4:33am UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant