Menu
E-commerce/Ammunition

Simulation-Driven Fulfillment Decision Engine

Intelligent packing simulation system that explores multiple strategies to optimize box combinations and shipping efficiency

3 senior engineers team members
E-commerce/Ammunition
Share:

Project Overview

They started where a lot of fast-growing e-commerce operations start: with a manual process that worked well enough to get the business off the ground.

In the early days, the team could rely on human judgment to assemble shipments and keep things moving. As volume increased and the subscription model matured, they introduced a simplified "picker" that could suggest how to combine inventory into standard box sizes. It helped, but it was intentionally lightweight - more of a starting point than a final system. Over time, the reality of the domain caught up with it.

This business was not simply shipping items from a shelf. Customers accumulated rounds gradually and shipments only went out once quantities fit standard packaging sizes like 20, 50, or 100. On top of that, shipments needed to maintain a target mix across quality grades, so customers consistently received the right balance. As inventory shifted day to day, the number of possible "valid" box combinations became enormous, and the simplified picker was never meant to explore that space.

That is where we came in, with a clear goal: build something genuinely game-changing that could make strong decisions automatically, without turning the process into something rigid or hard to adjust.

Instead of trying to force a single "smart" algorithm to solve every scenario, we implemented a simulation-driven decision engine. The idea was straightforward: when there are many valid ways to pack boxes, do not guess. Try several approaches quickly, score the outcomes against what matters most, and choose the best plan for the current inventory situation.

We built an engine that could rapidly generate multiple candidate packing plans by exploring different strategies side by side. One strategy leaned into what was most available to help keep inventory balanced. Another focused on maximizing larger box usage to simplify shipping and reduce handling overhead. A third intentionally produced a more diverse mix of box sizes to tighten packing efficiency and reduce the chance of small leftovers. Each simulation produced a complete plan, along with clear measurements: how closely it hit the target grade mix, how much waste or "leftover" quantity it created, and how complex the final packing list would be to execute.

From there, we added a refinement step for the best candidates so the final decision was not just "good" - it was consistently precise. The system could fine-tune allocations to land extremely close to exact box totals while respecting the grade mix constraints, which meant fewer edge cases and less manual adjustment. The scoring model was equally practical: prioritize minimal leftover first, then choose the plan that produced efficient packing, and finally prefer simpler packing lists that were easier to label and execute.

The result was an approach that felt like having a skilled operator making decisions, except it could do it instantly, consistently, and at scale.

Just as important, we designed the engine to be adaptable. The business was evolving, so the system had to evolve with it. We structured the rules, scoring, and strategies so they could be adjusted without ripping out the core. When packaging options changed or new inventory patterns emerged, the engine could be tuned quickly, and new strategies could be added without destabilizing the rest of the workflow.

Once the decision engine was in place, we carried the same philosophy into the customer-facing experience. We moved away from a fragmented, step-by-step shipping flow and toward a unified, interactive workflow where customers could mix inventory items, add extras on the spot, and immediately see how changes affected their shipment outcome and shipping incentives. Instead of requiring customers to infer what the system would do, the interface made it visible in real time. That removed guesswork, made the process feel more predictable, and improved completion rates.

To make sure the improvements lasted, we strengthened the foundations around it: expanding automated test coverage in the areas most likely to break under edge cases, improving reliability in pricing and inventory data flows, and implementing an automated CI/CD pipeline with enforceable checks. That combination meant the team could continue to iterate quickly and safely as the business grew, without the constant concern that improvements would introduce regressions.

The longer-term win was not just better packing. It was a fulfillment and shipping system that could make smart decisions based on current conditions, could be modified as the business learned, and could support growth without requiring the process to be reinvented every time volume or inventory patterns changed.

Key Challenges

  • Massive combinatorial complexity in valid box configurations
  • Maintaining target grade mix ratios across varying inventory
  • Replacing manual judgment with automated decision-making
  • Building adaptable algorithms that evolve with business needs
  • Unifying fragmented customer-facing shipping workflows

Technologies & Solutions

Ruby on Rails for backend systems Simulation-driven decision algorithms Multi-strategy scoring and optimization RSpec for comprehensive test coverage Advanced CI/CD pipeline automation Real-time interactive customer workflows

Key Metrics

Instant automated fulfillment decisions at scale
Precise grade mix compliance with minimal waste
10% increase in automated test coverage
Improved customer completion rates

Results & Impact

Replaced manual fulfillment with instant, consistent, and scalable automated decision-making

Simulation-Driven Fulfillment Decision Engine

Want Similar Results?

Let's discuss how we can help solve your engineering challenges.