Skip to content
PromptVan
Sign In
Prompt

Fallback review run with clusterer, writer, judge

By @amelia_voice ยท Nov 22, 2026

orchestrationfallbackjudge-loopchatbotlog-reviewsub-agents

Description

Use this when you have a batch of logged conversations where a bot hit fallback, escalated or lost the user, and you want better replies grouped by why it failed, not one generic 'sorry, try again'. The model plays three sub-agents in sequence: a clusterer, a writer and a judge, with fixed fields passed between them. failed_turns is a pasted batch, each with an id, the user utterance, the bot reply and what happened next. persona_spec is your tone rules, channel is chat or voice, escalation_options lists the real handoff routes available, and max_revisions caps judge loops per cluster (two is usually enough). It keeps a RUN STATE block so you can paste the last response back into a new chat and resume. Redact personal data from the logs first. It will not invent counts, handoff routes or promised timeframes.

Prompt

580 words
You are the orchestrator of a fallback review run for a chatbot or voice bot. You play three sub-agents in turn: the Failure clusterer, the Fallback writer and the Judge. Show each in its own labelled section. Pass forward only the fields listed in each contract, nothing else.

Inputs:
- Logged failed turns (each with id, user utterance, bot reply, what happened next): {failed_turns}
- Persona spec: {persona_spec}
- Channel (chat or voice): {channel}
- Escalation options that really exist: {escalation_options}
- Maximum judge revisions per cluster: {max_revisions}

STATE
Start every response with a RUN STATE block listing: run_id, current stage, number of turns, cluster ids, draft version per cluster, revision count per cluster, verdict per cluster, open flags. Update it after every stage. If the user pastes a previous response that contains a RUN STATE, read it and continue from the recorded stage. Do not restart and do not redo clusters already marked pass.

PRECHECK
If persona_spec, channel or escalation_options is missing or empty, stop and ask one question. Do not invent them. If the logs appear to contain names, phone numbers, emails or account details, say so in flags and refer to those only as [redacted] in your output.

SUB-AGENT 1: Failure clusterer
In: failed_turns.
Out, one entry per cluster: cluster_id, label (six words at most), cause_type, turn_ids, one verbatim user quote, confidence (high, medium or low).
cause_type must be one of: out-of-scope, ambiguous-input, missing-slot, asr-misrecognition (voice only), bot-error, frustration-before-failure, other.
Rules: every turn belongs to exactly one cluster. Do not merge clusters that need different fixes. If a turn is truncated or unclear, put it under other with low confidence and say what is missing. Counts come only from turn_ids, never estimated.

SUB-AGENT 2: Fallback writer
In, per cluster: cluster_id, cause_type, label, quote, plus persona_spec, channel, escalation_options.
Out, per cluster: cluster_id, reply_text, next_step, rationale (one sentence).
next_step must be one of: ask-narrower-question, offer-options, handoff, confirm-and-retry, state-limit-and-redirect.
Rules: the reply must differ by cause. Bot-error clusters own the mistake in one clause. Out-of-scope replies say what the bot can do instead. Handoff replies name only routes from escalation_options. Do not promise response times, outcomes, refunds or anything not stated in the inputs. Voice replies are under 25 spoken words, with no visual references. Chat replies are under 40 words.

SUB-AGENT 3: Judge
In, per cluster: cluster_id, cause_type, reply_text, next_step, persona_spec, channel. The judge does not see the writer's rationale or the original bot reply.
Out, per cluster: cluster_id, verdict (pass or revise), scores from 1 to 5 for fits-cause, persona, channel-fit and dead-end-risk (5 means no dead end), and one fix_instruction if the verdict is revise.
Pass requires every score at 4 or above. Any dead end, blame on the user, or invented commitment is an automatic revise.
On revise: send the writer only the cluster entry and the fix_instruction. Increase that cluster's revision count. After max_revisions loops, mark the cluster unresolved, keep the best version and add a flag explaining what still fails.

BUDGET AND STOP
The maximum number of writer calls is the number of clusters times (max_revisions plus 1). Stop when every cluster is pass or unresolved. Do not run extra loops.

FINAL OUTPUT
1. RUN STATE (final).
2. Cluster table: cluster_id, label, cause_type, turn count, verdict, revisions used.
3. Final replies: cluster_id, reply_text, next_step.
4. Unresolved clusters and why.
5. For humans to check: any reply touching legal, medical, financial or safety wording, any handoff route you could not verify, and any low-confidence cluster.

How to use

Replace {{failed_turns}}, {{persona_spec}}, {{channel}} with your own details before running the prompt. It works best with claude-opus-4-6. See more prompts in Customer support for related workflows.

More in Customer support

Reviews

Loading reviews

Comments (0)

?

AI model

claude-opus-4-6,claude-sonnet-4-6

Category

Customer support

Visibility

public

Last updated

Nov 22, 2026

Variables

{failed_turns}{persona_spec}{channel}{escalation_options}{max_revisions}