https://github.com/jonigl/sladk-agents
Slack AI agents powered by Google ADK. Deploy intelligent assistants directly in your workspace with multi-agent orchestration, real-time streaming, and extensible tools
https://github.com/jonigl/sladk-agents
adk adk-python agent-development-kit agents ai ai-agents google python slack slack-agent slack-bot
Last synced: 2 months ago
JSON representation
Slack AI agents powered by Google ADK. Deploy intelligent assistants directly in your workspace with multi-agent orchestration, real-time streaming, and extensible tools
- Host: GitHub
- URL: https://github.com/jonigl/sladk-agents
- Owner: jonigl
- License: mit
- Created: 2025-11-30T18:12:51.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-12-02T16:25:44.000Z (4 months ago)
- Last Synced: 2025-12-05T14:50:42.680Z (4 months ago)
- Topics: adk, adk-python, agent-development-kit, agents, ai, ai-agents, google, python, slack, slack-agent, slack-bot
- Language: Python
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Sladk Agents
**Your company's Slack AI agents of the new era of generative AI powered by Google Agent Development Kit (ADK)**
[](https://www.kaggle.com/competitions/agents-intensive-capstone-project/overview/tracks-and-awards)
[](https://ai.google.dev/)
[](https://google.github.io/adk-docs/)
[](https://docs.slack.dev/tools/bolt-python)
---
## ๐ Table of Contents
- [๐ฏ The Problem](#-the-problem)
- [๐ก The Solution](#-the-solution)
- [๐๏ธ Architecture](#๏ธ-architecture)
- [โจ Key Features Implemented (ADK Concepts)](#-key-features-implemented-adk-concepts)
- [๐ Setup & Installation](#-setup--installation)
- [๐ฎ Usage](#-usage)
- [๐ฅ๏ธ Demos](#๏ธ-demos)
- [๐ง Extending the Agent](#-extending-the-agent)
- [๐ Impact & Value](#-impact--value)
- [๐ฃ๏ธ Future Roadmap](#๏ธ-future-roadmap)
- [๐ References](#-references)
- [๐ License](#-license)
- [๐ค Author](#-author)
- [๐ Acknowledgments](#-acknowledgments)
---
## ๐ฏ The Problem
Enterprise teams rely heavily on Slack for daily collaborationโsharing updates, asking questions, coordinating projects, and making decisions. However, accessing AI-powered assistance typically requires:
- **Context switching**: Leaving Slack to use external AI tools (Gemini web, chatGPT, etc.)
- **Manual copy-paste workflows**: Moving conversation context between platforms
- **Lost productivity**: Teams lose time switching between tools
- **Fragmented knowledge**: AI insights don't stay where the work happens
While Slack recently introduced [AI Agents](https://docs.slack.dev/ai/) as a native feature, building production-ready agents still requires significant integration work, especially when leveraging advanced AI frameworks.
## ๐ก The Solution
**Sladk Agents** bridges the gap between Slack's native AI Agent capabilities and Google's powerful [Agent Development Kit (ADK)](https://google.github.io/adk-docs/). It provides a ready-to-deploy framework that enables enterprises to:
- Deploy AI agents directly within Slack's native UI (side panel, threads, mentions)
- Leverage Google ADK's multi-agent architecture with sub-agents for specialized tasks
- Maintain conversation context through session management
- Extend functionality with built-in and custom tools
- Stream responses in real-time for a seamless user experience
**Key Value Proposition**: Teams can now access sophisticated AI assistance exactly where they collaborateโno context switching, no copy-paste, just intelligent help when and where they need it.
## ๐๏ธ Architecture
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SLACK WORKSPACE โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Side Panel โ โ Threads โ โ @mentions โ โ Direct Messages โ โ
โ โ Assistant โ โ โ โ โ โ โ โ
โ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโ โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโ
โ โ โ โ
โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SLADK AGENTS (Bolt for Python) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ AsyncApp + Socket Mode โ โ
โ โ โข Real-time WebSocket connection to Slack โ โ
โ โ โข Async handlers for non-blocking operations โ โ
โ โ โข Native streaming support (chat_stream) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ LISTENERS โ โ
โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โ
โ โ โ Assistant โ โ Events โ โ Actions โ โ โ
โ โ โ โข started โ โ โข mentions โ โ โข feedback โ โ โ
โ โ โ โข message โ โ โ โ โ โ โ
โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GOOGLE ADK (Agent Layer) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ LlmAgent (Root Agent) โ โ
โ โ โข Model: Gemini 2.5 Flash (configurable) โ โ
โ โ โข Custom system instructions โ โ
โ โ โข Safety settings & temperature control โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ SearchAgent โ โ CodeAgent โ โ Custom Tools โ โ
โ โ (Sub-Agent) โ โ (Sub-Agent) โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโโโ โ โ
โ โ โ google_search โ โ โ โ Code Executor โ โ โ โ get_weather โ โ โ
โ โ โโโโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโโโ โ โ โ (wttr.in) โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโ โ โ
โ โ โโโโโโโโโโโโโโโโโโ โ โ
โ โ โ + extensible โ โ โ
โ โ โโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ SESSION MANAGEMENT โ โ
โ โ โข InMemorySessionService: Maintains conversation state per thread โ โ
โ โ โข Context Compaction: Efficient token usage (interval=5, overlap=1) โ โ
โ โ โข User/Session ID mapping: Slack thread_ts โ ADK session โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ RUNNER โ โ
โ โ โข Async execution with run_async() โ โ
โ โ โข Streaming response chunks to Slack โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GEMINI API โ
โ (Generative AI Backend) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
## โจ Key Features Implemented (ADK Concepts)
This project demonstrates **5 key concepts** from the Google ADK course:
### 1. Multi-Agent System
- **Root Agent (`LlmAgent`)**: Orchestrates user requests and delegates to specialized sub-agents
- **SearchAgent**: Handles web search queries using Google Search tool
- **CodeAgent**: Executes Python code for calculations and data processing
### 2. Tools Integration
- **Built-in Tools**: `google_search` for real-time web information
- **Code Execution**: `BuiltInCodeExecutor` for running Python code
- **Custom Tools**: `get_weather()` function demonstrating extensibility
### 3. Sessions & State Management
- **InMemorySessionService**: Maintains conversation context across messages
- **Session persistence**: Each Slack thread maps to a unique ADK session
- **User isolation**: Sessions are scoped per user and thread
### 4. Context Engineering
- **EventsCompactionConfig**: Optimizes token usage with:
- `compaction_interval=5`: Compact every 5 events
- `overlap_size=1`: Maintain context continuity
### 5. Effective Use of Gemini
- **Model**: Gemini 2.5 Flash (configurable via environment)
- **Safety Settings**: Configurable content filtering
- **Streaming**: Real-time response streaming to Slack
## ๐ Setup & Installation
### Prerequisites
- Python 3.10+
- A Slack workspace with admin permissions
- Google API key with Gemini access
> [!TIP]
> You can obtain a Google API with Gemini in the [Google AI Studio](https://aistudio.google.com/app/api-keys).
### 1. Clone the Repository
```bash
git clone https://github.com/jonigl/sladk-agents.git
cd sladk-agents
```
### 2. Create Slack App
> [!TIP]
> You can also review the original Slack Bolt template [instructions here](SLACK_BOLT_TEMPLATE_README.md#creating-the-slack-app).
1. Go to [api.slack.com/apps/new](https://api.slack.com/apps/new) โ "From an app manifest"
2. Select your workspace
3. Paste contents of `manifest.json` โ Click **Next** โ **Create**
4. Click **Install to Workspace** โ **Allow**
### 3. Configure Environment
```bash
cp .env.sample .env
```
Edit `.env` with your credentials:
```bash
# Slack Configuration
SLACK_APP_TOKEN=xapp-... # Basic Info โ App-Level Tokens โ connections:write
SLACK_BOT_TOKEN=xoxb-... # OAuth & Permissions โ Bot User OAuth Token
# Google ADK Configuration
GOOGLE_API_KEY=your_google_api_key
AGENT_MODEL=gemini-2.5-flash # or gemini-2.0-flash, gemini-1.5-pro
AGENT_APP_NAME=Sladk_App
AGENT_NAME=Sladk_AI_Agent
# Optional: Custom system instruction
DEFAULT_SYSTEM_INSTRUCTION="You're a helpful assistant in a Slack workspace..."
```
### 4. Install Dependencies
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
### 5. Run the Agent
```bash
python3 app.py
```
Or using Slack CLI:
```bash
slack run
```
---
## ๐ฎ Usage
### Configure your Slack Preferences
1. Open Slack โ Click your profile picture โ **Preferences**
2. Go to **Navigation** โ Go to the **App agents & assistants**
3. Click the checkbox for **Show app agents**
### Interact with the Agent
Once running, interact with your agent in three ways:
| Method | How |
|--------|-----|
| **Side Panel** | Click the agent icon in Slack's top right corner to open the AI assistant |
| **@Mention** | Type `@Sladk AI Agent` in any channel |
| **Direct Message** | Send a DM to the bot |
### Example Interactions
- *"Search for the latest news about AI agents"* โ Uses SearchAgent
- *"Calculate the compound interest on $1000 at 5% for 10 years"* โ Uses CodeAgent
- *"What's the weather in San Francisco?"* โ Uses custom get_weather tool
## ๐ฅ๏ธ Demos
### Demo 1
- Using google search built-in with ToolAgent / subagent
- Using a custom tool to get the weather
- Interacting with slack thread messages and mentions
### Demo 2
- Python code execution using dedicated subagent as a tool
## ๐ง Extending the Agent
### Adding Custom Tools
Create new tools in `ai/tools/custom_tools.py`:
```python
def my_custom_tool(param: str) -> str:
"""
Description of what this tool does.
Args:
param: Description of parameter
Returns:
str: Description of return value
"""
# Your implementation
return result
```
Then add to the agent in `ai/llm_caller.py`:
```python
from ai.tools.custom_tools import get_weather, my_custom_tool
agent = LlmAgent(
# ...
tools=[get_weather, my_custom_tool, AgentTool(agent=search_agent)],
)
```
## ๐ Impact & Value
| Metric | Improvement |
|--------|-------------|
| **Context Switching** | Eliminated - AI lives in Slack |
| **Response Time** | Real-time streaming responses |
| **Tool Access** | Web search, code execution, custom tools in one place |
| **Session Memory** | Maintains context across conversation |
| **Deployment** | Single Python app, no infrastructure complexity |
## ๐ฃ๏ธ Future Roadmap
- [ ] **Memory Bank Integration**: Long-term memory across sessions
- [ ] **MCP Tools**: Model Context Protocol for external integrations
- [ ] **Agent Engine Deployment**: Cloud Run / Agent Engine deployment
- [ ] **Observability**: Tracing and metrics with OpenTelemetry
- [ ] **A2A Protocol**: Agent-to-agent communication for complex workflows
## ๐ References
- [Google ADK Documentation](https://google.github.io/adk-docs/)
- [Slack AI Apps Documentation](https://docs.slack.dev/ai/)
- [Bolt for Python](https://docs.slack.dev/tools/bolt-python)
- [Gemini API](https://ai.google.dev/)
## ๐ License
This project uses **dual licensing**:
| Component | License | File |
|-----------|---------|------|
| Base code (Slack Bolt template) | MIT License | [LICENSE](LICENSE) |
| Sladk Agents additions (agent logic, architecture, ADK integration) | CC-BY-SA 4.0 | [LICENSE_CAPSTONE](LICENSE_CAPSTONE) |
The base Slack Bolt template code is covered by the **MIT License** (original work by Slack Technologies, LLC). All new agent logic, architecture, and Google ADK integration created for this Capstone project is licensed under **CC-BY-SA 4.0** as required by the Kaggle competition rules.
## ๐ค Author
**Jonathan Gastรณn Lรถwenstern** - GitHub: [@jonigl](https://github.com/jonigl)
Built with โค๏ธ for the [Kaggle & Google: Agents Intensive - Capstone Project](https://www.kaggle.com/competitions/agents-intensive-capstone-project) - November 2025
## ๐ Acknowledgments
- Slack for the [bolt-python-assistant-template](https://github.com/slack-samples/bolt-python-assistant-template) foundation
- Google for the [Agent Development Kit (ADK)](https://google.github.io/adk-docs/)
- The [5-Day AI Agents Intensive Course with Google](https://www.kaggle.com/learn-guide/5-day-agents) community for inspiration and guidance