on
Responding to recruiter emails with GPT-3
If you’re just interested in the code, here it is.
Like many software engineers, each week I receive multiple emails from recruiters.
I’m grateful to work in a field with such opportunities, and I know that receiving a lot offers to interview is a good problem to have. But, practically, most of the time I’m not looking for a new job, and so handling all these emails is a recurring administrative task.
Here’s an example thread that I neglected to respond to:
I do try to respond to all recruiter emails with a short message that pretty much always follows a format like:
Hi <recruiter name>,
Thanks for reaching out! I’m not interested at this time, but I’ll keep <your company> in mind.
- Matt
There are a few reasons that I respond to these emails (rather than merely ignore them):
- It’s polite
- If I don’t respond, the recruiter will often send multiple follow-up emails
- Maintaining a cordial relationship with the recruiters is in my best interest for future job searches
I use some rough email filtering rules to funnel recruiter emails to an email folder. Then, when I have time, I go through the list of unreads and send my little response.
It would be ideal if I could automate sending these responses. Assuming I get four such emails per week and that it takes two minutes to read and respond to each one, automating this would save me about seven hours of administrative work per year.
A trivial approach would be to send a canned response. But a touch of personalization would aid in my goal of maintaining a good relationship with the recruiter.
Extracting the name of the recruiter and their company from the email using a rule-based approach / trying to parse the text would be really tricky and error prone. Luckily, OpenAI’s GPT-3 language model is quite good at processing this email.
Using the GPT-3 API, we can provide the recruiter’s email along with an example, and extract the required information. It can even format the output as JSON.
Here’s an example from the OpenAI Playground.
With the recruiter’s name and company in hand, responding is just a matter of interpolating those variables into the body of my standard response template:
response = f"""\
Hi {recruiter_name or ""},
Thanks for reaching out! I'm not interested in new opportunities at this time, but I'll keep {recruiter_company or "your company"} in mind for the future.
Thanks again,
{SIGNATURE}
"""
IMAP and SMTP are used to interface with the mailbox. The rest of the code can be found in this repo.
This solution worked well for the handful of emails I tried it on. I’m planning to run this on a cron to save myself some time and automatically maintain recruiter relationships.