# Share your Managed Deep Agent with your team using Slack

## Executive summary

This guide details the process of deploying a Managed Deep Agent, initially developed in LangSmith Studio, to a production environment using Slack as the primary interaction layer. The process involves running `slack init` to configure the connection, executing a deployment, completing the Slack authorization step, and finally customizing the agent's appearance and message trigger logic for optimal team integration.

## Key takeaways

- Agent Deployment Workflow: To connect an existing agent to Slack, run the `slack init` command, followed by a redeployment. The first deployment requires completing a Slack authorization step to link the agent to the internal workspace.
- Monitoring and Tracing: When the agent is live, all user interactions (requests) are logged and traceable within the LangSmith dashboard, allowing engineers to monitor complete request traces even though the user only sees the final answer in Slack.
- Agent Customization: The agent's name, description, icon, and background color can be customized by modifying the setup code in the channels directory and redeploying the agent.
- Message Trigger Configuration: Two key trigger options exist: manual tagging (default) or 'trigger on all messages' (setting `trigger_on_all_messages` to true). Enabling the latter allows the agent to respond to any message in a dedicated channel, not just those directly addressed to it.

## Technical details

- Initialization Command: The `slack init` command is used to add a Slack channel connection to an existing LangSmith project, creating a `channels` directory and defining the connection in `slack.py`.
- Deployment Requirement: After running `slack init`, a redeployment is mandatory for the new Slack channel connection to activate and for the agent to be added to the Slack workspace.
- Agent Interaction: The agent processes user queries by utilizing 'tool calls' to find answers, and the full execution trace is visible in the LangSmith Studio dashboard.
- Trigger Logic: Setting 'trigger on all messages' (if enabled) allows the agent to respond to any message in the channel, regardless of whether the agent was directly tagged, making it useful for always-on support channels.

## Practical implications

- Engineers can automate the integration of complex AI agents into team communication platforms (like Slack) using managed deployment services.
- The process provides a clear workflow for monitoring agent performance in a live, multi-user environment by leveraging LangSmith's trace logging.
- Understanding message triggers allows for precise control over when the agent activates, preventing unnecessary responses while ensuring coverage in dedicated support channels.

## Topics

Managed Deep Agents, LangSmith Studio, Slack Integration, Agent Deployment, Message Triggers, Tool Calling, LangGraph, LangSmith, LangChain Academy

Source: https://www.youtube.com/watch?v=a5Yie-Bgx7A
