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

# Elementary Agent in Slack

Tag `@Elementary` in a Slack thread to ask the agent a question, and it answers in that thread. When you ask in the thread of an Elementary alert, the agent already knows which incident the alert refers to, so you can go straight to "why did this fail?" without repeating any context.

It is the same agent as in the web app, backed by the same [Context Engine](/cloud/ai-agents/context-engine), so it can investigate incidents, trace root causes, explain lineage, and check test coverage. Actions that change anything still go through a pull request or an explicit confirmation.

## How it works

<Steps>
  <Step title="Mention the agent">
    Tag `@Elementary` in an alert thread, in any channel the app can post to, or in a direct message. The first time it is mentioned in a public channel, the app joins that channel by itself.
  </Step>

  <Step title="The agent picks up the thread">
    Elementary reads the thread it was mentioned in, including which incident and environment the alert message refers to, and starts an agent session. It replies with a confirmation that carries a **View session** link into the web app, and sets the thread status to "Working...".
  </Step>

  <Step title="The answer arrives in the thread">
    The response streams into the thread as a reply. Nothing is posted to the channel itself, so the conversation stays where the alert is.
  </Step>

  <Step title="Follow up in the same thread">
    Tag `@Elementary` again to continue. The session keeps the full history of the thread, so follow-ups do not need to restate anything.
  </Step>
</Steps>

## Setup

**Prerequisites**

* The [Slack integration](/cloud/integrations/alerts/slack) connected for alerts
* AI features enabled for your Elementary account

<Steps>
  <Step title="Authorize the agent in Slack">
    Go to the `Environments` page on the sidebar and authorize Slack for the agent. Workspaces that connected Slack for alerts before the agent existed need this extra approval: it grants the permissions the agent needs to read the thread it is mentioned in and reply there.

    The `Environments` page is visible to admins only, so ask an admin on your account if you cannot see it.

    Until the agent is authorized, Elementary alerts show a link reading "Add the agent to Slack to investigate this further", which takes you to the same place.
  </Step>

  <Step title="Check that alerts invite follow-ups">
    Once the agent is authorized, Slack alerts include the tip "Tag `@Elementary` to send followup messages". That tip is the signal that the workspace is ready.
  </Step>

  <Step title="Invite the app to private channels">
    The app joins public channels on its own when first mentioned. For private channels, invite `@Elementary` to the channel.
  </Step>
</Steps>
