Case study

LLM agents in production: a multi-channel payments platform

The situation

Small service businesses lose hours every week chasing late payments and onboarding new clients. The product thesis: an autonomous platform that does that work for them, over the channels their clients actually use. I designed, built, and shipped it end-to-end as sole engineer, from data model to production deployment.

What I built

A multi-tenant billing and payment collection platform in TypeScript: Express and Next.js on top of PostgreSQL, running on AWS.

The interesting part is the agent layer. Conversation analysis, booking extraction, and business context each run as a specialised agent, routed through a shared provider registry. Model selection is matched to task complexity and cost, running Claude (Sonnet and Haiku) via AWS Bedrock in production. Every agent returns typed, Zod-validated output, so free-form strings never reach business logic.

Agent invocations run as background jobs on pg-boss: async, retryable, and decoupled from the request cycle. A usage log with per-model pricing config gives per-user cost attribution, so I can see exactly what each tenant's AI usage costs before the cloud bill arrives.

On top of that sits the conversation engine: a WhatsApp Business API integration with approved templates, inbound webhook handling, and a state machine that runs payment-chase and client onboarding flows autonomously. The messaging layer spans WhatsApp, SMS, and email, with policy-driven scheduling and per-client channel selection. Payments run through Stripe Connect: account linking, payment intents, webhook ingestion.

The outcome

The platform is live in production. The codebase has grown through 67 schema migrations while staying shippable, with background job queues and multi-channel messaging integrations running daily. Conversations that used to need a person, chasing an invoice, booking a slot, collecting onboarding details, now run end-to-end through the agent layer, and every output that touches business logic is schema-validated.

For teams trying to get past the prototype stage with LLMs, this is the shape of the answer: agents as background jobs, typed outputs, cost attribution from day one, and model choice treated as an engineering decision rather than a default.

Every agent in this system returns typed, validated output. That one decision is why it runs in production instead of in a demo.

Built with: TypeScript, Express, Next.js, PostgreSQL, AWS Bedrock, pg-boss, Twilio (WhatsApp Business API), Stripe Connect.