Skip to content

yagi-agent/yagi-slack-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yagi-slack-bot

A Slack bot wrapper for yagi.

Directly imports yagi's engine package as a Go library — no subprocess required.

Setup

1. Build

go build -o yagi-slack-bot

2. Configure profile

Clone yagi-profiles into the data directory:

git clone https://github.com/yagi-agent/yagi-profiles ~/.config/yagi-slack-bot

This provides IDENTITY.md and other configuration files. The bot reads IDENTITY.md from the data directory as the system prompt.

3. Run

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-nano

Data Directory

Default: ~/.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

Options

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

Trigger

The bot responds to:

  • Mentions (@yagi hello)
  • Prefixed messages (!hello)

Required Slack App Configuration

  • Enable Socket Mode
  • Subscribe to message.channels and message.im events
  • Add necessary scopes (chat:write, chat:write.public, im:history, channels:history)

Testing

To run tests:

go test ./...

Docker

Build

docker build -t yagi-slack-bot .

Run

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-profiles
  • SLACK_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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors