AI & MLLLMFlaskMicrosoft Graph APIOutlookPython

From Messy Event Text to a Reviewable Calendar Draft

Event information often arrives as a paragraph: a message, an announcement, or a note containing a date, a time, a place, and several unrelated details. Turning that into a calendar entry is repetitive, but letting a model write directly to a calendar would make mistakes harder to catch.

For a project that turns unstructured event text into calendar entries, I put a review step between interpretation and action. The local Flask app extracts a structured event draft, normalizes and validates it, and lets the user edit the result before creating an Outlook event through Microsoft Graph.

The workflow

The user pastes event text into a browser. The LLM extracts candidate fields into draft JSON. Conventional application code then handles normalization and validation, and the preview page shows what would be created.

The project separates these responsibilities into extraction, normalization, Graph, and duplicate-check services, with a Pydantic schema describing the event data.

That separation makes a mistaken date easier to investigate. Did the model misread the message, did normalization choose an unintended default, or did the user approve an incomplete draft?

Time and ambiguity

An event can look complete while still missing important context. “Friday at six” requires a date and a time zone. An announcement may give a start time without an end time or mention several dates for different purposes.

The model can propose an interpretation, but the preview should make those choices visible. Deterministic validation can reject malformed fields; a person still needs to resolve meaning that the original text leaves ambiguous.

For illustration, a synthetic message such as “Library workshop, 12 March 2027, 6–7 pm, Toronto” has a much clearer review target than “the workshop next Friday.” These are example inputs, not records taken from my calendar.

Duplicate warnings and the final write

The optional duplicate check compares nearby Outlook events by subject, time, and location. Its warnings are non-blocking, which makes sense for cases where two similar events are legitimate.

Only the approved draft proceeds to the Graph event-creation operation. The documented first version leaves attendee invitations disabled by default and excludes recurring events from scope.

Why this pattern is useful

The model handles messy language; the application owns the schema, validation, preview, and external write. That is a useful division of responsibility for other tasks involving extracted information and consequential actions.

The app is documented locally. This post describes its design and implemented workflow without implying a public deployment.

Related post