# Review the evidence before asking Sales to act

This small component turns supplied trial notes into a useful next action. Growth chooses the offer to test; Jev reads the available statements; Marketing Ops applies the company’s established email-program rules; Sales confirms qualification when a conversation warrants it.

The question is practical: **What would be useful to this account next?** A recurring team task can justify testing an evaluation offer before the account expresses buying intent. A stated evaluation merits a faster response. Individual learning may call for self-serve help, while conflicting notes need clarification. Enrichment and product activity add context; they do not supply statements the account never made.

## What ran, and what is reusable

The public demonstration uses synthetic notes. Its saved results and execution receipts identify whether a Jev request completed through Vercel AI Gateway, which question version was used, and what the provider reported. An unavailable or failed result stays visible; it does not receive an invented classification. The saved receipt, rather than this guide, establishes an executed request, duration or charge.

The fixture's expected labels were authored before inference and kept out of model input. Disagreements stay in the saved result. Agreement on this small invented set checks the integration and rubric; it is not an independent accuracy benchmark or a measurement of human time saved.

The companion [native SQL template](../../scripts/duck-yeah/sql/candidate_review_native.sql) is prepared for a team's own MotherDuck environment. **It has not been executed with native `prompt_jev` for this demonstration.** The two paths use the same question definitions but different adapters. Matching questions does not promise matching answers or model versions.

Reading the page, opening the source or retrieving our MCP template does not trigger model inference. The public MCP supplies artifacts and instructions. It does not connect to a visitor's warehouse or use their credentials.

## The review packet

Each packet keeps account and packet IDs, a decision cutoff, email-program status, source IDs and verbatim source text together. Internal analysis requires usable source text at that cutoff. Email eligibility, company fit and a first query are context for the operator; they do not block reading those notes. The prompt version and question hash identify the fixed rubric. The input hash identifies the exact text the model received.

The fixed version is `dy-candidate-review-v2`. Its three questions check a recurring team task, explicit team-evaluation intent and contradictions among statements. The shared object lives in `candidate-review.mjs`; its canonical SHA-256 is `1a8925b2778553e5f07b1534a1fc9966586633cbbfa3509d631b6a4e2cc37f49`. The native SQL embeds that same object as a constant. A missing intent statement can lead to a useful proposed offer; it is not an automatic rejection.

The native mapper supplies two columns: `account_id` for the canonical company and `packet` as JSON. The packet follows the fixture’s structure: `id`, `trialStartedAt`, `decisionAt`; `emailEligibility` and `companyFit` with `status`, `availableAt` and `source`; `firstQuery` with `occurredAt`, `availableAt` and `source`; and up to six `evidence` entries with `id`, `source`, `occurredAt`, `availableAt` and `text`. Email eligibility is `eligible`, `suppressed` or `unknown` under the company’s established program rules. It is not a separate Sales opt-in. Company fit is `yes`, `no`, `unknown` or `conflict`. Timestamps need an explicit offset. Authored fixture labels and expected answers never enter model evidence.

The brief separates `recommendation` and `nextAction` from `emailAction`. Suppressed accounts can still receive an internal recommendation; their email action remains suppressed. Missing or late program status means check the program rules before sending. Recheck current eligibility when an actual campaign runs.

The native input labels its statements as quoted account evidence; the Gateway rehearsal explicitly labels its inputs synthetic. Both preserve the same statement fields and questions. Native fingerprints therefore identify native input bytes, not a claim of byte-identical Gateway requests.

Keep the returned choice, complete probability distribution and confidence for each question. Confidence describes the model's answer; it is not a probability that the account will qualify, a forecast of revenue or proof of intent. The brief should identify the evidence a person must check and the next action it suggests.

Retain a separate human review outcome and reason. Do not substitute a model's recommendation for Sales confirmation of company fit, a validated team use case and an agreed next step. A delivered packet, booked meeting or enrichment result is also not that outcome.

## Reuse it in MotherDuck

The template expects a mapped input relation, not an arbitrary CRM schema. Keep the underlying account information in your own environment and use opaque identifiers where names are unnecessary.

If the connections are not already available, follow the [agent setup guide](agent-setup.md). The public Duck Yeah MCP supplies the template; your authenticated MotherDuck connection runs it against your data. Native `prompt_jev` is a billed preview feature with account and regional requirements; verify the [current availability and usage terms](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/prompt-jev/) before inference. The history replay in that setup guide is a separate SQL-only first step with normal warehouse usage.

1. Retrieve `get_candidate_review_template` with `{"execution":"motherduck"}` from this project's public MCP, or download the kit. It returns the question definitions, input contract, SQL and setup guidance. It does not run them.
2. In your own official MotherDuck MCP, call `get_query_guide`, inspect the schema and map historical evidence to the packet contract. Current program status or intent fields alone cannot reconstruct what was known earlier.
3. Choose a mixed batch in the mapping: clear needs, unclear or conflicting notes, and missing or late evidence. The template sorts by packet ID and selects at most five; it does not select a representative batch for you. Preview that bounded input with an ordinary `SELECT` before calling the model. Check source text, availability timestamps and the cutoff. Missing or later source text stays held. Missing fit, query activity or email eligibility does not block internal analysis.
4. Review your organization's native AI availability and the intended inference usage. When you choose to run the native model, execute the bounded SQL through your MotherDuck workspace or its official MCP `query` tool. A `SELECT` containing `prompt_jev` performs inference even though it writes no table.
5. Review every returned answer against its sources. Keep null, failed or unclear answers in a manual-review queue. Save the input fingerprint, question version, raw result and actual execution receipt in your team's chosen system before repeating the job.

