Guide

Extract Meetings and Contacts From Email

An AI agent reads an email, pulls the meeting time and the sender's contact details with a model, and writes a calendar event plus a new contact record.

Written by Aaron de Mello Senior Engineering Manager

VerifiedCLI 3.1.20 · Nylas managed · last tested June 14, 2026

How does an AI agent extract meetings and contacts from an email?

The agent reads an inbound message, passes the body to a model that returns two structured entities — a meeting and a contact — and writes each to the calendar and contacts. A single “Can we meet Thursday at 2pm? — Dana, VP Sales, Globex” email becomes a calendar event and a saved contact without anyone retyping the details. The model does the reading; code does the writing.

One email passes through a model that extracts two entities — a meeting and a contact — which become a calendar event and a contact recordEmailemail listModelextract entitiesCalendar eventevents createContact recordcontacts create

Both entities come from one pass over the same message, which is the efficiency gain. Manually copying a proposed time into the calendar and the sender into contacts takes a minute or two per email; the agent does both in under 2 seconds and never forgets the second step. This is body-text extraction, not signature parsing — for deep signature enrichment, see the guide linked at the end.

How does the model pull a meeting and a contact from one message?

Give the model one schema with both entities and it fills them in a single call. You define the meeting fields (title, start, end, attendees) and the contact fields (name, email, company, title), and the model returns one JSON object holding both. Asking for both at once costs one model call instead of two and keeps the meeting and the person linked.

{
  "meeting": {
    "title": "Globex / Acme sync",
    "start": "2026-06-18T14:00:00",
    "end": "2026-06-18T14:30:00",
    "attendees": ["dana@globex.com"]
  },
  "contact": {
    "name": "Dana Reyes",
    "email": "dana@globex.com",
    "company": "Globex",
    "title": "VP Sales"
  }
}

Validate before writing. If the model returns a start time it can't parse or a meeting with no attendee, route that email to a human instead of creating a malformed event. Roughly 1 in 20 free-text scheduling emails is ambiguous enough to need that fallback.

How do you create the calendar event?

Feed the extracted meeting fields to nylas calendar events create. The command takes a title, a start, an end, and participants, and writes the event to the agent's calendar in one call. The times follow the same calendar model as the iCalendar standard, RFC 5545, so a 30-minute slot maps cleanly to a start and end.

# Create the event from the extracted meeting fields
nylas calendar events create \
  --title "Globex / Acme sync" \
  --start "2026-06-18T14:00:00Z" \
  --end "2026-06-18T14:30:00Z" \
  --participant dana@globex.com

How do you create the contact?

Write the extracted person to nylas contacts create with their name and email. The contact model mirrors the vCard standard, RFC 6350, so name and email are the two fields you always have. Check for an existing contact with that email first so a repeat sender doesn't create a second record.

# Create the contact from the extracted person
nylas contacts create \
  --first-name "Dana" \
  --last-name "Reyes" \
  --email dana@globex.com

This guide creates a contact from a single email's body. To go deeper — mining job titles, phone numbers, and company data out of signature blocks across many emails — pair it with the signature-enrichment guide linked below, which handles the regex-heavy extraction this skips.

How do you keep extraction safe and accurate?

An inbound email is untrusted content, so a scheduling message can carry text that tries to steer the model — the prompt-injection risk (OWASP LLM01) that tops the LLM threat list. Treat the extracted JSON as data to validate, never as a command. A model that “decides” to invite 50 people is a parsing error you catch by capping attendees in code.

Accuracy comes from validation, not trust. Parse every date, confirm the email is a real address, and require a human review for any event where the model's confidence is low. Running the agent on a dedicated inbox keeps the blast radius to its own calendar and contacts, so a bad extraction can't corrupt a person's real schedule.

Next steps