Research

How we built the after-sales agent

By Shubham, Founder6 min read

Eturns is not a rules engine with a chatbot on top. It is an agent that reasons about each case using the merchant's policies, the customer's history, and the order context — then takes an action, with the reasoning trace visible at all times. Here is how it works, in one pass.

The decision loop

Every case enters the loop the same way. The agent assembles context: the order, the return window, the customer's history with the store, and the merchant's active policies. It then plans — picking the actions that fit the case within the policy bounds — and executes them through tools: approving a return, requesting evidence, opening a refund, escalating for approval.

The loop is capped at a small number of iterations per case, so a stuck case can never burn tokens or time. When the loop ends, the decision is written to the audit trail whether it approved, escalated, or failed.

Routing by difficulty

Not every case deserves the same model. Eturns routes by complexity: a fast triage model handles the first pass of routine cases, a deeper reasoning model takes the hard ones, and a vision-capable model reads photos for evidence (a damaged box, a defect, a matching serial). Routing is a calibration decision, not a badge — it changes with the data.

The audit trail is the product

Every AI decision writes a row: the model used, the prompt hash, the context summary, every tool call, the final action, the dollar amount affected, and the reasoning trace. A merchant can open any decided case and see exactly why the agent did what it did — and re-run the reasoning themselves. That trace is the difference between an AI you trust and a black box you babysit.

The agent is not guessing. It is deciding, and showing its work.

Written by Shubham, Founder of Eturns. Questions or feedback? Write to contact@eturns.app.

← All posts

After-sales, handled.
Start using today.

Install

Install from the Shopify App Store. Write your policies once. Eturns applies them to every case.