The template returns a recommendation and a separate email-program action. It has no CRM write, email send or enrichment trigger. The sample limit controls selected inputs; it does not promise a fixed number of retries or charges.

Preparation checks covered exact shared-question parity, the 30 synthetic packets' input gates and retained source IDs, the five-packet bound, and null or malformed answer handling in local DuckDB with a test substitute for the model. These checks do not establish native availability, native model behavior, native performance or native charges.

## Rehearse the synthetic packets through Vercel

The bundled Gateway runner uses Node.js 22.12 or later and built-in modules; `npm install` is unnecessary. It accepts the versioned synthetic fixture contract, not arbitrary customer records. For own-data mapping, use the MotherDuck path above.

From the kit root, preview a maximum of five new requests without inference or file writes:

```sh
node scripts/duck-yeah/candidate-review.mjs --dry-run --max-items 5 --max-usd 0.01
```

To run that bounded rehearsal, make your own `AI_GATEWAY_API_KEY` available privately in the process environment, then explicitly execute. These output paths keep your receipts separate from the bundled saved demonstration:

```sh
node scripts/duck-yeah/candidate-review.mjs --execute --max-items 5 --max-usd 0.01 --ledger .duck-yeah-private/my-candidate-review.jsonl --output .duck-yeah-private/my-candidate-review.json
```

The runner calls `typesafe-ai/jev` through Vercel AI Gateway. `--max-items` limits new requests; `--max-usd` checks recorded charges plus a local estimate before dispatch. That estimate is not a provider-enforced billing ceiling. Inspect its printed basis and the actual provider-reported charges. A missing charge or uncertain request stops further spending so it can be reviewed.

Keep the ledger. It binds saved answers to their inputs, question version and fixtures and prevents an unchanged request from being sent again automatically. Do not delete it to retry an uncertain call. Inspect that call first. Open the resulting JSON to compare source notes, full answers, authored expectations and unresolved cases; any mismatch remains part of the result.

## Native function details

MotherDuck's native `prompt_jev` accepts one text input and a constant set of questions. The template uses the exact shared questions as JSON and materializes the model call before reading its fields. Native choice answers contain a selected label, an array of label probabilities and confidence. The Gateway adapter returns a different wire shape, so preserve the provider result and normalize explicitly. Native uses `jev-latest`; it has no model selector. [MotherDuck function reference](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/prompt-jev/)

The function is in preview, requires an eligible organization with AI functions enabled, and has regional restrictions. Supplied text is processed through MotherDuck's TypeSafe integration. Native consumption is billed through MotherDuck's AI usage; a Gateway receipt is not a native price quote. Verify the current account terms and data-processing requirements before running company data. [Availability and behavior](https://motherduck.com/docs/sql-reference/motherduck-sql-reference/ai-functions/prompt-jev/)

## If the answer is missing or unhelpful

An unknown or ambiguous answer needs a human to inspect the source or obtain the missing fact. A null answer may reflect a missing input, failed request or timeout. A query-level error supplies no completed review; preserve it and investigate before another run. Do not translate any of these states into positive intent, a negative business outcome or a successful handoff.

Retries can incur additional usage. The template does not automatically launch a second pass. Retain successful outputs before choosing whether to retry specific failures; an unchanged page refresh should read saved results. Native materialization helps avoid repeated evaluation inside the query, while persistence and request deduplication require a deliberate implementation outside this read-only template.

For a first production candidate, have Ops and Sales review a small selection of positive, negative and ambiguous packets. Decide which evidence and failure states require manual review. This checks whether the component is useful enough to develop further; a handful of synthetic examples cannot establish model accuracy, saved Sales time or campaign lift.

## A prompt for your own agent

> Call `get_candidate_review_template` with `{"execution":"motherduck"}` on the Duck Yeah MCP. Use my official MotherDuck MCP’s guide and schema to prepare the mapping. Show source text and the cutoff for at most five packets before inference. Use native `prompt_jev` within the scope I authorize. Recommend a useful next step even when buying intent is unknown; keep fit and product activity as context. Return original sources, complete answers and unresolved cases. Report established email-program eligibility separately from the recommendation. Do not send messages, update CRM records, invent intent or mark an account qualified.

## Footnote for the public demonstration

Use after the saved Gateway receipt confirms execution:

> Jev reviewed these synthetic notes through Vercel AI Gateway. The reusable MotherDuck template asks the same questions with native `prompt_jev` in your own account; that path is prepared, not executed here.

Reference checked 2026-09-29. Preview APIs can change. Preserve this version and review the current native documentation before adapting it.
