Skip to content
Demo store. Payments and emails are simulated. Don't enter real personal data.
Agent · Tools · Memory · Human approval

The returns agent that knows when to ask.

An AI support agent for a demo store. It looks up orders, checks the return policy and starts returns. Before any risky refund, it stops and waits for a person to approve.

Take the tour

3-minute demo · no sign-up · each visitor gets a private copy of the store

Follows the rules

Eligibility and refund limits come from tested code, never from the AI's guess.

Waits for a human

Refunds over $50 pause until a reviewer approves, edits, or rejects them.

Remembers you

Preferences carry across chats, and every step is traced so you can see why.

How it works

One request, five safe steps

Every chat turn runs through the same pipeline. The interesting part is step four: the agent can't move money on its own.

  1. 1. Ask

    A customer asks about an order in plain words.

  2. 2. Tools via MCP

    The agent looks up orders and checks eligibility with real tools.

  3. 3. Policy engine

    Tested rules — not the AI — decide what's allowed.

  4. 4. Human approval

    Risky refunds pause until a reviewer approves.

  5. 5. Async job

    An idempotent job issues the refund; chat updates live.

Architecture

Small, real, and free to run

A Next.js front end on Vercel talks to one Docker container on Render: the agent, the MCP server, the policy engine and a job queue, all backed by Postgres on Neon.

Browser

Chat · reviews · traces

Next.js on Vercel

Auth.js · route guards

JWT proxySSE passthrough

FastAPI on Render · one Docker container

LangGraph agent

Checkpoints · interrupt()

MCP server

Order & refund tools

Policy engine

Deterministic rules

Celery + Redis

Idempotent jobs

Groq + Gemini

Free LLMs · routing, fallback, quota guard

Neon Postgres

+ pgvector

Business dataMemoryTraces
The browser never talks to the backend directly — the Next.js server signs a 5-minute token for every call and streams replies through.

What it shows

What companies actually build

Not a single prompt with no tools — the pieces a production support agent needs.

  • Real tools over MCP

    A custom Model Context Protocol server exposes the order system. The customer id is injected from the token, so the model can't ask for someone else's data.

  • LLM proposes, code disposes

    Write tools return proposals. A deterministic policy engine with 100% test coverage decides eligibility, limits and when a human is needed.

  • Pause, approve, resume

    LangGraph interrupts at the approval gate and checkpoints to Postgres — a reviewer can decide hours later and the run resumes exactly there.

  • Memory you control

    Long-term preferences live in pgvector, are filtered for sensitive data, and can be viewed and deleted by the customer.

  • Every step traced

    Router, LLM calls, tools, guards, policy, interrupts and jobs — with timings and tokens — on a step-by-step timeline.

  • Evaluated on trajectories

    30 scenarios check the right tools in the right order, forbidden tools never called and zero policy violations.

  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS v4
  • Auth.js
  • TanStack Query
  • FastAPI
  • LangGraph
  • MCP
  • Celery + Redis
  • PostgreSQL
  • pgvector
  • Groq · Llama 3.3
  • Gemini
  • Vercel
  • Render
  • Neon

Play both sides of a risky refund.

Ask for a refund as Maya, approve it as Riley, then watch the job finish and the chat update — in about three minutes.

Read the code
ReturnPilot

A portfolio project: an AI returns agent with MCP tools, a deterministic policy engine, memory, human approval and full tracing — running entirely on free tiers.

Northwind Outfitters is a fictional store. Payments and emails are simulated. Built with Next.js, FastAPI and LangGraph.