Skip to main content

Scenario

Your products accumulate reviews through Shopify metafields or a third-party app like Judge.me. You pull review text for each product, batch them into Mavera responses with a structured-output persona, and receive a sentiment breakdown with recurring themes (quality, shipping, sizing, value).

Architecture

Code

Example Output

Error Handling

If your store doesn’t use the reviews namespace, the API returns an empty array — not an error. The code falls back to Judge.me automatically. For Loox or Yotpo, replace the fallback URL with their respective API endpoint.
When batching many reviews, the prompt may exceed the context window. The code caps at 40 reviews. For very long reviews, truncate each body to 200 characters. If still too large, split into batches of 20 and merge outputs.