A Slack bot wrapper for yagi.
Directly imports yagi's engine package as a Go library — no subprocess required.
go build -o yagi-slack-botClone yagi-profiles into the data directory:
git clone https://github.com/yagi-agent/yagi-profiles ~/.config/yagi-slack-botThis provides IDENTITY.md and other configuration files. The bot reads IDENTITY.md from the data directory as the system prompt.
export SLACK_APP_TOKEN="xapp-your-app-token-here"
export SLACK_BOT_TOKEN="xoxb-your-bot-token-here"
./yagi-slack-bot -model openai/gpt-4.1-nanoDefault: ~/.config/yagi-slack-bot/
~/.config/yagi-slack-bot/
├── IDENTITY.md # System prompt (from yagi-profiles)
├── sessions/ # Per-user conversation history
│ └── <hash>.json
└── memory/ # Per-user learned information
└── <userID>.json
| Flag | Env Var | Default | Description |
|---|---|---|---|
-app-token |
SLACK_APP_TOKEN |
Slack app token (starts with xapp-, required) | |
-bot-token |
SLACK_BOT_TOKEN |
Slack bot token (starts with xoxb-, required) | |
-model |
YAGI_MODEL |
openai/gpt-4.1-nano |
Provider/model |
-key |
API key (overrides env var) | ||
-prefix |
! |
Command prefix | |
-identity |
<data>/IDENTITY.md |
Path to identity file | |
-data |
~/.config/yagi-slack-bot |
Data directory |
The bot responds to:
- Mentions (
@yagi hello) - Prefixed messages (
!hello)
- Enable Socket Mode
- Subscribe to
message.channelsandmessage.imevents - Add necessary scopes (chat:write, chat:write.public, im:history, channels:history)
To run tests:
go test ./...docker build -t yagi-slack-bot .docker run -it --rm -e SLACK_APP_TOKEN -e SLACK_BOT_TOKEN -e YAGI_MODEL -e XXX_API_KEY yagi-slack-bot -data /tmp/data/yagi-profilesSLACK_APP_TOKEN: Slack app token (starts with xapp-)SLACK_BOT_TOKEN: Slack bot token (starts with xoxb-)YAGI_MODEL: Model to use (e.g. openai/gpt-4.1-nano)-data /tmp/data/yagi-profiles: Path to profile data