back to index

building an ai-powered order system

Problem: A century-old pet food manufacturer processed orders manually. Customers sent orders via email as PDFs or spreadsheets. Staff read each document and typed data into two separate ERP systems for every order. Manual processing couldn't handle volume growth.

INSPIRED Pet Nutrition's Tech Stack - Order Management System architecture showing Medusa OMS with Gemini AI, Resend, and ERP integrations
System architecture (source: medusajs.com)

Solution: An order management system on Medusa that automates the entire flow. Email arrives with a PDF or spreadsheet. AI parses the unstructured data. System creates a draft order. Staff reviews and confirms. Order syncs to the correct ERP.

Result: 9x faster order processing. 80% cost reduction. Most orders now flow through automatically.

Why It Worked

Medusa's modular architecture let us build exactly what was needed. We extended it with custom modules for each ERP (IFS and Tropos), added AI parsing workflows, and built a tailored Admin UI. No framework limitations. No rebuilding core commerce logic. Just focus on the custom parts.

The tech stack: Medusa 2.5 for the OMS backbone, Medusa Admin with Microsoft SSO for the UI, AWS (Fargate, CloudFront) via SST v3, PostgreSQL on Neon, SOPS for secrets management.

We deployed everything on AWS using infrastructure-as-code. The whole system runs on Fargate containers with Medusa's Workflow engine handling async workflows. No custom frontend needed. Medusa's admin panel handled everything.

What I Learned

Start with workflows, not screens. We mapped the entire order flow before writing code. This made technical decisions obvious. Understanding the process came before choosing technology.

Modular wins. Each ERP got its own module. When one ERP changes (like Tropos switching from VPN to direct API), we update one module. The rest keeps working.

AI is a tool, not magic. It parses emails well, but humans still review orders. The system suggests, staff confirms. This balance enables production reliability. Trust but verify.

Documentation quality affects build speed. Medusa's documentation provided clear examples, searchable content, current information. Good docs translate directly to faster delivery.

The Details

INSPIRED Pet Nutrition is now scaling the system to a third ERP after another acquisition.

For us at rb2, this became more than a client project. The architecture evolved into a reusable B2B automation product we're offering to other manufacturers.

Read the full case study on Medusa's blog.


I led this project as Delivery Director at rb2, with some solution architecture and hands-on coding mixed in. We help companies build custom commerce systems that actually work.