Extracting Action Items from Meeting Transcripts

In this tutorial, you’ll learn how to build a BAML function that automatically extracts structured action items from meeting transcripts. By the end, you’ll have a working system that can identify tasks, assignees, priorities, subtasks, and dependencies.

Prerequisites

  • Basic understanding of BAML syntax
  • An OpenAI API key configured in your environment

Step 1: Define the Data Models

First, let’s define the data structures for our tasks. Create a new BAML file called action_items.baml and add these class definitions:

action_items.baml
1class Subtask {
2 id int
3 name string
4}
5
6enum Priority {
7 HIGH
8 MEDIUM
9 LOW
10}
11
12class Ticket {
13 id int
14 name string
15 description string
16 priority Priority
17 assignees string[]
18 subtasks Subtask[]
19 dependencies int[]
20}

These models define:

  • A Subtask class for breaking down larger tasks
  • A Priority enum for task urgency levels
  • A Ticket class that represents a complete task with all its metadata

Step 2: Create the Task Extraction Function

Next, we’ll create a function that uses GPT-4 to analyze meeting transcripts and extract tasks:

action_items.baml
1function ExtractTasks(transcript: string) -> Ticket[] {
2 client "openai/gpt-4"
3 prompt #"
4 You are an expert at analyzing meeting transcripts and extracting structured action items and tasks.
5 Extract all action items, tasks and subtasks from the meeting transcript below.
6 For each task:
7 - Generate a unique ID
8 - Include who is assigned to it
9 - Set appropriate priority level
10 - Identify subtasks if any
11 - Note any dependencies on other tasks
12
13 {{ ctx.output_format }}
14
15 {{ _.role("user") }} {{ transcript }}
16 "#
17}

This function:

  • Takes a meeting transcript as input
  • Returns an array of Ticket objects
  • Uses GPT-4 to analyze the transcript
  • Includes clear instructions in the prompt for task extraction

Step 3: Test the Implementation

Let’s add test cases to verify our implementation works correctly. Add these test cases to your BAML file:

action_items.baml
1test SimpleTranscript {
2 functions [ExtractTasks]
3 args {
4 transcript #"
5 Alice: We need to update the website by next week. This is high priority.
6 Bob: I can handle that. I'll need Carol's help with the design though.
7 Carol: Sure, I can help with the design part.
8 "#
9 }
10}
11
12test ComplexTranscript {
13 functions [ExtractTasks]
14 args {
15 transcript #"
16 Alice: Hey team, we have several critical tasks we need to tackle for the upcoming release. First, we need to work on improving the authentication system. It's a top priority.
17 Bob: Got it, Alice. I can take the lead on the authentication improvements. Are there any specific areas you want me to focus on?
18 Alice: Good question, Bob. We need both a front-end revamp and back-end optimization. So basically, two sub-tasks.
19 Carol: I can help with the front-end part of the authentication system.
20 Bob: Great, Carol. I'll handle the back-end optimization then.
21 Alice: Perfect. Now, after the authentication system is improved, we have to integrate it with our new billing system. That's a medium priority task.
22 Carol: Is the new billing system already in place?
23 Alice: No, it's actually another task. So it's a dependency for the integration task. Bob, can you also handle the billing system?
24 Bob: Sure, but I'll need to complete the back-end optimization of the authentication system first, so it's dependent on that.
25 Alice: Understood. Lastly, we also need to update our user documentation to reflect all these changes. It's a low-priority task but still important.
26 Carol: I can take that on once the front-end changes for the authentication system are done. So, it would be dependent on that.
27 Alice: Sounds like a plan. Let's get these tasks modeled out and get started.
28 "#
29 }
30}

These tests provide:

  • A simple case with a single task and subtask
  • A complex case with multiple tasks, priorities, dependencies, and assignees

This is what you see in the BAML playground:

This is the output from the complex test case:

1[
2 {
3 "id": 1,
4 "name": "Improve Authentication System",
5 "description": "Overhaul the authentication system focusing on both front-end and back-end aspects.",
6 "priority": "HIGH",
7 "assignees": ["Bob", "Carol"],
8 "subtasks": [
9 {
10 "id": 2,
11 "name": "Front-end Revamp"
12 },
13 {
14 "id": 3,
15 "name": "Back-end Optimization"
16 }
17 ],
18 "dependencies": []
19 },
20 {
21 "id": 4,
22 "name": "Develop Billing System",
23 "description": "Create a new billing system which will be integrated with the authentication system.",
24 "priority": "MEDIUM",
25 "assignees": ["Bob"],
26 "subtasks": [],
27 "dependencies": [3]
28 },
29 {
30 "id": 5,
31 "name": "Integrate Authentication System with Billing System",
32 "description": "Integrate the improved authentication system with the new billing system.",
33 "priority": "MEDIUM",
34 "assignees": ["Bob"],
35 "subtasks": [],
36 "dependencies": [3, 4]
37 },
38 {
39 "id": 6,
40 "name": "Update User Documentation",
41 "description": "Update the user documentation to reflect changes in the authentication and billing systems.",
42 "priority": "LOW",
43 "assignees": ["Carol"],
44 "subtasks": [],
45 "dependencies": [2, 5]
46 }
47]

What’s Next?

You can enhance this implementation by:

  • Adding due dates to the Ticket class
  • Including status tracking for tasks
  • Adding validation for task dependencies
  • Implementing custom formatting for the extracted tasks

Common Issues and Solutions

  • If tasks aren’t being properly identified, try adjusting the prompt to be more specific
  • If priorities aren’t being set correctly, consider adding examples in the prompt
  • For complex transcripts, you might need to adjust the model parameters for better results