> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashduty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IM Platform

> AI SRE is IM-native — mention it in a Slack, Lark, DingTalk, or WeCom group or DM to start or continue an investigation; it replies in-thread. When a war room is opened for an incident, it also runs an automatic preliminary diagnosis and posts the findings back.

<Info>
  **Private beta**: AI SRE is currently in private beta. Pro or higher accounts can apply for free beta access through the [AI SRE private beta application form](https://c9xudyniiq.feishu.cn/share/base/form/shrcn0ngCfdoygiaHnAT80BfZiH); after approval, Flashduty will add your account to the whitelist. Features and the UI may change during the beta.
</Info>

## Overview

***

Incident response usually happens right inside your IM group — alerts come in, the team discusses in the channel, and someone spins up a war room. AI SRE puts the agent directly into that collaboration chain: **you never have to switch to the console; you can summon it from IM to investigate**, and your teammates can follow every step of its analysis in real time.

AI SRE's IM integration has two trigger modes:

<CardGroup cols={2}>
  <Card title="@Mention Summon" icon="at">
    **@mention AI SRE** in a group chat or DM and describe the problem to start or continue an investigation. It replies **in-thread**, and the conversation context is tied to that IM session.
  </Card>

  <Card title="War Room Auto-Diagnosis" icon="people-group">
    When an IM war room is opened for an incident, AI SRE **automatically runs a preliminary diagnosis** and posts the findings as an analysis message back to the war room — no one needs to manually summon it.
  </Card>
</CardGroup>

## Supported IM Platforms

***

AI SRE's IM interaction covers four major platforms. Each platform supports inbound @mentions (webhook), historical message reads, and outbound replies:

| Platform      | Group @mention | Direct message (DM) | War room auto-diagnosis |
| ------------- | -------------- | ------------------- | ----------------------- |
| Slack         | ✅              | ✅                   | ✅                       |
| Lark / Feishu | ✅              | ✅                   | ✅                       |
| DingTalk      | ✅              | ✅                   | ✅                       |
| WeCom         | ✅              | ✅                   | ✅                       |

<Note>
  IM interaction requires that you have already connected the corresponding platform's bot in Flashduty (the same IM bot used for alert notifications and collaboration). Complete the bot configuration in Flashduty's IM integration first — only then can AI SRE send and receive messages on that platform.
</Note>

## @Mention Summon

***

In a connected IM group, **@mention the bot** and type your question (for example, "@AI SRE check why the payment service's 5xx rate is spiking") — the message is forwarded to AI SRE for processing via the platform webhook:

<Steps>
  <Step title="Detect the mention">
    The platform distinguishes between **group @mentions** and **direct messages**. Once mentioned, AI SRE deduplicates the event and determines whether the message contains an imperative instruction.
  </Step>

  <Step title="Bind to a session">
    AI SRE locates a session using "account + platform + chat" as the key: multiple @mentions within the same IM chat are routed to the **same agent session**, preserving context. For a new chat, the platform supplies the opening message of that IM thread and any associated incident as initial context.
  </Step>

  <Step title="Read context and reply">
    AI SRE reads the thread / chat history to build context, investigates autonomously, and posts its findings **in-thread**. Other people @mentioned in the original message are carried over into the reply, making it easy for multiple parties to collaborate in the group.
  </Step>
</Steps>

<Tip>
  The **reply mode** is configurable (off / first / all), controlling whether AI SRE @mentions the person who asked, and whether it replies **in-thread** or in the main channel. In a busy large group, in-thread replies keep the investigation discussion focused without flooding the channel.
</Tip>

## War Room Auto-Diagnosis

***

When you open a **war room** for an incident in IM, AI SRE intervenes **automatically** — no one needs to @mention it:

<Steps>
  <Step title="Create the war room">
    Create a war room (Lark / DingTalk / WeCom / Slack group) as part of the incident collaboration workflow.
  </Step>

  <Step title="Trigger diagnosis in the background">
    Once the war room is created, the platform triggers a preliminary diagnosis as a **non-blocking background task**, so AI SRE enters the investigation with the full context of that incident.
  </Step>

  <Step title="Post the findings">
    When the diagnosis is complete, AI SRE sends the analysis results as a message back to the war room. Before anyone has started investigating manually, the first-cut analysis is already in the group.
  </Step>
</Steps>

<Note>
  War room auto-diagnosis is bound to the incident context: when the investigation begins, the corresponding `incident_id` is attached to the run so AI SRE can read the incident details, timeline, and recent changes. For details on how incidents / war rooms interact with A2A, see [Agent · Incident & War Room Integration](/en/ai-sre/agents#incident-and-war-room-integration).
</Note>

## In-session Switch Commands

***

IM sessions have no picker UI like the console, but they support two slash commands that let you **switch bindings mid-conversation** — neither command is available for console sessions, whose environment and team bindings are set at creation and cannot be changed afterwards.

### /env — Switch Runner Environment

Send `/env <runner-name>` to the bot in a group or DM to rebind the current IM session to a different online BYOC runner. The conversation history and context are preserved in full. After the switch, the previous environment's working directory is no longer accessible: files created or modified during the conversation in the old environment are gone, and skill and knowledge files are re-staged in the new environment on demand.

<Note>
  The switch takes effect after the current turn completes and before the next message is processed — it does not interrupt a tool call that is already running. If the target runner is offline or not found, the command returns an error immediately and the binding remains unchanged.
</Note>

### /scope — Switch Team Scope

Send `/scope <team-name>` (or `/scope personal` to return to personal scope) to rebind the current IM session to a different team without ending the conversation. Team binding is a **usage operation**: any account member can bind a session to any team in the account — this matches the war-room pattern where responders are often not members of the incident's team.

After the switch, AI SRE:

1. Refreshes the memory snapshot for the new team scope (memories from the previous team scope no longer apply to this session).
2. Queues the new team's knowledge bundle to be mounted and injected into context when the next message is processed.

<Note>
  Knowledge bundles already mounted into this session are not removed — mounts are conversation-scoped, so switching back to a previously-mounted team will not duplicate the mount reminder.
</Note>

## Relationship to Console Sessions

***

Whether you start a session from IM or the console, it's **the same AI SRE**: messages are handled one at a time, with streaming output, automatic context compaction for long conversations, and optional team and environment bindings. The only difference is the entry point —

* **Console**: ask questions one at a time in the **Chat** workspace and view the full tool-call and sub-session panels; environment and team bindings are fixed at creation and cannot be changed.
* **IM**: @mention it in the group where your team already works; findings are posted back to the thread. Use `/env` and `/scope` to switch bindings mid-conversation. Great for grabbing a quick analysis at the incident scene, then diving deeper in the console.

For more about sessions, see [Conversations](/en/ai-sre/sessions).

## Related Pages

***

<CardGroup cols={2}>
  <Card title="Overview" icon="gauge-high" href="/en/ai-sre/overview">
    Learn about AI SRE's overall capabilities, typical use cases, and console navigation.
  </Card>

  <Card title="Console" icon="comments" href="/en/ai-sre/sessions">
    Learn about sessions, streaming output, cancellation, and context compaction.
  </Card>

  <Card title="Agent" icon="satellite-dish" href="/en/ai-sre/agents">
    Inbound Agent Card and incident / war room integration.
  </Card>

  <Card title="Usage Insights" icon="chart-line" href="/en/ai-sre/insight">
    Use /insight to review the past 30 days of sessions and surface operational friction.
  </Card>
</CardGroup>
