Skip to main content

Overview

The Recoup Content Agent is a Slack bot that generates social-ready artist videos on @mention. It plugs into the existing content creation pipeline and delivers results directly in your Slack thread.

How It Works

User mentions bot in Slack

@RecoupContentAgent <artist_account_id> [template] [batch=N] [lipsync]

Bot validates the artist and sends an immediate acknowledgment

Triggers the content creation pipeline (POST /api/content/create)

Background task polls for completion (~5-10 min)

Bot replies in-thread with the generated video URL(s)

@Mention Syntax

@RecoupContentAgent <artist_account_id> [template] [batch=N] [lipsync]
ParameterRequiredDescription
artist_account_idYesUUID of the artist account
templateNoContent template name (defaults to artist-caption-bedroom)
batch=NNoNumber of videos to generate (1-30, default 1)
lipsyncNoEnable lipsync mode (audio baked into video)

Examples

Basic — single video with default template:
@RecoupContentAgent abc-123-uuid
Custom template:
@RecoupContentAgent abc-123-uuid artist-caption-bedroom
Batch with lipsync:
@RecoupContentAgent abc-123-uuid batch=3 lipsync

Architecture

The content agent follows the same pattern as the coding agent bot:
ComponentLocationPurpose
Slack webhookPOST /api/content-agent/slackReceives @mention events
Callback endpointPOST /api/content-agent/callbackReceives polling results
Bot singletonlib/content-agent/bot.tsChat SDK with Slack adapter + Redis state
Mention handlerlib/content-agent/handlers/Parses args, validates artist, triggers pipeline
Poll taskpoll-content-run (Trigger.dev)Monitors content runs, posts results via callback

Data Flow

  1. Slack eventPOST /api/content-agent/slack handles the webhook
  2. Mention handler parses the command, calls GET /api/content/validate to check artist readiness
  3. Content creation triggered via POST /api/content/create — returns runIds
  4. Poll task (poll-content-run) monitors the Trigger.dev runs every 30 seconds (up to 30 minutes)
  5. CallbackPOST /api/content-agent/callback receives results and posts video URLs back to the Slack thread

API Endpoints Used

EndpointWhenPurpose
GET /api/content/validateBefore triggeringChecks if the artist has required assets
POST /api/content/createOn mentionTriggers the video generation pipeline
GET /api/content/templatesReferenceLists available content templates
POST /api/content-agent/callbackAfter completionInternal — receives poll results

Setup

1. Create a Slack App

  1. Go to api.slack.com/apps and create a new app
  2. Under OAuth & Permissions, add bot scopes:
    • chat:write — post messages
    • app_mentions:read — receive @mention events
  3. Under Event Subscriptions:
    • Enable events
    • Set the request URL to https://recoup-api.vercel.app/api/content-agent/slack
    • Subscribe to app_mention bot event
  4. Install the app to your workspace

2. Configure Environment Variables

VariableWhereDescription
SLACK_CONTENT_BOT_TOKENAPI (Vercel)Bot OAuth token (xoxb-...) from Slack app
SLACK_CONTENT_SIGNING_SECRETAPI (Vercel)Signing secret from Slack app Basic Information
CONTENT_AGENT_CALLBACK_SECRETAPI + TasksShared secret for callback authentication (generate a random string)
RECOUP_API_KEYAPI + TasksRecoup API key for authenticating pipeline requests
RECOUP_API_BASE_URLTasks (Trigger.dev)API base URL (e.g., https://recoup-api.vercel.app)

3. Verify

Mention the bot in any Slack channel where it’s been added:
@RecoupContentAgent <your-artist-account-id>
You should see:
  1. An immediate acknowledgment message
  2. A video URL reply in the thread after ~5-10 minutes

Troubleshooting

IssueCauseFix
No response from botEvent subscription URL not configuredCheck Slack app Event Subscriptions
”Artist not found”Invalid artist_account_idVerify the UUID exists in the platform
”No GitHub repository found”Artist missing repo configEnsure the artist account has a linked GitHub repo
Timeout after 30 minPipeline took too longCheck Trigger.dev dashboard for the failed run
”Unsupported template”Invalid template nameUse GET /api/content/templates to list available templates