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
@Mention Syntax
| Parameter | Required | Description |
|---|---|---|
artist_account_id | Yes | UUID of the artist account |
template | No | Content template name (defaults to artist-caption-bedroom) |
batch=N | No | Number of videos to generate (1-30, default 1) |
lipsync | No | Enable lipsync mode (audio baked into video) |
Examples
Basic — single video with default template:Architecture
The content agent follows the same pattern as the coding agent bot:| Component | Location | Purpose |
|---|---|---|
| Slack webhook | POST /api/content-agent/slack | Receives @mention events |
| Callback endpoint | POST /api/content-agent/callback | Receives polling results |
| Bot singleton | lib/content-agent/bot.ts | Chat SDK with Slack adapter + Redis state |
| Mention handler | lib/content-agent/handlers/ | Parses args, validates artist, triggers pipeline |
| Poll task | poll-content-run (Trigger.dev) | Monitors content runs, posts results via callback |
Data Flow
- Slack event →
POST /api/content-agent/slackhandles the webhook - Mention handler parses the command, calls
GET /api/content/validateto check artist readiness - Content creation triggered via
POST /api/content/create— returnsrunIds - Poll task (
poll-content-run) monitors the Trigger.dev runs every 30 seconds (up to 30 minutes) - Callback →
POST /api/content-agent/callbackreceives results and posts video URLs back to the Slack thread
API Endpoints Used
| Endpoint | When | Purpose |
|---|---|---|
GET /api/content/validate | Before triggering | Checks if the artist has required assets |
POST /api/content/create | On mention | Triggers the video generation pipeline |
GET /api/content/templates | Reference | Lists available content templates |
POST /api/content-agent/callback | After completion | Internal — receives poll results |
Setup
1. Create a Slack App
- Go to api.slack.com/apps and create a new app
- Under OAuth & Permissions, add bot scopes:
chat:write— post messagesapp_mentions:read— receive @mention events
- Under Event Subscriptions:
- Enable events
- Set the request URL to
https://recoup-api.vercel.app/api/content-agent/slack - Subscribe to
app_mentionbot event
- Install the app to your workspace
2. Configure Environment Variables
| Variable | Where | Description |
|---|---|---|
SLACK_CONTENT_BOT_TOKEN | API (Vercel) | Bot OAuth token (xoxb-...) from Slack app |
SLACK_CONTENT_SIGNING_SECRET | API (Vercel) | Signing secret from Slack app Basic Information |
CONTENT_AGENT_CALLBACK_SECRET | API + Tasks | Shared secret for callback authentication (generate a random string) |
RECOUP_API_KEY | API + Tasks | Recoup API key for authenticating pipeline requests |
RECOUP_API_BASE_URL | Tasks (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:- An immediate acknowledgment message
- A video URL reply in the thread after ~5-10 minutes
Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
| No response from bot | Event subscription URL not configured | Check Slack app Event Subscriptions |
| ”Artist not found” | Invalid artist_account_id | Verify the UUID exists in the platform |
| ”No GitHub repository found” | Artist missing repo config | Ensure the artist account has a linked GitHub repo |
| Timeout after 30 min | Pipeline took too long | Check Trigger.dev dashboard for the failed run |
| ”Unsupported template” | Invalid template name | Use GET /api/content/templates to list available templates |
