Follows the rules
Eligibility and refund limits come from tested code, never from the AI's guess.
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.
3-minute demo · no sign-up · each visitor gets a private copy of the store
Eligibility and refund limits come from tested code, never from the AI's guess.
Refunds over $50 pause until a reviewer approves, edits, or rejects them.
Preferences carry across chats, and every step is traced so you can see why.
How it works
Every chat turn runs through the same pipeline. The interesting part is step four: the agent can't move money on its own.
A customer asks about an order in plain words.
The agent looks up orders and checks eligibility with real tools.
Tested rules — not the AI — decide what's allowed.
Risky refunds pause until a reviewer approves.
An idempotent job issues the refund; chat updates live.
Architecture
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
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
What it shows
Not a single prompt with no tools — the pieces a production support agent needs.
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.
Write tools return proposals. A deterministic policy engine with 100% test coverage decides eligibility, limits and when a human is needed.
LangGraph interrupts at the approval gate and checkpoints to Postgres — a reviewer can decide hours later and the run resumes exactly there.
Long-term preferences live in pgvector, are filtered for sensitive data, and can be viewed and deleted by the customer.
Router, LLM calls, tools, guards, policy, interrupts and jobs — with timings and tokens — on a step-by-step timeline.
30 scenarios check the right tools in the right order, forbidden tools never called and zero policy violations.
Ask for a refund as Maya, approve it as Riley, then watch the job finish and the chat update — in about three minutes.