This guide outlines the end-to-end development of an automated customer support backend using a fictional Amazon outdoor brand (Harbor & Pine). The stack is built on Python 3.13, uv, FastAPI, Supabase, and Docker.
Architecture and Workflow
The design intentionally avoids webhooks, external workflow engines, and queue brokers:
- Outbound Polling: A background poller checks Gmail at fixed intervals. Because traffic is strictly outbound, the server requires no public web ports or reverse proxy.
- Tiered LLM Pipeline: A smaller Anthropic model classifies incoming tickets. A larger model drafts replies using tools that search support documentation stored in Supabase.
- Code Guardrails: Plain Python guards enforce safety boundaries, such as preventing self-reply feedback loops, and retain full veto authority over whether to dispatch an automated email or hand it over to human staff.
The tutorial avoids a starter repository in favour of building file-by-file with the help of coding agents like Cursor, Claude Code, or Codex. It serves as a solid blueprint for standardising repeatable customer inquiries against documented store policies.