Skip to content

Feature: AI Assistance

User Need

A shared inbox accumulates long threads: a customer mail, three internal comments, a colleague's reply, another customer mail. An agent picking up such a thread, or covering for someone on holiday, has to read all of it before they can act. Threads also arrive in languages nobody on the shift reads.

AI Assistance addresses both: summarize what a thread (or a single message) is about, translate messages into the reader's language, and draft a reply to work from. It builds on the App Suite ai-service, the same backend the core ai-web plugin uses, so operators configure one AI deployment for App Suite and Teams together.

User Stories

  • As an agent picking up an unassigned thread with 12 messages, I want a two-sentence summary so I know what it's about before reading it.
  • As an agent covering a colleague's inbox, I want the summary to include my colleagues' internal comments, not just the customer's mails, so I see what the team already decided.
  • As a German-speaking agent, I want a French customer mail to offer me a translation without my having to go looking for the option.
  • As an agent who reads Italian fine, I want to tell Teams to stop offering me Italian translations.
  • As an agent writing a routine reply, I want a first draft I can edit rather than a blank compose box.

Concrete Scenarios

Scenario A — Handover: An agent returns from holiday to a thread with 8 mails and 4 internal comments. "Summarize thread" returns two sentences covering both the customer's escalation and the team's decision to offer a refund, so they reply without re-reading the whole timeline.

Scenario B — One long mail: A customer forwards a mail with a quoted chain of five replies. The agent uses "Summarize" on that one message and gets a per-person breakdown of who said what and when.

Scenario C — Unexpected language: A French mail lands in a German team's inbox. Teams detects the language locally and offers "Translate to German" above the message. The agent accepts, the translation replaces the body, and "Show original" puts it back.

Scenario D — Opting out: The same agent reads Italian and clicks "Never" on an Italian mail. Teams stops offering Italian translations for that user, on every device.

Design

Availability

Teams hides every AI menu and band unless the deployment has AI enabled. The service base URL comes from the same io.ox/core//ai/baseURL jslob the core ai-web plugin reads, so operators configure one value per environment. The list of translation languages comes from the service's own config, with an operator override (ai/supportedLanguages) and a built-in fallback list.

Being enabled is not the same as being reachable. Teams probes the service config when the first AI menu appears; if that request fails, whether by network error or an error status, the menus, the summary band and the translation offers disappear as if the deployment had no AI at all, instead of offering actions that can only fail. The probe is not repeated for a minute, and the failure is reported once per outage rather than once per opened message. The next menu to appear after that minute probes again, and a success brings every AI affordance back without a reload.

Requests carry the user's JWT, stream their result token by token, and time out after 120 s.

Two summarize scopes

There are two summarize entry points, and they mean different things:

Entry pointWhereCovers
Summarize✨ menu on a single messageThat one message, including its quoted reply chain if it has one
Summarize thread✨ menu in the thread top barThe complete thread: subject, every mail body with its sender, and every internal comment, in timeline order

Translation, by contrast, has only one scope. See below.

A thread summary is only meaningful over the complete thread. A summary of just the newest mail, or just the first, is not a thread summary. That is the per-message summarize, which already exists one menu up.

That has a concrete consequence for how Teams calls the service. The ai-service POST /query/summarize payload accepts both content and an email context object, and it branches on the presence of email: when the field is set it swaps in an email-shaped prompt built from email.content and ignores content entirely. So:

  • The per-message summarize sends email. It really is summarizing one message, so the email prompt is the right one. When that message contains a quoted chain, the service returns a per-person DD.MM. HH:mm NAME: breakdown.
  • The thread summary must not send email in any form. Not even an empty object, which is truthy and takes the same branch. It sends the assembled thread as content only.

Getting this wrong fails quietly. Teams gathers the whole thread, the service throws it away, and the summary describes one message while looking like it describes the thread. On a comment-only thread it gets worse: the answer comes back as "this email contains no text", because the service handed the model an email with an empty body while the comments sat in a field that prompt never reads.

Summary presentation

Both summaries render as an inline AI band above the content: gradient icon gutter, the summary text in a panel, an animated strip while streaming, and a close button. Thread summaries add stop and regenerate controls. Every summary carries the disclaimer "Generated by AI. Please verify important details." A thread with nothing to summarize reports that rather than asking the service.

Translation is per message only

Translation is offered on mails, from a message's own ✨ menu. The translation replaces the rendered body, the message header marks it as translated, and "Show original" reverts it.

There is deliberately no whole-thread translation, and internal comments are never machine-translated. A thread mixes two kinds of content: mails, whose authors are outside the team and may write in any language, and comments, which the team writes for itself in a language it already shares. Translating the second kind buys nothing and costs an AI request per comment. Core ai-web reaches the same conclusion by construction: its translation bar is per message, and it has no thread scope at all.

Because translation is inline and per message, a thread of foreign-language mails shows one bar per mail. That is intended, and it is where Teams looks different from App Suite mail without behaving differently: ai-web hides the bar on a collapsed message, and App Suite collapses a thread's mails by default, so only the open one carries a bar. Teams keeps mails expanded in the timeline, because reading a thread is the point of the view. Same per-message design, more of it on screen.

Proactive translation offers

Teams detects each message's language locally, using a word-frequency heuristic ported from core ai-web that covers German, English, French, Spanish and Italian. When the detected language differs from the user's UI language, Teams offers a translation. Detection needs more than five words and a clear enough match; anything ambiguous counts as unknown and offers nothing. Detecting a language never calls the AI service.

The offer is a band above the message: translate, Always, Never, or dismiss. Dismiss applies to this message only. Always appears only where the deployment supports auto-translate.

Both choices are recorded against the source language under ai/features/translate/languages/<code> in core settings, the same key the core ai-web plugin writes and its AI settings pane maintains. false is the "Never ask to translate these languages" list; true is the auto-translate list. Teams consumes that setting rather than keeping its own, so a choice made in App Suite mail applies in Teams and the reverse, and the AI settings pane is where users undo either one.

Auto-translate

A language marked Always translates on open, with no offer step: the band goes straight to its streaming state and then to "Translated to X", with "Show original" as the way back.

Two gates. The deployment must support it — Teams reads features.autoTranslate from the ai-service config, which is what core ai-web's ai-autotranslate flag resolves to, so both agree without a second source of truth. Until that config loads, Teams offers rather than translates; being wrong in that direction costs a click instead of an unasked-for request. And auto-translate never runs on spam or trash. It sends a body to the AI service without anyone asking for it, and unsolicited mail is the last thing to forward on. Manual translation still works there.

Reply drafting

The ✨ menu on a message offers a generated reply and two quick answers ("thanks", "later"). Generated text seeds the reply target, either a collaborative shared draft or the classic App Suite compose window when the team is in classic compose mode. It never writes into the internal comment box, which stays human-only. Teams generates replies in the user's UI language and signs them with the user's first name.

Acceptance Criteria

  • Every AI menu and band is hidden when the deployment has no AI service configured
  • Every AI menu and band is hidden while the configured AI service is unreachable, and returns once a later probe succeeds
  • An unreachable service is probed at most once a minute and reported once per outage
  • "Summarize thread" summarizes the complete thread: subject, all mail bodies, and all internal comments
  • A thread containing only comments and no mail still produces a summary
  • "Summarize" on a message summarizes that message alone
  • Summaries stream, can be stopped and regenerated, and carry an AI disclaimer
  • Translating a message replaces its body and offers "Show original"
  • No UI translates a whole thread, and comments are never machine-translated
  • A language marked "Always" translates on open, without an offer step
  • "Always" is hidden, and auto-translate never runs, when the deployment lacks the feature
  • Auto-translate never runs on spam or trash; manual translation still does
  • A message in a language other than the user's proactively offers a translation
  • "Never" stops offers for that source language and persists across devices
  • "Never" reads and writes the same core setting as the ai-web plugin, so choices carry both ways
  • Language detection runs locally, with no request to the AI service
  • Generated replies seed the draft or compose target, never the comment box

Edge Cases

  • Empty message body: Summarize and translate report that there is nothing to work on instead of sending an empty request.
  • Short or mixed-language messages: Detection returns unknown and Teams offers nothing. Users can still translate from the ✨ menu.
  • Switching threads mid-request: Teams cancels in-flight requests and drops any stale summary or translation.
  • Service failure: The band shows the error instead of leaving the original text with no explanation. Teams reports real service failures (5xx, timeout, network) to Sentry, but not user cancellations.
  • Language names: Each code has two names. What the user reads is localized ("Übersetzen nach Deutsch"); what goes in the request body is always the English name, because the service builds an English prompt around it. Menus emit the code and the English name is resolved at the request boundary, so the localized one cannot leak into a prompt. Core ai-web keeps two hardcoded tables for the same reason; Teams derives both from Intl.
  • Undoing "Never": Teams ships no settings pane. Users remove a language from the list in App Suite's AI settings, which writes the same setting.