---
title: "Agent: Review Reply"
summary: "Replies to strong reviews automatically and drafts replies for the rest, in your own Supabase project."
updated: "2026-09-30"
status: stable
origin: official
url: "https://swooshconnect.com/docs/agent-review-reply/"
---

# Agent: Review Reply

Replies to strong reviews automatically and drafts replies for the rest, in your own Supabase project.

## For AI agents

- Runs every 15 minutes (*/15 * * * *) from supabase/functions/run/index.ts in the customer's Supabase project.
- Only call SwooshConnect's API, never a platform directly: read with `inbox_list`, send with `inbox_reply`.
- Replies at or above AUTO_REPLY_MIN_RATING (4 stars) are sent automatically; this replies publicly. Lower ratings are saved as drafts.
- Tables: pending_replies (drafts) and sent_replies (dedupe). Never send an item twice.
- Keep imports with a .ts extension; never ship test files in the function folder.
- Never log review text or a secret. Read AI_MODEL_PROVIDER and AI_MODEL_KEY with Deno.env.get.

## What it does

Every 15 minutes it checks your connected accounts for new reviews and comments. Anything rated 4 stars or higher gets a short, warm, specific reply posted automatically. Anything lower, or a comment with no rating, is drafted and saved for you to read and send yourself.

It follows up to MAX_PAGES pages of your inbox per account per run (5 by default). A single account or item failing is logged and skipped; it never stops the rest of the run.

## Schedule

```text
*/15 * * * *
```

## Settings

| Setting | Label in the portal | Visibility |
| --- | --- | --- |
| AI_MODEL_PROVIDER | AI provider (anthropic or openai) | Choice |
| AI_MODEL_KEY | Your AI model key | Secret |

If you have saved an AI key in your accounts, pick it on the deploy form and these two settings are filled in for you.

## Tables it creates

```text
pending_replies   drafted replies: original text, rating, draft
sent_replies      every reply already sent, so none is sent twice
```

Open your Supabase Table Editor and look at pending_replies. Each row holds the original text, the rating and a draft column with the suggested reply. Items already in either table are skipped on later runs.

## How to extend

- Change the AUTO_REPLY_MIN_RATING constant at the top of `supabase/functions/run/index.ts` to move the threshold.
- Raise MAX_PAGES in the same file if you get a very high volume of new items.
- Edit the reply prompt to change the tone or add your house rules.
- Send a notification when a draft is saved, for example an email to yourself.

## Safety notes

> **Must:** Replies to 4-star and higher reviews are posted publicly and automatically, with no approval step. Raise the threshold above 5 if you want to approve every reply.

> **Never:** Do not call a platform directly and do not log review text or keys. Reach your accounts only through SwooshConnect's API.

See [Agents](https://swooshconnect.com/docs/agents/) for deploying, refreshing and removing.
