How to use AI to automatically extract data from emails


Hello everybody. My name is Yohei with Untapped Capital. We are an early stage VC firm that uses lots of AI and automation to operate smarter and faster. Today, I get to share Deals McDealface, one of our AI automations that we use at our firm. 

Fun fact, I started using OpenAI in my Zapier workflows in November of 2022, a month before ChatGPT came out, using an unofficial integration that I built, which eventually became the official OpenAI Zapier integration

We use lots of Zapier workflows at our firm, many of which have OpenAI or ChatGPT in the workflows. So I’m excited to share this one with you. Let’s dive in. 

As a VC, we get lots of emails like this, right? Check out this company, Paperclip Maker. They make automated factories, da dah, dah da. This needs to go in our CRM.

So, let’s automate it. I’ll go through each step by step, but just to give you the overview. When Deals McDealsface gets a new email, we’ll strip the forwarding header, we’ll extract the data. We’ll then find the people and orgs that we want to map the data to, and then we’ll create the deal record. 

Let’s dive in. So when we get the email, any of our team members can just forward it to deals@untapped.vc. When we get a new email, if it’s from a team member, this prevents spam and other people being able to use it, Zapier reads the email for us. Then we’ll use Formatter because every email that deals@ receives is forwarded from a team member, we know that there’s this little forwarded dash at the top, so we just strip it out and we get the data we need right here. A little confusing that I’m both the referrer here and the actual team member, so ignore that.

Then we use ChatGPT to extract the structured data to get what we need. And we get to just type in a whole bunch of variables that we want here with a little description of the kind of info that we want and context. Here’s an email regarding an investment opportunity and so on. 

Now, here’s a note on the extract structured data piece. For each variable, we get to write a description of that variable, which helps ChatGPT decide what to extract, whether or not it’s required true or false, the string type, and then, optionally, we can give variable choices if we want to make sure that the sender type is either a founder or referer. Or you can not provide those options if you want to keep it more open ended. 

Now, once we’ve extracted that data, let’s check it. Boom. So we have all of this data extracted returned as individual variables, right? Company founders team is all AI founders, as in they are actually AI. Perfect, right? That’s exactly what we have in the email here. 

So, next step, because we’re only three down, we’ve got four more steps to go. We’re going to map it to the Airtable now. 

Because we’re throwing it into our CRM. First thing we’re going to do is look for the sender in our Airtable by the email address. If they don’t exist, we’ll create them. And then we will grab the ID here because we’re going to use the ID to map it. 

And then we’ll do a quick code step to extract the domain from the URL. We use the domain as the ID in our CRM. So that’s what we do here, which allows us to find the org in our table to see if that startup already exists because we don’t want to add the whole startup if it exists, we just want to grab the ID. If it doesn’t exist, we’ll create the startup and grab the ID. 

And then at the next step, we can now create the deal record. We will add data from the extraction step. We’ll add some raw data from the email, like attachments and the raw email data. And then we’ll use the IDs from the search-and-create step to map it to people and organizations. 

Boom, that’s seven steps done. And if we look in our error table, you see Paperclip Makers, see the website, you see amount raising, traction, you see the raw email data, and so on. 

I love this kind of AI-based email automation. We have one for updates at Untapped VC as well, where we forward update emails from founders and it grabs asks, challenges, runway traction, and so on.

Thanks for letting me share. You can follow me on Twitter @yoheikojima, learn about our firm at untapped.vc, or check out my build-in-public log at yohei.me, where I share a lot of my no-code and code builds. Thanks again for having me. 



Leave a Reply

Your email address will not be published. Required fields are marked *