Google Meet: write an AI summary for calls without Gemini notes

Closed
EH
16h ago
+771-32

Context

Follows https://github.com/twentyhq/twenty/pull/30632 in the Google Meet app series started in https://github.com/twentyhq/twenty/pull/30587.

When Gemini is not taking notes, a Meet call is imported with its transcript and no summary. This PR has the app write one with its own agent, the way the Call Recorder app summarizes its recordings.

What this PR does

  • Decides at import time whether an AI summary is needed. Gemini's smart note exists from the moment it starts taking notes, so a call whose transcript is ready and that has no smart note will never get notes. The import asks for a summary when the call has a transcript, no summary yet, and every smart note is finished: none at all, or generated but unreadable. Notes still being written are waited for.
  • Queues a separate google-meet-summarize-call-recording job, one per Call Recording (job id google-meet-summary-<id>), so a repeated event or the daily catch-up does not summarize twice. The job skips a recording that has a summary by then, runs the google-meet-call-summarizer agent on the stored transcript, and saves its markdown as the summary.
  • Uses Call Recorder's summary prompt (Gist, Overview, Action Items, Notes, Keywords) with its guard: a transcript too thin to summarize gets a short "Summary unavailable" note instead of invented content, which also keeps later imports from paying for another run.
  • Adds a per-member AI summaries setting (a USER application variable, on by default), so each member can turn it off for their own calls to avoid AI credit usage. The import passes the call owner in the job payload, and the job reads members' values through myUserApplicationVariables, since a job started by the app has no member and gets no USER values in its env. Also adds the AI permission flag on the app's default role.
  • README and SETUP.md mention the fallback and its cost.

Checks

  • yarn lint, yarn typecheck, oxfmt --check and yarn test:unit (178 tests) pass locally. New pure tests cover the summary decision, the prompt built from the transcript and the parsing of the agent's reply; the sync test covers a call without Gemini notes.
  • Tested on a self-hosted Twenty with a real Google account: a call with transcription on and Gemini notes off was imported without a summary, and the summary job saved the agent's answer 14 seconds later. That transcript was too fragmented, so the answer was the "Summary unavailable" note; a full summary was not seen on a real call. Calls with Gemini notes on kept Gemini's notes and queued no summary job.