Skip to content

Repository files navigation

Browserbase Slack Research Agent

Ask @bb a current web question in Slack and receive a sourced answer in the same thread. The agent uses Browserbase Agents and Runs for web research, Slack for conversation, Redis for thread state, and eve for durable orchestration.

Slack thread with a Browserbase research response

Deploy with Vercel

What It Does

  • Responds to @bb mentions in Slack.
  • Continues the conversation in the same subscribed thread.
  • Runs current web research through a reusable Browserbase Agent.
  • Returns a concise answer with source links when Browserbase provides them.

Architecture

Slack mention or thread reply
  -> Chat SDK Slack webhook
  -> eve session and research_web tool
  -> Browserbase Agent Run
  -> Slack thread reply

agent/tools/research_web.ts is the single model-facing capability. The Browserbase SDK integration is isolated in lib/browserbase/, keeping Agent provisioning, Run polling, and result normalization out of the Slack channel.

Deploy

1. Create a Browserbase Agent

Create a Browserbase account and copy its API key from your project dashboard. Then run the provisioning command locally:

git clone https://github.com/AntonVishal/browserbase-slackbot.git
cd browserbase-slackbot
bun install

BROWSERBASE_API_KEY=bb_live_... bun run provision:browserbase-agent

Copy the printed BROWSERBASE_RESEARCH_AGENT_ID. Keep the Browserbase API key secret; the Agent ID is an identifier.

2. Create the Slack App

At Slack API Apps, choose Create New App and import slack-app-manifest.yaml. The manifest creates the bot, permissions, and event subscriptions using a placeholder request URL (https://your-domain/eve/v1/slack) that you replace after deploy.

Install the app into your workspace, then copy:

  • Bot User OAuth Token to SLACK_BOT_TOKEN
  • Signing Secret to SLACK_SIGNING_SECRET

The bot display name is bb. Invite it to each channel where it should work; private channels require an explicit invite.

3. Prepare Redis

Create a Redis-compatible database and copy its connection URL into REDIS_URL. Chat SDK uses Redis to retain subscribed thread state and deduplicate webhook delivery across deployments.

4. Deploy to Vercel

Click Deploy with Vercel above and provide these values:

Variable Required Purpose
SLACK_BOT_TOKEN Yes Slack bot OAuth token (xoxb-...)
SLACK_SIGNING_SECRET Yes Verifies Slack webhook requests
REDIS_URL Yes Durable Chat SDK state
BROWSERBASE_API_KEY Yes Browserbase SDK authentication
BROWSERBASE_RESEARCH_AGENT_ID Yes Reusable Browserbase research agent
AI_GATEWAY_API_KEY Only outside Vercel Model authentication for gateway-routed models

On Vercel, eve uses the project OIDC token for the configured AI Gateway model, so AI_GATEWAY_API_KEY is not required.

5. Finish the Slack Webhook

In Event Subscriptions, replace your-domain in the Request URL with your deployed Vercel domain:

https://your-domain/eve/v1/slack

The manifest already subscribes to app_mention, message.channels, and message.groups. Slack must validate the URL successfully before it delivers events. Reinstall the Slack app after changing scopes or subscriptions.

Local Development

cp .env.example .env
bun install
bun run dev

Verify changes before deployment:

bun run typecheck
bun run build

Slack Behavior

The app receives app_mention to start a thread and message.channels or message.groups to continue subscribed public or private channel threads. Direct messages are intentionally out of scope.

Try it in Slack:

@bb find the latest tech news today

Project Layout

agent/
  channels/slack.ts       Slack webhook and thread dispatch
  tools/research_web.ts   Single model-facing research capability
lib/browserbase/
  agents.ts               Reusable Agent provisioning
  runs.ts                 Run creation and polling
  research.ts             Research workflow and result normalization
scripts/
  provision-browserbase-agent.ts

References

About

A Slack research agent powered by Browserbase Agents and eve.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages