Tutorials

Summarize meetings with LLMs in 5 lines of Python code

Learn how to generate detailed, structured meeting summaries powered by LLMs like Claude 3.5 Sonnet

Summarize meetings with LLMs in 5 lines of Python code

In today's remote-first world, organizations conduct millions of virtual meetings daily, but crucial information often slips through the cracks. Important decisions get forgotten, action items go untracked, and valuable insights remain buried in recordings that nobody has time to review. These problems create a massive efficiency gap in how teams operate and collaborate.

In this tutorial, you'll learn how to use AssemblyAI's LeMUR framework to automatically capture and analyze your meetings, allowing you to turn hours of conversations into structured summaries, clear action items, and actionable insights - all powered by large language models.

Getting Started

To get started you'll need an AssemblyAI API key - you can get one here. The free offering comes hundreds of hours of free speech-to-text and access to audio intelligence models, but it doesn't yet include access to LeMUR, so you'll have to set up billing. You can check out our pricing page for more details.

You'll need to have Python installed on your system to follow along, so install it if you haven't already. Then install AssemblyAI's Python SDK, which will allow you to call the API from your Python code:

pip install -U assemblyai

Step 1: Run Speech-to-Text

Now you can move on to generating meeting summaries. Create a file called main.py and add the below lines of code to it, which import the AssemblyAI Python SDK and configure your API key. While we set the API key inline here for simplicity, you should store it securely in a configuration file or environment variable in production code, and never check it into source control.

import assemblyai as aai
aai.settings.api_key = "YOUR_API_KEY"

You can run speech-to-text on a file of your choice by creating a Transcriber object with the assemblyai library, and then using its transcribe method on the audio or video file you want to process. The file can be either a local filepath or a remote publicly-accessible URL, like the example file below. Add the following code to your main.py file:

MEETING_URL = "https://storage.googleapis.com/aai-web-samples/meeting.mp3"
transcript = aai.Transcriber().transcribe(MEETING_URL)

Step 2: Generate a meeting summary

Now that we have a transcript, we can prompt it with LLMs. To do this we first we need to create this prompt. Here's an example that generates a comprehensive meeting summary, guiding the LLM in analyzing your meeting transcript. Add these lines to your main.py file:

prompt = """
    Analyze this meeting transcript and provide a structured summary with the following:

    1. Meeting Overview
    - Meeting date and duration
    - List of participants (if mentioned)
    - Main objectives discussed

    1. Key Decisions
    - Document all final decisions made
    - Include any deadlines or timelines established
    - Note any budgets or resources allocated

    1. Action Items
    - List each action item with:
        * Assigned owner
        * Due date (if specified)
        * Dependencies or prerequisites
        * Current status (if mentioned)

    1. Discussion Topics
    - Summarize main points for each topic
    - Highlight any challenges or risks identified
    - Note any unresolved questions requiring follow-up

    1. Next Steps
    - Upcoming milestones
    - Scheduled follow-up meetings
    - Required preparations for next discussion

    ROLE: You are a professional meeting analyst focused on extracting actionable insights.

    FORMAT: Present the information in clear sections with bullet points for easy scanning.
    Keep descriptions concise but include specific details like names, dates, and numbers when mentioned.
    
    If any of these elements are not discussed in the meeting, note their absence rather than making assumptions.
""".strip()

Now that you have this prompt, you can submit it to LeMUR in one line of code through the lemur attribute of your transcript object. Add the following code to your main.py file, which runs your prompt using the task method, where you pass in the prompt and your chosen LLM to generate the meeting summary:

llm_output = transcript.lemur.task(
    prompt,
    final_model=aai.LemurModel.claude3_5_sonnet
)

print(llm_output.response)

Step 3: Run the code

Execute this script in your terminal by running python main.py. This will transcribe the meeting audio, analyze the transcript, and generate a structured meeting summary based on your prompt. The output will be printed to your console. For example, here is an example output for the example file used above:

Here's a structured summary of the meeting transcript:

1. Meeting Overview
- Date: February 18, 2021
- Participants mentioned: Eric Johnson, Sid, Lily, Mac, Christopher, Steve, Craig, Christy, Rob
- Main objectives: Engineering key review, discussing KPIs, metrics, and organizational changes

2. Key Decisions
- Break up the engineering key review into four department key reviews
- Implement a two-month rotation for department reviews
- Change the R&D wider MR Rate KPI to track percentage of total MRs that come from the community
- Measure S1/S2 SLO achievement based on open bugs rather than closed bugs

3. Action Items
- Lily: Work with Mac to transition to new community contribution KPI
- Mac: Provide an update on the Postgres replication issue in next week's infra key review
- Mac/Data team: Develop new measurement for average open bugs age
- Mac/Data team: Adjust metrics to measure percentage of open bugs within SLO
- Christopher: Continue monitoring narrow MR Rate and expect rebound in March

4. Discussion Topics

a) Department Key Reviews
- Proposal to split engineering review into development, quality, security, and UX
- Two-month rotation proposed to avoid adding too many meetings

b) R&D MR Rate Metrics
- Confusion about current R&D wider MR Rate calculation
- Decision to simplify and track percentage of MRs from community

c) Postgres Replication Issue
- Lag in data updates affecting February metrics
- Need for dedicated computational resources and potential database tuning

d) Defect Tracking and SLOs
- S1 defects at 80% SLO achievement, S2 at 60%
- Spike in mean time to close for S2 bugs noted

e) SUS (Satisfaction) Metric
- Smallest decline in Q4 compared to previous quarters
- Cautious optimism about trend, but continued monitoring needed

f) Narrow MR Rate
- Currently below target but higher than previous year
- Expectation to rebound in March after short February and power outages in Texas

5. Next Steps
- Implement new department key review structure
- Monitor effects of changes to KPI measurements
- Continue focus on improving security work prioritization
- Expect potential temporary jump in SLO achievement as backlog is cleared

Note: Specific due dates for action items were not mentioned in the transcript.

Available LLM models

LeMuR supports various language models. Here is the current list, but you can always check our Docs for the most up-to-date information:

  • claude3_5_sonnet: Claude 3.5 Sonnet is the most intelligent model to date, outperforming Claude 3 Opus on a wide range of evaluations, with the speed and cost of Claude 3 Sonnet.
  • claude3_opus: Claude 3 Opus is good at handling complex analysis, longer tasks with many steps, and higher-order math and coding tasks.
  • claude3_haiku: Claude 3 Haiku is the fastest model that can execute lightweight actions.
  • claude3_sonnet: Claude 3 Sonnet is a legacy model with a balanced combination of performance and speed for efficient, high-throughput tasks.
  • mistral7b: Mistral 7B is an open source model that works well for summarization and answering questions.

Customizing the summary

LLMs allow you to custom-tailor your summary formats, giving you the ability to tell you what information you want the LLM to focus on and extract, and how you want the result to be presented. Feel free to experiment with different prompts to generate summaries that suit your needs. Here are some examples to get you started:

Focus on Action Items

action_items_prompt = """
    Review the transcript and extract all action items:
    - Who is responsible
    - What needs to be done
    - When it's due
    - Current status
    
    Format as a clear, bulleted list.
"""

Technical Discussion Summary

technical_prompt = """
    Analyze this technical discussion and provide:
    - Technical decisions made
    - Architecture changes approved
    - Dependencies identified
    - Technical debt noted
    - System constraints discussed
    
    Include specific technical details mentioned.
"""

Project Status Report

status_prompt = """
    Generate a project status report including:
    - Overall project health
    - Milestones completed
    - Upcoming deadlines
    - Blocking issues
    - Resource needs
    - Risk assessment
"""

Best Practices and Tips

Prompt engineering

The quality of your meeting analysis largely depends on how well you structure your prompts. Think of your prompt as a detailed set of instructions for a highly capable assistant - the more specific and organized your requirements are, the better the results will be. Well-crafted prompts lead to consistent, actionable outputs that can be easily integrated into your team's workflow. When designing your prompts, consider including:

  • Clear formatting requirements (bullet points, sections, tables)
  • Specific categories of information to extract
  • Instructions for handling uncertainty or missing information
  • Guidelines for maintaining consistent terminology
  • Requirements for level of detail and technical depth

You can check out our crash course on prompt engineering if you're unfamiliar:

Audio quality

The foundation of LLM analysis is high-quality transcripts. One factor that affects transcription quality is audio quality - poor audio quality can cascade into speech-to-text errors, which then lead to incorrect or incomplete analysis by the LLM. While our Universal speech-to-text model is a best-in-class model, backed by comprehensive performance analyses, improving your audio capture can only improve results. Here are some tips for ensuring high-quality audio input:

  • Use high-quality microphones or headsets rated for voice clarity
  • Ensure all participants are in quiet environments with minimal echo
  • Test audio settings before important meetings
  • Record locally when possible to avoid internet connectivity issues
  • Request that participants mute when not speaking

Meeting structure

A well-structured meeting can improve the quality of automated analysis. By implementing consistent meeting protocols, you create patterns that LLMs can more easily recognize and process. This structure helps ensure that important information is clearly captured and that the resulting summaries are more accurate and actionable. Consider implementing these meeting best practices:

  • Begin with a clear agenda shared in advance
  • Start with brief participant introductions
  • Use consistent terminology for decisions and action items
  • Designate specific times for questions and discussion
  • End with a verbal summary of key points

Remember to use our Speaker Diarization service in your transcripts to automatically separate out speakers and attribute sentences accordingly, too.

Remember that these practices work together - good audio quality with poor meeting structure, or well-structured meetings with unclear prompts, will still result in suboptimal outcomes. You will find the most success in implementing these best practices as a cohesive system.

Next Steps

To learn more about how to use our API and the features it offers, check out our Docs, or check out our cookbooks repository to browse solutions for common use cases. Alternatively, check out our blog for tutorials and deep-dives on AI theory, like this Introduction to LLMs, or our YouTube channel for project tutorials and more, like this one on building an AI voice agent in Python with DeepSeek R1: