Skip to main content
This guide shows you how to connect an agent to Slack so it can:
  • Listen to messages in a Slack channel (via a trigger)
  • Respond in Slack (via Slack tools)
By the end, you’ll have an agent that automatically responds when users message in your Slack channel.

Prerequisites

  • An existing agent in Agent Builder (see Quickstart to create one)
  • Admin access to a Slack workspace, or permission to install apps

Step 1: Connect to Slack

First, authorize LangSmith to access your Slack workspace and invite the bot to your channel.
1

Open your agent

  1. In LangSmith, navigate to Agent Builder.
  2. Select your agent from My Agents.
  3. Click Edit Agent.
2

Start adding the Slack trigger

  1. Scroll down to the Triggers section.
  2. Click + Add trigger.
  3. Select Slack - Message Received.
3

Authorize Slack

  1. Click Connect to authorize the Slack connection.
  2. Sign in to your Slack workspace.
  3. Review the permissions and click Allow.
  4. You’ll be redirected back to LangSmith.
4

Invite the bot to your channel

Before selecting a channel, invite the bot to the channel you want to use. In Slack, go to that channel and type:
/invite @LangSmith Agent Builder
5

Select the channel

  1. Back in LangSmith, choose the Slack channel you invited the bot to.
  2. Click Save.
Your agent will now be triggered whenever a message is posted in that channel.

Step 2: Add Slack tools

Tools let your agent take actions. To respond in Slack, you need to add Slack tools.
You can also ask your agent to add these tools itself! In the agent chat, try: “Add the Slack tools so you can respond to messages.”
1

Add Slack tools

  1. In the agent editor, scroll to the Tools section.
  2. Click + Add tool.
  3. Search for “Slack” and add the tools you need:
    • slack_send_channel_message - Post messages to a channel
    • slack_reply_to_message - Reply in a thread
    • slack_write_private_message - Send direct messages
    • slack_read_channel_history - Read recent messages
    • slack_read_thread_messages - Read thread replies
2

Authorize tools (if needed)

If prompted, click Connect to authorize the Slack tools. This may use the same authorization from Step 1.
3

Save your agent

Click Save changes to save your agent configuration.

Step 3: Configure agent behavior (optional)

Your agent needs to know how to handle incoming Slack messages. You can update its instructions by prompting it directly. In the agent chat, try something like:
Update your instructions to handle the Slack Trigger and Slack Tools
for bidirectional communication
Adjust the instructions based on your use case - for example, you might want the agent to only respond to certain types of questions, or to pull information from specific sources before replying.

Step 4: Test the integration

1

Send a test message

In your Slack channel, send a message to test the agent:
Hello, can you help me?
2

Verify the response

Your agent should respond in the channel. You can view the agent’s activity in the Feed tab in Agent Builder.
3

Troubleshoot if needed

If your agent doesn’t respond:
  • Verify the bot was invited to the channel
  • Check the Feed tab for any errors
  • Ensure the trigger is not paused (check the toggle in the Triggers section)

How it works

When a message is posted in your monitored Slack channel:
  1. Slack sends an event to LangSmith
  2. The trigger activates your agent with the message content
  3. Your agent processes the message and uses Slack tools to respond
  4. The response appears in Slack (in the same thread if replying to a thread)
Your agent receives the full thread context when responding to threaded messages, so it can provide contextually relevant responses.

Next steps


Connect these docs to Claude, VSCode, and more via MCP for real-time answers.