Overview
Session, transcript and document summaries are structured. The model returns a JSON object of paragraphs; the worker parses it, enforces anonymity and caps, stores onesummary_paragraphs row per paragraph and writes the rendered Markdown to summarisations.summary_text, which the editor, exports, workspace reports, Summary Health and HiRAG keep reading.
The summary language is the session’s target_language, else the workspace’s preferred_language, else the dominant language of the transcript text (detected per sentence with whatlang, weighted by length), else English. Whisper’s audio-level detected_language is not used: it drifts to English on short or noisy chunks and code-switched meetings.
Each paragraph is one topic, in the order the room first discussed it:
With a session brief,
closing lists each “what matters most” item. An item counts as addressed only with a quote found in the transcript; it renders under the language’s closing heading (“Zum Anliegen der Sitzung”, “On the purpose of the session”) as addressed or not addressed, with the speaker’s role when given.
These paragraphs are the units the merge step aligns with the workspace’s topics after every session summary.
Transcript (per-track) summaries
A session’s recording devices are its tracks that did not fail and recorded at least one chunk, whether or not their transcription succeeded (summary_trigger::recording_device_count). Transcript summaries, one per track, exist for different audiences in a room recorded from several devices, so they are only created when a session has more than one recording device. A single-device session gets only the merged Session summary; a retranscribe of its track still produces a new Session summary.
A manual request for a Transcript summary (summary_type: "transcript" on POST /sessions/:id/summarise or POST /sessions/:id/upload-transcript) on a session with fewer than two recording devices is refused with 400 Transcript summaries need more than one recording device, before any row is created. Transcript summaries are never scored by Summary Health.
Quality gate
When Summary Health evaluation is enabled, a generated Session summary is scored before the user sees it. The job stays Processing and nothing is written tosummary_text until the gate decides.
- The candidate is regenerated once when its health score is below
QUALITY_GATE_THRESHOLD(75), its summary quality (coherence & faithfulness) is below 75, and its transcript quality (ASR confidence & coverage) is not also below 75. A low transcript side means bad audio or a thin transcript, which a regeneration cannot fix. - The retry runs at a temperature shifted by 0.3 (see Summary Health).
- The candidate with the higher health score is kept; a tie, or a retry that fails to generate or score, keeps the first. A summary still below 75 after the retry is shown anyway.
- If scoring the first candidate fails, it is stored unscored; an evaluation failure never fails the summary.
- Deleting pasted summaries and queueing the
topic_graphjob wait until the kept candidate is stored, so the topic merge only ever sees its paragraphs.
Document summaries
An uploaded document is summarised with the same paragraph format and the same anonymity rules; the document takes the place of the transcript. Its topic sentence is<matter>: <what the document states, proposes or decides about it>, and the body has one to five sentences. A document has no transcript to quote and no brief, so evidence and closing are always empty: the prompt asks for empty lists and the worker drops any evidence before storing. A workspace’s or customer’s custom prompt replaces only the style sentence.
The paragraphs are stored even when the document was uploaded outside a session (summarisations.session_id NULL), as long as the document still exists. After the summary completes the worker queues a document_graph job, which puts the paragraphs into the topic graph for agent retrieval; they never enter the topic merge. Summaries written before this format are free Markdown; kair-voice-topic-backfill resummarise-documents regenerates them.
Anonymity
Transcripts carry personal data; summaries do not name people.- The prompt forbids personal names, contact details, addresses, exact ages and anything that singles out a person. People are referred to by role title (“the head teacher”, “a resident”), or “a participant” when no role is given.
- The worker scrubs what slips through: claimed speaker names, transcript speaker labels and track names that are not generic speaker tags (
S1,Speaker 2), and the parts of multi-word names, are replaced with[participant]in every text field. Entities matching them are dropped. - The paragraph
entitiesthat feed the topic graph never include people either.
Failure
A reply that does not parse as the JSON object is retried once; a second failure fails the summary job like any other model error. Summaries are user-triggered, so the user runs it again.Pasted summaries
A summary pasted from another tool (origin = 'pasted') is stored as written: its summary_text stays exactly as the user pasted it and is never replaced by rendered paragraphs. Pasting queues a topic_graph job; when the paste is the session’s newest summary and has no paragraphs yet, that job first asks its agent LLM to split the paste into paragraphs (same shape, <matter>: <position> topic sentences, in the paste’s language), then merges them like generated ones.
- Paragraphs from a paste have no evidence (
[]), since there is no transcript to quote. - Before the prompt, the paste goes through the same redaction as transcripts (
transcription.pii: regex detectors, then the NER name model on CPU); a redaction error fails the job. Then the same anonymity scrubbing applies: the session’s claimed speaker names and any[mm:ss] Speaker:labels become[participant], and matching entities are dropped. Only the prompt sees the redacted text; the stored paste is unchanged. - Pastes are capped at 64 KiB (400). A paste is refused (409) when the session already has a generated session summary with text.
- Editing a paste deletes its paragraphs in the same transaction and queues a
topic_graphjob, so the topics follow the latest text. A job that started before the edit drops its result instead of writing paragraphs for the old text. - A reply that does not parse is retried once; a second failure (or zero paragraphs) is logged and the job merges without the paste, so one unsplittable paste does not block the session. A model or database error still fails the job (retried, then visible in admin jobs). The paste itself is never changed.
- A later generated summary deletes the paste with its paragraphs, and its
topic_graphmerge replaces the paste’s topic appearances. - Data-subject erasure deletes the paste’s paragraphs like any other summary’s.
Transcript preparation
Loop collapse runs per line (collapse_transcript_text): repeated clauses inside a line and runs of three or more identical lines collapse, and the merged [mm:ss] Track / Speaker: turns stay one per line.