How it works

Conversation Analysis — how it works

A precise account of what happens to a chat export, including the exact scoring rules — because this feature deliberately doesn't send your messages anywhere.

1. What you upload

A .txt chat export — the built-in “export chat” feature most messaging apps have (WhatsApp, Telegram, Signal and similar). Exporting without media keeps the file small and is all this feature reads regardless.

2. Where the analysis actually runs

Entirely in your browser tab. The file is read and scored on your own device — it is never uploaded to Migraine Today's servers or any third party, and no AI model reads it. This is a deliberate design choice, not an incidental one: message content is about as sensitive as data gets, so the trade-off is a transparent, keyword-and-pattern heuristic instead of the deeper (but privacy-costly) understanding an LLM could offer.

3. Parsing the export

A single regular expression recognizes the common export line formats — Android-style (25/07/2026, 14:32 - Name: text), iOS-style ([25/07/2026, 14:32:10] Name: text), and 12-hour US-locale exports. Because a date like 03/04/2026 is genuinely ambiguous (day/month or month/day) on its own, the file is scanned once for the first unambiguous date to decide which ordering the whole export uses, then that choice is applied consistently — a single export is always one locale.

Large exports (tens of thousands of lines) are parsed in batches of 5,000 lines, yielding back to the browser between batches so the tab stays responsive instead of freezing.

4. The exact signals, and their scoring

Messages are grouped by day, and each day is scored out of 100 from these independent signals:

  • Emotional language (English, German, Italian, Spanish, French keyword lists) — up to 40 points, 8 per message that matches.
  • Direct migraine/headache mention (same 5 languages) — up to 30 points, 10 per matching message.
  • Frequent exclamation marks (two or more !/? in a row) — up to 20 points, 5 per matching message.
  • Uppercase words (4+ letters, all caps) — up to 15 points, 5 per matching message.
  • Frequent texting — a flat 20 points, when a day has 20+ messages, or 10+ messages with rapid back-and-forth turn-taking.
  • Late-night texting — a flat 15 points, when 3 or more messages fall between 23:00 and 05:00.
  • A short inferred sleep window — a flat 15 points, when the gap between one day's last message and the next day-with-messages' first message is under 6 hours (see next section).

A day only appears in your results if at least one signal fired, an exercise mention was found, or a saved supplement was mentioned.

5. How stress level, sleep and exercise are suggested

Suggested stress level (1–5) is 2 plus the count of five specific patterns that coincided that day — frequent exclamation marks, frequent texting, uppercase text, late texts, and a short sleep window — capped at 5. One pattern alone reads as a mildly tense day; several together read as a clearly bad one.

Suggested sleep quality is flagged “poor” whenever any of those five patterns fired that day, short sleep included.

Suggested sleep hours comes from the same gap used for the short-sleep signal above: the time between your last message on one day and your first message on the next day messages exist for, used only when that gap is between 0 and 14 hours (a rough but real proxy for “how long before texting resumed”).

Suggested exercise type and supplements come from matching message text against Migraine Today's own exercise-type list and your own saved supplements/brands — not a separate hand-built keyword list, so a match already lines up with the exact field the Log tab would ask for.

6. What leaves your device

When you choose to save the analysis, only the compact per-day result — the score, which named signals fired, and the suggested field values — is sent to Migraine Today's server for storage. The raw message text, sender names, and the file itself never leave your browser tab at any point in this process.

7. How a flagged day becomes a diary entry

Nothing is written to your diary automatically. Each flagged day is shown as its own compact card with only the relevant suggested fields — exercise, stress, sleep quality, sleep hours, supplements — pre-filled but editable, alongside whatever's already logged for that date. You review and press Save per day; unreviewed days simply stay as suggestions.