A example that demonstrates a multiagent system for searching and analyzing Slack conversations.
This example creates a system of specialized agents that work together to help users research topics in their Slack workspace:
- Slack Research Agent: The root agent that coordinates the sub-agents
- Channel Explorer: Helps find and navigate Slack channels
- Search Specialist: Searches Slack for relevant information
- Thread Specialist: Summarizes Slack conversation threads
This example requires a Slack User Token (starts with xoxp-) with the following permissions:
channels:read- To list public channelsgroups:read- To access private channelssearch:read- To search messageschannels:history- To access channel messages
To obtain a Slack User Token:
- Go to Slack API Apps
- Create a new app in your workspace
- Go to "OAuth & Permissions"
- Add the required scopes listed above
- Install the app to your workspace
- Copy the User OAuth Token (starts with
xoxp-)
Set the following environment variables:
# Slack User Token
export SLACK_USER_TOKEN=xoxp-your-user-token
# Google Cloud Project ID
export GCP_PROJECT_ID=your-gcp-project-id-
Create a GCP project
-
Enable the VertexAI API:
gcloud services enable aiplatform.googleapis.com -
Create a service account with these roles:
roles/aiplatform.serviceAgent
-
Download the service account key JSON file
-
Set the environment variable:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/service-account-key.json
Start the agent:
Install uv if you havn't
curl -LsSf https://astral.sh/uv/install.sh | shuv run python -m examples.multiagent_slack.agent
The agent will start an interactive console where you can ask questions like:
- "What are the new product features discussed in the last week?"
- "Summarize thread: https://yourworkspace.slack.com/archives/ABCDEF/1234567890123456"
- Python 3.10+
- A Slack workspace with appropriate API permissions