
AI SDK Slackbot
https://github.com/vercel-labs/ai-sdk-slackbot- Category
- AI Agents
- Rank
- No. 1433Tools index
- Pricing
- Open Source
- Type
- AGENT
- Builder
- vercel-labs
- GitHub
- 132 stars
- Date
About
Reference Slack agent built with the Vercel AI SDK — answer questions and run tools right in Slack.
What it does
This Slack chatbot handles direct messages and channel mentions, reconstructs thread context, and asks a chosen language model to respond. It can search the web, fetch weather, roll dice, or operate inside an in-memory shell sandbox. Policy checks inspect every tool request before execution, while each reply reports which tools ran, failed, or were blocked.
Why it's ranked here
The project is a useful reference for controlled agent actions inside a real chat surface. Its strongest idea is visible, policy-backed tool execution: rules can reject concrete actions, and replies expose tool outcomes. The repository also states the boundary honestly. These controls govern tool calls, not unsupported claims in generated text.
What's good
Slack request signatures receive timestamp and timing-safe checks. Conversation history supports threaded follow-ups, while status updates show work in progress. OpenAI is the default model provider, with Ollama available for local development. Shell access stays offline and in memory. Failed or denied actions appear in the response instead of disappearing silently.
Tradeoffs
Setup requires Slack administration, several bot scopes, hosted infrastructure, and provider credentials. Web search needs a separate Exa key. Policy rules cannot guarantee that generated prose is grounded in allowed sources. Local Ollama cannot serve a deployed Vercel function. The README also warns that smaller local models may misuse tools or invent sources.
How to use it well
Use it as a starting point for an internal Slack assistant whose actions are concrete, inspectable, and governed by editable policy. Extend the existing tool set with company search, database access, or custom APIs. Keep output validation separate when factual grounding matters, because action approval does not verify the model’s final prose.
Technical notes+
api/events.ts exposes the Slack event POST handler, validates URL challenges, and schedules mention, assistant-thread, and direct-message work with Vercel waitUntil. lib/slack-utils.ts verifies signed requests and rebuilds thread history. lib/run-agent.ts configures AI SDK generation, tool schemas, a ten-step ceiling, and per-step outcome classification. lib/generate-response.ts loads OPA approval and sandbox tools concurrently, converts Markdown links to Slack formatting, and appends an execution footer. lib/policy/load.ts supports in-process WASM or an HTTP OPA server, while flagging shell operators and leading environment assignments. lib/model.ts selects OpenAI or local Ollama. package.json uses canary AI SDK packages, and tsconfig.json includes only api sources despite imports from lib.
Observed
- Primary language
- TypeScript
- License metadata
- README states MIT; package metadata states ISC
- Install surface
- Node.js 18+ project installed with npm or pnpm
- User interface
- Slack direct messages, assistant threads, and channel mentions
- HTTP interface
- POST endpoint for Slack Events API callbacks
- Model support
- OpenAI by default, with Ollama for local development
- Deployment support
- Configured for Vercel Functions with a 60-second maximum duration
- Policy engine
- Open Policy Agent through in-process WASM or an HTTP policy server
Read from README.md, package.json, lib/model.ts, lib/utils.ts, lib/run-agent.ts, lib/slack-utils.ts, lib/handle-messages.ts, lib/generate-response.ts, lib/handle-app-mention.ts, lib/policy/load.ts, lib/policy/runtime-context.ts, api/events.ts, vercel.json, .env.example, tsconfig.json.
What it can do
Answer questions in Slack channels
Natural language questions in Slack → AI-generated responses in Slack
Execute tools from Slack commands
Slack commands and parameters → Tool execution results in Slack
Process Slack mentions and direct messages
@mentions or direct messages in Slack → AI responses to mentioned queries
Integrate AI capabilities into Slack workflows
Slack workspace integration request → Configured AI bot in Slack workspace
Demonstrate AI SDK functionality
User interactions with the bot → Reference implementation examples
Tags
Tech Stack
Media

Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.