Inspiration:

In the fast-paced world of sports retail and event management, supply chains face a unique challenge: extreme, localised demand spikes. Standard inventory management systems operate on historical, linear data averages. They fail to prepare warehouses when a high-attendance, 80,000-capacity event like the FIFA World Cup Final suddenly shifts logistics parameters to a specific regional hub. We were inspired to build the MatchMarket Logistics Engine to bridge the gap between dynamic event scheduling and live warehouse inventory, transforming supply chain management from a reactive chore into a proactive operational strategy.

What it does:

The MatchMarket Logistics Engine acts as an autonomous, intelligent operations manager. It interprets natural language user queries, audits warehouse stock health against upcoming event calendars, automatically flags critical supply shortages, and securely executes database modifications. Instead of forcing managers to cross-reference schedules with stock sheets manually, the engine proactively builds pre-allocation plans—ensuring that high-demand merchandise is ordered, shipped, and shelved before fans ever arrive at the stadium gates.

How we built it:

The architecture of the MatchMarket Logistics Engine is entirely decoupled, optimising for speed, cost-effectiveness, and data integrity: • Unified Agent Engine: Built using the new Google Agent Development Kit (ADK) and powered by Gemini 3.5 Flash to handle complex reasoning, intent extraction, and automated tool orchestration. • High-Performance Data Layer: Hosted on MongoDB Atlas, where we collapsed a complex relational structure into a sleek, 2-collection document store (inventory for products, suppliers, and promos; events for matches and localised venue metadata). • Context Memory Framework: Integrated with an async SQLite session history buffer (sqlite+aiosqlite) to maintain flawless multi-turn conversational state across serverless instances on Google Cloud Run.

Challenges we ran into:

We hit two major technical bottlenecks during development: • Tool-Looping & Latency: In early builds, vague prompts caused the agent to enter cyclic reasoning loops—attempting up to 73 separate database transactions to modify fields as it guessed at structural keys. We resolved this by engineering a strict "Lookup-Before-Update" verification protocol inside the system instructions, forcing the agent to match target schema keys with absolute precision before executing writes. This instantly stopped the infinite looping issue. • UI Layout Corruption: Hidden whitespace handling inside Python multi-line triple-quoted strings (""") accidentally injected leading spaces into our prompt payloads. This corrupted the markdown rendering engine, flattening clean data arrays into dense blocks of unreadable text. We resolved this by refactoring our instruction blocks to pull table layout definitions completely to the absolute left margin of our code file.

Accomplishments that we're proud of:

We are incredibly proud of successfully transitioning from a complex, fragmenting 5-collection database architecture down to a highly optimised 2-collection schema. This change alone reduced data latency and completely removed structural key confusion for the LLM. Furthermore, we built an agent that doesn't just passively answer questions, but actively enforces strict operational guardrails—such as refusing to guess missing database keys and demanding explicit user confirmation before executing permanent data deletions.

What we learned:

This project served as an incredible masterclass in designing production-grade agentic AI workflows. We learned that in agent design, database schema consolidation directly translates to tool-calling accuracy; minimising the number of isolated collections cuts down context selection errors by over 80%. We also discovered how deeply raw string variables and code indentation format can impact an LLM's spatial reasoning, proving that presentation styling must be handled directly at the prompt-engineering layer.

Built With

Share this project:

Updates