# Slack

{% hint style="info" %}
Full slack integration will only work when not in CLI mode. It is also recommended to run with the 'local' profile during development for simplification.
{% endhint %}

Building and maintaining a full Slack application be a pain.  Fortunately, the SDK includes everything you need to get started building a Slack application that talks to your agents. &#x20;

To get started, you're going to need some values from the Slack Apps dashboard.  Go to <https://api.slack.com/apps> and click Create New App.  Then click From a Manifest and choose your Slack workspace for development. &#x20;

You can create your own manifest, or you can use the sample manifest thats included in the SDK (located in `resources/slack_app_manifest.json`) - included here for convenience:

```json
{
  "display_information": {
    "name": "Sample - Talent AI",
    "description": "AI agents specializing in People & Culture!",
    "background_color": "#00acc2",
    "long_description": "Leading people means more than tracking projects. It’s about supporting growth, removing blockers, and keeping everyone aligned. TalentAgent makes it easy. \n\nTalentAgent is your behind-the-scenes AI People & Culture experts. \n\nIt transforms spreadsheets, feedback, and goals into clear insights and actionable tasks—so you can lead smarter and focus on what matters. \n\nNo dashboards. No extra tools. Just answers, insights, and action. "
  },
  "features": {
    "app_home": {
      "home_tab_enabled": true,
      "messages_tab_enabled": true,
      "messages_tab_read_only_enabled": false
    },
    "bot_user": {
      "display_name": "TalentAgent",
      "always_online": true
    },
    "slash_commands": [
      {
        "command": "/talent-welcome",
        "url": "https://sample.us-east.api.peoplelogic.dev/slack/events",
        "description": "See the installation welcome",
        "should_escape": false
      },
      {
        "command": "/talent-grant",
        "url": "https://sample.us-east.api.peoplelogic.dev/slack/events",
        "description": "Grants access to TalentAgent",
        "usage_hint": "[@user or #channel]",
        "should_escape": true
      },
      {
        "command": "/talent-revoke",
        "url": "https://sample.us-east.api.peoplelogic.dev/slack/events",
        "description": "Revokes access to TalentAgent",
        "usage_hint": "[@user or #channel]",
        "should_escape": true
      },
      {
        "command": "/talent-connect-workspace",
        "url": "https://sample.us-east.api.peoplelogic.dev/slack/events",
        "description": "Reconnects Slack & TalentAgent",
        "should_escape": false
      },
      {
        "command": "/talent-change-language",
        "url": "https://sample.us-east.api.peoplelogic.dev/slack/events",
        "description": "Changes TalentAgent's Locale",
        "should_escape": false
      }
    ]
  },
  "oauth_config": {
    "redirect_urls": [
      "https://sample.us-east.api.peoplelogic.dev/slack/oauth/redirect"
    ],
    "scopes": {
      "bot": [
        "app_mentions:read",
        "channels:history",
        "channels:read",
        "chat:write",
        "chat:write.customize",
        "commands",
        "files:read",
        "im:history",
        "im:read",
        "im:write",
        "mpim:write",
        "reactions:read",
        "reactions:write",
        "team:read",
        "users.profile:read",
        "users:read",
        "users:read.email"
      ]
    }
  },
  "settings": {
    "event_subscriptions": {
      "request_url": "https://sample.us-east.api.peoplelogic.dev/slack/events",
      "bot_events": [
        "app_home_opened",
        "app_mention",
        "app_uninstalled",
        "assistant_thread_context_changed",
        "assistant_thread_started",
        "message.im",
        "reaction_added"
      ]
    },
    "interactivity": {
      "is_enabled": true,
      "request_url": "https://sample.us-east.api.peoplelogic.dev/slack/interactions",
      "message_menu_options_url": "https://sample.us-east.api.peoplelogic.dev/api/v1/agents/common/slack/load-select-options"
    },
    "org_deploy_enabled": false,
    "socket_mode_enabled": false,
    "token_rotation_enabled": false
  }
}
```

{% hint style="warning" %}
You'll probably want to replace the URLs with a local hostname or development hostname first!
{% endhint %}

Once you hit Save you'll be taken to a page that contains all your app credentials.  You'll need these, we'll put them into your `application.properties`:

```
# Slack app setup
peoplelogic.agent.slack.clientId=${SLACK_CLIENT_ID:}
peoplelogic.agent.slack.clientSecret=${SLACK_CLIENT_SECRET:}
peoplelogic.agent.slack.signingSecret=${SLACK_SIGNING_SECRET:}
peoplelogic.agent.slack.name=slack-sample-agent
```

Now, just start up your agents and you can hit the installation url (for example: `https://sample.us-east.api.peoplelogic.dev/slack/install`) to install your new Slack application. &#x20;

The application will walk you through basic setup right within Slack. &#x20;

### What can the provided Slack integration do?

* Handle multiple threads of conversations
* Handles interactions (@mention) in a channel
* Seamlessly switches between agents within conversation
* Cleanly handles long operations by keeping the user updated
* Handles file uploads within the conversations
* Slash commands to change locales (`/talent-change-language`)
* Slash commands to add/remove users (`/talent-grant` or `/talent-revoke`)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.peoplelogic.dev/guides/getting-started-with-the-talent-agent-sdk/agents-in-the-flow-of-work/slack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
