What if every store manager, planner, and operator had access to a real-time AI Inventory Assistant that understands demand patterns, supplier delays, weather anomalies, and operational constraints, collaborating through specialised agents all working in unison?

The WHY of it is this —

Retailers today operate in one of the most volatile supply environments in decades. Consumer expectations for on-shelf availability, freshness, and speed have never been higher and operational pressures continue to rise. Stock-outs remain a persistent problem: global estimates suggest that out-of-stock situations cost retailers nearly $1 trillion annually in lost sales, even before accounting for long-term loyalty impact. At the other end of the spectrum, overstock and food waste are eroding margins at unprecedented levels. Research indicates that grocery retailers lose hundreds of billions of dollars each year due to spoilage, misaligned replenishment, and poor demand visibility, with perishables accounting for the majority of this waste.

Even basic stock planning remains surprisingly inefficient; retailers in the UK alone lose an estimated £15 billion each year because of inadequate stock management and forecasting practices. These challenges are exacerbated by broader systemic pressures. Supply chain disruptions have tripled since 2020, lead times are unpredictable and highly variable, and product assortments continue to expand. Yet despite the explosion of available data, nearly all daily inventory decisions are still made manually through spreadsheets or rigid rule-based systems that cannot adapt to real-time conditions.

Today, we’re excited to showcase a build walk-through of a Retail Inventory Optimisation Assistant powered by a multi-agent architecture, designed to streamline inventory decisions and prevent stock-outs before they occur. Here’s the exciting part: Anyone can do it, no coding experience needed and in just a few clicks.

A New Blueprint for Inventory Decision Intelligence

This article presents a solution in the form of a multi-agent system that brings together three AI agents, each with its own domain expertise:

  1. Knowledge assistant — serves as the system’s contextual brain. It interprets unstructured information — such as responsible sourcing practices, logistics, and ethical standards — and translates that into signals the rest of the system can use when needed. This agent understands the narrative behind internal company information as well as entities interacting with the supply chain.
  2. Demand forecasting Agent — focuses entirely on prediction. It analyzes historical sales patterns, promotional calendars, seasonal behaviors, and external factors to determine future SKU-level demand with as much granularity as the data allows. By isolating the forecasting logic in its own agent, the system can offer clear explanations of how future demand is expected to evolve and how upcoming conditions — such as holidays, weather shifts, or marketing initiatives — may alter the baseline.
  3. Inventory optimisation Agent — translates demand expectations and operational constraints into precise replenishment recommendations. It understands stock levels, incoming orders, safety thresholds, supplier lead times, and replenishment policies, allowing it to answer practical questions such as what to order, when to order it, and how much is needed to prevent both stock-outs and excessive waste.

Although each agent is powerful in its own domain, the real intelligence emerges from the multi-agent system under the guidance of a Supervisor Agent, which coordinates their interactions. The supervisor determines what information is needed, delegates tasks to the appropriate agents, merges their outputs, and constructs a complete response for the user. This supervision layer turns three domain-specific experts into a cohesive decision-making system capable of solving scenarios that no single agent could handle alone.

Mapping the Invisible Framework

The solution is built using Databricks AgentBricks, at the heart of which is the Multi-Agent Supervisor (MAS). This agent orchestrates the Knowledge Assistant, Demand Forecasting Agent, and Inventory Optimisation Agent, delegating tasks, merging outputs, and presenting a unified response to the user. It ensures that each agent focuses on its domain expertise while maintaining a seamless conversational experience. The building blocks of this agent are (1) an AgentBricks’ Knowledge assistant and (2) a Genie space.

Knowledge Assistant: Unstructured Context Reasoning

The Knowledge Assistant is an agent supported by a Retrieval Augmented Generate (RAG) system over provided documents. It provides the system with a deep understanding of unstructured operational context.

In the context of this solution , we gave it access to two curated knowledge sources: (1) Supplier & Company Policies built from publicly available documents relating to responsible sourcing, logistics standards, ethical guidelines, and compliance requirements. This source allows the system to answer questions involving supplier disruptions, ethical sourcing, or operational constraints. (2) Promotional Information — A synthesised set of documents representing active and upcoming promotions, seasonal offers, and discount structures. This enables the system to understand contextual uplift, promotional windows, and SKU substitution choices.

The steps —

  • Upload your documents to Unity Catalog (UC) volume(s).
  • Under Agents, create a new KA from the Knowledge Assistant pre-built use-case and give it an adequate description.
  • Configure the knowledge sources by selecting “UC Files” and sources pointing to the volumes with your documents. (Note that you can also attach your own vector index here as a knowledge source.)

Both corpora are indexed with Databricks vector search and stored in a vector store that you can access under “Compute”.

Query and test the knowledge assistant
Genie Space: Unified Data Context for Numerical Reasoning

It is a conversational interface that allows users to explore and query data in natural language, automatically translating questions into SQL and returning results with tables or visualisations. It’s designed for business users, leveraging metadata, sample queries, and custom instructions to provide accurate, ad hoc insights without requiring SQL expertise.

In this solution, a Genie space is created on top of two tables using real and synthesised data. (1) Historical Sales dataset imported from the Supermart Grocery Sales dataset and (2) Current Inventory dataset generated using the historical dataset as a statistical seed and contains current stock levels, lead times, shelf life, and other operational constraints.

Both tables live in Unity Catalog as Delta tables, ensuring governance, lineage, and ACID reliability. All that is needed to create a Genie space is to connect the data sources at time of creation et voila!

Demand Forecasting Agent

The Demand Forecasting Agent is responsible for generating short- and medium-term demand projections. It queries the historical sales table directly through Genie Space and incorporates promotions or seasonal context from the Knowledge Assistant when needed.

In this architecture, the forecasting logic is isolated and explainable, with predictions tracked through MLflow for versioning and reproducibility.

Inventory Optimisation Agent

The Inventory Optimisation Agent consumes the outputs of the forecasting agent along with inventory, lead time, and supplier constraints stored in Genie Space. Its goal is to recommend replenishment actions that minimise waste and stock-outs while respecting business rules. The agent returns structured, actionable outputs such as order schedules, coverage durations, or SKU-level risk metrics.

Multi-Agent Supervisor (MAS): Orchestration Layer

The Supervisor Agent is the decision conductor. It puts together all these independent modules together, determines which agent to call for which part of a question, merges their outputs, and ensures the final answer aligns with business goals.Its responsibilities include: Intent classification, delegating sub-tasks to the correct agents, combining retrieved knowledge with numeric reasoning, producing a single, coherent, explainable response and logging all agent activity for traceability.

The steps —

  • Navigate to the Multi-agent Supervisor card of AgentBricks (under “Agents”) to create a new MAS agent.
  • Give it an adequate description that defines its role and tasks.
  • Configure the KA agent by selecting “Agent Endpoint” as type and selecting the previously created Knowledge assistant endpoint.
  • Configure the demand forecasting and inventory optimisation agents by selecting “Genie Space” as type and the previously created Genie space. Give a clear distinct description of the role and tasks of each agent as this is what will built the persona of the agents despite both relying on the same Genie space.
  • [Optional] you can add additional instructions that guide the tone and expected response of the agent.
The System in Motion

Now for the fun part: watching the agents work together. This is where the magic of a multi-agent setup really shows itself. To illustrate this, consider the query:

If we promote rice this week, will we need more chicken and masalas as well? Keep in min minimising food waste.

This is what is known in some domains as a conjunctive query; it blends forecasting, policy considerations, and operational planning to be joined into a single answer; exactly the kind of scenario where collaboration between agents becomes essential.

  1. Query understanding and re-routing — The Supervisor identifies that the request touches forecasting, substitution behaviour, inventory levels, and waste considerations. It breaks the question into its sub-tasks and identifies which agents need to contribute.

Press enter or click to view image in full size

Recognising that the answer depends on past buying behaviour, it asks the Demand Forecasting Agent to examine historical cross-SKU patterns and estimate how a rice promotion typically affects related items such as chicken and masalas.

2. Policy checking — The user also slipped in a sustainability angle, so the Supervisor sends a side-quest to the Knowledge Assistant which retrieves relevant policy guidelines and promotional context. This ensures that any recommendation aligns with sourcing standards, waste-reduction practices, and constraints embedded in the retailer’s operational documents.

3. Conversational interplay — With these insights in place, the Supervisor engages the Inventory Optimisation Agent to identify the best ordering strategy given the current inventory.

A nice back-and-forth follows, in which the Inventory Optimisation Agent acknowledges the limits of the information available in the Genie Space but takes the initiative to provide alternative requests that can aid the Supervisor in resolving the query.

The Supervisor then sends an updated request to the Inventory agent to understand current stock, lead times, expiry windows, and any pending orders.

4. Collating insights — The Supervisor finally brings together the forecast outputs, policy considerations, and inventory calculations into a coherent recommendation.

It highlights the degree of cross-elasticity between the products involved, reports any projected stockout or excess risk, and recommends an ordering strategy that satisfies demand while minimising potential waste.

The result is a streamlined, context-aware answer that captures the interplay between all agents and explains the reasoning in a form that planners can act on.

How Databricks Enables This Architecture

The system is made possible by several components of the Databricks Data Intelligence Platform:

  • AgentBricks MAS provides the multi-agent orchestration layer.
  • Genie Space allows agents to query structured data reliably and consistently.
  • Delta Lake + Unity Catalog supply governed, ACID-compliant data storage with full lineage.
  • Vector Search + Embeddings power semantic retrieval for policy and promotion documents.
  • MLflow tracks all forecasting models, inferences, and versions.
  • Model Serving or Realtime Endpoints support low-latency inference for the forecasting and optimisation steps.

Together, these tools simplify the creation of multi-agent architectures where each agent can specialise while remaining fully traceable and governed.

Final Thoughts

AgentBricks makes it astonishingly fast to spin up AI agents, turning ideas into interactive prototypes in just a few clicks. Backed by the Databricks platform, it gives teams governed data, reliable compute, and seamless integration, letting even complex multi-agent workflows come to life effortlessly. Its real strength lies in creating POCs, demos, and hands-on experiences that democratise AI, letting anyone explore, experiment, and innovate. While not the best plug-and-play solution for mission-critical systems, despite its marketing, it’s a launchpad for creativity — showing just how quickly AI can transform retail inventory management and spark new possibilities.

Notes
  • There are additional topics not covered here — such as monitoring, labelling sessions, and improving agent assessments — that are easily accessible thanks to AgentBricks and can be explored in a future article.
  • Additional Knowledge sources cannot be appended after the Knowledge Assistant (KA) agent is created.
  • As the time of this article, only the Knowledge Assistants can be selected as an agent endpoint in the Multi-Agent Supervisor (MAS).
  • Any vector indices created from UC files as part of the KA creation are deleted if the KA is deleted.

Written by
Imane Hafnaoui
Senior Consultant