A Sekuire AI Agent for Slack that creates Google Docs from Slack threads. This agent demonstrates multi-agent orchestration by delegating document creation to the Google Workspace Agent.
- Read Threads: Fetch all messages from Slack threads
- Summarize Threads: Generate AI summaries of conversations
- Thread to Doc: Create Google Docs from one or more threads
- Send Messages: Reply in channels or threads
- Multi-Agent Delegation: Delegates to Google Workspace Agent for document creation
┌─────────────┐ ┌──────────────┐ ┌────────────────────┐
│ Slack │────▶│ Slack Agent │────▶│ Google Workspace │
│ (User) │◀────│ (Port 8003) │◀────│ Agent (Port 8002) │
└─────────────┘ └──────────────┘ └────────────────────┘
│
▼
┌──────────────┐
│ Sekuire API │
│ (Port 5556) │
└──────────────┘
- Node.js 22+
- Slack App with Bot Token and Socket Mode enabled
- Google Workspace Agent running (for document creation)
- Google AI API key (for Gemini LLM features)
- Go to api.slack.com/apps
- Create a new app from scratch
- Enable Socket Mode in Settings
- Generate an App-Level Token with
connections:writescope - Under OAuth & Permissions, add these Bot Token Scopes:
app_mentions:readchannels:historychannels:readchat:writecommandsgroups:historygroups:readusers:read
- Install the app to your workspace
- Copy the Bot User OAuth Token
Under Event Subscriptions, enable and subscribe to:
app_mentionmessage.channels
Under Slash Commands, create:
- Command:
/thread-to-doc - Description: Create a Google Doc from this thread
Create a .env file:
# Slack Configuration
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_SIGNING_SECRET=your-signing-secret
SLACK_APP_TOKEN=xapp-your-app-token
# Google AI for Gemini LLM
GOOGLE_API_KEY=your_google_api_key
# Google Workspace Agent URL
GOOGLE_WORKSPACE_AGENT_URL=http://localhost:8002
# Sekuire Configuration
SEKUIRE_WORKSPACE_ID=your_workspace_id
SEKUIRE_API_URL=http://localhost:5556
SEKUIRE_AUTH_TOKEN=your_auth_token
# Server
PORT=8003pnpm installFirst, start the Google Workspace Agent:
cd ../google-workspace-agent
pnpm devThen start the Slack Agent:
cd ../slack-agent
pnpm devCreate a doc from a thread:
@SlackAgent create a doc from this thread
With custom title:
@SlackAgent create a doc called "Meeting Notes - Q4 Planning"
Summarize a thread:
@SlackAgent summarize this thread
Using slash command:
/thread-to-doc Weekly Standup Notes
Read a thread:
curl -X POST http://localhost:8003/a2a/tasks \
-H "Content-Type: application/json" \
-d '{
"task_id": "read-001",
"type": "slack:thread:read",
"input": {
"channel_id": "C1234567890",
"thread_ts": "1234567890.123456"
}
}'Create doc from threads:
curl -X POST http://localhost:8003/a2a/tasks \
-H "Content-Type: application/json" \
-d '{
"task_id": "doc-001",
"type": "slack:thread:to_doc",
"input": {
"threads": [
{"channel_id": "C1234567890", "thread_ts": "1234567890.123456"},
{"channel_id": "C0987654321", "thread_ts": "0987654321.654321"}
],
"doc_title": "Combined Meeting Notes",
"include_summary": true
}
}'| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/metrics |
GET | Agent metrics |
/agent/info |
GET | Agent capabilities |
/.well-known/agent.json |
GET | A2A agent card |
/a2a/tasks |
POST | Execute A2A tasks |
/sekuire/handshake |
POST | Trust protocol handshake |
/sekuire/hello |
GET | Protocol discovery |
| Type | Description |
|---|---|
slack:thread:read |
Read messages from a thread |
slack:thread:summarize |
Summarize a thread |
slack:thread:to_doc |
Create Google Doc from threads |
slack:message:send |
Send a message |
task:chat |
Natural language interaction |
When a user asks to create a document:
- Slack Agent receives the request
- Slack Agent fetches thread content from Slack API
- Slack Agent formats content as markdown
- Slack Agent (optionally) generates summary using LLM
- Slack Agent delegates to Google Workspace Agent via A2A
- Google Workspace Agent creates the document
- Slack Agent receives the document URL
- Slack Agent posts the URL back to Slack
# Run with hot reload
pnpm dev
# Build for production
pnpm build
# Run tests
pnpm test
# Lint code
pnpm lintEnable Socket Mode in your Slack app settings and generate an App-Level Token.
Ensure all required bot token scopes are added and reinstall the app.
- Check that Google Workspace Agent is running
- Verify the
GOOGLE_WORKSPACE_AGENT_URLis correct - Check Google Workspace Agent logs for errors
Set GOOGLE_API_KEY environment variable for Gemini LLM access.
MIT