Back to articles
Building an AI Price War Simulation: A Technical Deep Dive

Building an AI Price War Simulation: A Technical Deep Dive

via Dev.to JavaScriptHarish Kotra (he/him)

In the village square, two merchants are locked in a ruthless battle for bread supremacy. But these aren't human players—they're AI agents powered by Google Gemini and Qwen 2.5 . In this post, we'll explore how we built AI Price War , a real-time market simulation that combines turn-based AI decision-making with a high-performance canvas-based customer simulation. The Vision The goal was to create a "living" market where: AI Agents act as shop owners, making strategic decisions on pricing and marketing. A Simulation models individual customer behavior, reacting to those AI decisions. A Critic AI evaluates the "hype" of marketing slogans to influence customer choices. The Architecture The application is a React 19 SPA, but it's more than just a dashboard. It's a hybrid of a turn-based game and a continuous physics simulation . 1. The AI Decision Loop ( runTurn ) Every 10 seconds, the runTurn function orchestrates the AI's moves. It gathers the current market state (competitor prices, ba

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
7 views

Related Articles