Hiro development journal

Replacing label import with Qwen email interpretation

Published Machine-readable JSON

Executive summary

The first Gmail importer incorrectly assumed that the mailbox owner would organize messages under dedicated task and reading labels.

The original design document was re-read and confirmed a different model: scan recent conversations, let an LLM decide what still requires action, identify saved reading, ignore non-actionable mail, and retain the result locally.

Hiro now scans recent non-spam Gmail conversations without requiring labels, includes the owner's sent replies as context, and asks local Qwen 9B to classify each conversation as task, reading, or ignore.

The same Qwen classification assigns every applicable tag from Hiro's controlled tag set, plus task priority. Deterministic source parsing continues to extract due dates and horizon from the conversation.

A controlled live run analyzed three conversations in approximately 7.4 seconds, created one tagged review reading item, ignored two non-actionable conversations, and changed no Gmail state.

Work completed

Workflow correction

Completed
  • Removed the Gmail-label requirement from the dashboard and import request.
  • Changed the import dialog to explain that Qwen reads recent conversations and decides whether each belongs in tasks, reading, or neither.
  • Added an advanced Gmail search query with a safe default covering recent mail while excluding spam and trash.
  • Changed one import run to populate both task and reading sections instead of depending on the currently selected dashboard tab.

Conversation ingestion

Completed
  • Gmail message search results are deduplicated by conversation before full threads are fetched.
  • Up to eight recent messages from each conversation are assembled into a bounded transcript.
  • Messages carrying Gmail's sent marker are explicitly identified as owner messages so the model can recognize actions already handled by a reply.
  • Each analyzed conversation receives a versioned external identifier based on the conversation and its newest message, allowing new replies to be reconsidered while preventing immediate duplicates.

Structured Qwen classification

Completed
  • The first free-form Qwen prompt consumed its response budget in hidden reasoning and produced no parseable classification.
  • The classifier was moved to LM Studio's schema-constrained JSON output mode.
  • The schema requires an exact classification, source-preserving identifier, title, concise notes, priority, reason, and a tag array restricted to Hiro's controlled tag vocabulary.
  • Hiro accepts structured JSON from either the ordinary response channel or the model's reasoning channel because this Qwen build emits schema-constrained output through the latter.
  • Tags are validated, normalized, deduplicated, and default to Other only when no specific allowed tag applies.

Review-first persistence

Completed
  • Tasks and reading items created by Qwen enter Review rather than becoming silently active.
  • Task due dates retain their source phrase and confidence, and due dates determine Current, Medium-term, Long-term, or Someday horizon.
  • Ignored conversations are still recorded as analyzed sources so repeated imports do not spend model time on the same mailbox state.
  • Gmail remains read-only: importing does not apply labels, mark messages read, archive, delete, or otherwise modify mailbox state.

Decisions and reasoning

Validation and evidence

CheckStatusResult
Focused importer and productivity tests passed Eleven tests passed, covering task, reading, ignore, multi-tag assignment, priority, due-date extraction, review-first state, incremental deduplication, authorization errors, and existing productivity behavior.
Synthetic structured classification passed Qwen classified a scheduling request as a high-priority family task and a saved article as a low-priority AI reading item in under four seconds.
Controlled live Gmail import passed Three recent conversations were analyzed in approximately 7.4 seconds; one tagged reading item was added to Review and two conversations were ignored.
Repeat live import passed The same three conversation versions were skipped without model analysis in approximately 1.3 seconds, and no duplicate items were created.
Private task dashboard passed The dashboard returned status 200 and exposed the corrected label-free import interface.

Current state

Next steps