date-event-extraction
Published
Public
in @structured-extraction

Extract scheduled events from natural-language text with resolved ISO 8601 start/end times. Relative dates ("next Tuesday", "tomorrow at 3") are resolved against a reference date and IANA timezone you supply. Returns title, start, end, all-day flag, and location per event.

date-event-extraction

Pull scheduled events out of natural-language text — emails, messages, notes — with fully resolved ISO 8601 times. Relative expressions like "next Tuesday" or "tomorrow at 3pm" are resolved against a reference date and timezone you provide, so you get absolute timestamps ready to drop into a calendar.

Entrypoints

EntrypointRendersInputs
systemPromptInstructions, resolution context + embedded schemareferenceDate, timezone
userPromptThe delimited text to scantext

Variables

  • text (string, required) — the text to scan for events.
  • referenceDate (string, required) — anchor for relative dates, ISO 8601 (e.g. "2026-06-15"). Usually pass the caller's "today".
  • timezone (string, required) — IANA timezone (e.g. "America/New_York") used to interpret clock times and emit offsets.

Both referenceDate and timezone are required — relative-date resolution is meaningless without them. Pass your runtime's current date and the user's timezone.

Output

{
  "reasoning": "Resolved 'next Monday' to 2026-06-22 in America/New_York; standup has a clock time, the offsite is all-day.",
  "events": [
    {
      "title": "Sprint standup",
      "start": "2026-06-22T09:30:00-04:00",
      "end": null,
      "all_day": false,
      "location": "Zoom"
    },
    {
      "title": "Team offsite",
      "start": "2026-06-25",
      "end": null,
      "all_day": true,
      "location": null
    }
  ]
}
  • reasoning first (house convention), and it states how relative dates were resolved — handy for debugging.
  • start is a zoned datetime when a clock time is known, otherwise a plain date with all_day: true.
  • No invented events — only what's stated; empty events array when there's nothing schedulable.

House conventions

  • Triple-mustache for text.
  • Caller-supplied reference date + timezone — the prompt never assumes "now" or a default zone, which keeps it deterministic and testable.
  • Strict schemaadditionalProperties: false, explicit nulls.

Notes

Verified by local render. Suggested default claude-sonnet-4-6 at temperature: 0. The model resolves dates by reasoning, not a calendar library — for high-stakes scheduling, validate the returned ISO strings before writing to a calendar.

@sufleur/