Getting startedEnd-to-end examples

Meeting notetaker

Transcribe a meeting recording with speaker labels and automatic language detection, identify speakers by name, then send the transcript to LLM Gateway for a formatted summary with action items.

Products used: Pre-recorded STT + speaker diarization + Speaker Identification + language detection + LLM Gateway

Model selection: This example uses both universal-3-pro and universal-2 for broad language coverage across 99 languages. If your meetings are English-only, you can use universal-3-pro alone for the highest accuracy.

1import requests
2import time
3
4# ── Config ────────────────────────────────────────────────────
5base_url = "https://api.assemblyai.com"
6headers = {"authorization": "YOUR_API_KEY"}
7
8audio_url = "https://assembly.ai/wildfires.mp3"
9
10# ── Step 1: Transcribe with speaker labels + language detection ──
11data = {
12 "audio_url": audio_url,
13 "speech_models": ["universal-3-pro", "universal-2"],
14 "language_detection": True,
15 "speaker_labels": True,
16}
17
18response = requests.post(base_url + "/v2/transcript", headers=headers, json=data)
19response.raise_for_status()
20transcript_id = response.json()["id"]
21
22while True:
23 result = requests.get(f"{base_url}/v2/transcript/{transcript_id}", headers=headers).json()
24 if result["status"] == "completed":
25 break
26 elif result["status"] == "error":
27 raise RuntimeError(f"Transcription failed: {result['error']}")
28 time.sleep(3)
29
30# ── Step 2: Identify speakers by name ──
31understanding_response = requests.post(
32 "https://llm-gateway.assemblyai.com/v1/understanding",
33 headers=headers,
34 json={
35 "transcript_id": transcript_id,
36 "speech_understanding": {
37 "request": {
38 "speaker_identification": {
39 "speaker_type": "name",
40 "known_values": ["Alice", "Bob"], # Replace with actual participant names
41 }
42 }
43 },
44 },
45)
46understanding_response.raise_for_status()
47identified = understanding_response.json()
48
49# ── Step 3: Format identified transcript for the LLM ──
50speaker_transcript = "\n".join(
51 f"{u['speaker']}: {u['text']}" for u in identified["utterances"]
52)
53
54# ── Step 4: Generate meeting notes via LLM Gateway ──
55llm_response = requests.post(
56 "https://llm-gateway.assemblyai.com/v1/chat/completions",
57 headers=headers,
58 json={
59 "model": "claude-sonnet-4-5-20250929",
60 "messages": [
61 {
62 "role": "user",
63 "content": (
64 "You are a meeting notes assistant. Given the transcript below, produce:\n"
65 "1. A concise summary (3-5 sentences)\n"
66 "2. Key decisions made\n"
67 "3. Action items with owners (use speaker labels)\n\n"
68 f"Transcript:\n{speaker_transcript}"
69 ),
70 }
71 ],
72 "max_tokens": 2000,
73 },
74)
75llm_response.raise_for_status()
76
77print("=== Meeting Notes ===\n")
78print(llm_response.json()["choices"][0]["message"]["content"])
=== Meeting Notes ===
## Summary
The discussion covered the impact of Canadian wildfire smoke on US air quality.
Experts explained how particulate matter affects respiratory and cardiovascular
health. The group reviewed current air quality index readings and discussed
protective measures for affected communities.
## Key decisions
- Monitor AQI levels daily until smoke clears
- Issue public health advisories for sensitive groups
## Action items
- Alice: Compile daily AQI data for the affected regions
- Bob: Draft public advisory messaging for distribution
- Alice: Coordinate with local health departments on response protocols

Speaker Identification maps generic labels like “Speaker A” to real names. You can pass a list of known_values to guide identification, or omit it to let the model infer names from the conversation. Learn more in the Speaker Identification guide.


See the End-to-end examples overview for all available pipelines.