规模化批处理智能:具备内置韧性的高性价比多智能体 LLM 工作流
原题Batch Intelligence at Scale: Cost-Efficient Multi-Agent LLM Workflows with Built-In Resilience
推荐理由沃尔玛多智能体批处理案例覆盖库存建议、结构化输出、SKU校验、有限重试及吞吐成本选择,适合有大规模非实时业务的团队规划可靠执行。
读前速览
本文介绍了沃尔玛如何大规模部署多智能体 LLM 工作流来预测库存,并通过结构化输出、数据落地机制和批处理优化,应对幻觉、语义错误和成本效率等挑战。
多智能体顺序工作流结合实时背景信息与历史 ML 模型,提高库存预测准确度
系统按顺序使用 4 个智能体:从 BigQuery 获取数据、整合历史销售数据、通过外部 API(天气、活动)落实数据依据,以及生成最终建议。与单独依赖回顾性 ML 模型相比,这种方式能做出更准确的预测。
结构化输出和数据落地机制可避免智能体响应中的幻觉与语义错误
架构验证可确保 JSON 输出包含必需字段(SKU、商品名称、部门);MCP 工具调用则验证商品是否正确映射到源数据,避免将农产品推荐给汽车零部件部门这类严重错误。
设置有限重试次数的循环智能体可抵御暂时性故障
将顺序智能体替换为设定最大迭代次数的循环智能体,可确保即使网络问题导致数据库写入失败,输出也能持久化;这一机制让 4,700+ 家门店的系统可靠性达到 99%。
可观测性对于大规模监控批处理 LLM 工作流至关重要
结构化日志会记录重试、架构违规、延迟和错误率,从而帮助团队了解工作流运行状况,并支持让所有门店的推荐成功率达到 99% 的目标。
PTU 成本优化的关键在于认识到批处理任务不需要 24/7 的处理能力
系统最初需要 400 个 PTU(每月 $100k-$120k),但团队意识到批处理智能只在夜间运行。根据实际使用模式配置处理能力,而不是全天候预留容量,因此节省了成本。
完整摘要
本文详细介绍了沃尔玛如何开发多智能体 LLM 工作流,提升 4,700+ 家门店的库存预测准确度。系统使用依次协作的智能体获取实时背景信息、整合历史销售数据、应用数据落地机制,并生成门店经理可执行的建议。主要挑战包括幻觉、违反架构规范、语义映射错误,以及故障期间输出丢失。解决方案包括结构化 JSON 输出、SKU 验证、通过 MCP 工具调用落实数据依据,以及设置有限重试次数的循环智能体。成本优化方面,团队认识到批处理任务不需要 24/7 的处理能力,从而解决了 PTU(预置吞吐量单位)成本问题,在维持 99% 可靠性的同时显著节省成本。
目录 · 10 节
文字记录Transcript
Aditya Mulik:我今天的主题是“规模化批处理智能:具备内置韧性的高成本效益多智能体 LLM 工作流”。我叫 Aditya Mulik,在 Walmart Global Tech 担任高级软件工程师。Aditya Mulik: My topic today is, Batch Intelligence at Scale, which is, Cost-Efficient Multi-Agent LLM Workflows with Built-In Resilience. My name is Aditya Mulik. I work as a senior software engineer at Walmart Global Tech.
今天我想带大家了解的问题,是所有零售商目前都在努力解决的一个问题:库存准确性。我要说的是,大规模零售的情况——沃尔玛在美国大约有 4,700 家门店。在加拿大、墨西哥等地也有多家门店,不过主要部分还是在美国。商品 SKU 数量达数十万种,涵盖各类部门和各式各样的产品,可以想象到的任何产品,沃尔玛都有销售。实体空间也相当庞大,因此必须非常仔细地追踪众多商品。正如我提到的,每个零售商都在应对库存准确性问题,也就是我们必须确定在特定场合需要多少库存。比如到了感恩节,我们就必须确保在某个特定时间点有足够的库存。The problem I want to walk you through today is one which all retailers are wrestling with right now, which is inventory accuracy. What I want to say is the retail at massive scale, so Walmart has around 4,700 stores within the U.S. They have multiple stores in Canada, Mexico, and so on as well, but the major chunk is in the U.S. itself. There are hundreds of thousands of SKUs. There are varying departments, like varying products, any product that we can imagine of, those are all available at Walmart. The physical space is also quite large and so many items have to be tracked very carefully. The problem that each retailer is dealing with, as I mentioned about inventory accuracy, is where we have to determine what is the right inventory required for a particular occasion. If it's Thanksgiving, we have to make sure that much inventory is available at a particular point in time.
我想在这里提到的是,我们能否预测某个部门需要哪些库存?我特别关注的是某一个具体部门。我们能否准确、自动地大规模预测某个部门未来 n 天所需的库存?因为规模相当大,而且如果目标是某个具体部门,就必须确保有一组特定商品可供取用。如果你走到货架前,却发现上面没有某件商品,这种体验就不好。我们必须确保每件商品都有货且库存充足。What I want to mention over here is, can we predict what inventory a department needs? I'm particularly looking for a particular department here. Can we predict what inventory a department needs for the next n number of days accurately, automatically, and at scale? Because the scale is quite large, and if you are targeting a particular department, it has to have a particular set of items available. If you are walking towards a shelf and if that shelf doesn't have a particular item available, it's not a good experience. We have to ensure that each item has to be available and in stock.
准确性至关重要The Accuracy Imperative
准确性至关重要。准确性不是锦上添花,而是对每一件商品都至关重要。我们处理的是生鲜食品,或者说这些商品,比如烤鸡或鲜牛肉,它们很快就会过期。门店经理必须非常准确地判断哪些商品有库存、哪些商品需要订购,以确保未来接下来的 n 天库存都非常准确。我们现在关注的,正是货架有货与货架空空如也之间的差别。如果出现缺货或库存过剩,就可能会有问题。库存过剩的话,显然商品就会被浪费掉:要么捐赠出去,要么只能扔掉。想想看,这种情况会遍及数百万平方英尺的零售空间。我们有 4,700 家门店,所以你可以想象,这对任何一家门店来说都可能至关重要。接下来我要说的是,我们如何在如此大的规模下保持库存准确?首先,显而易见的答案是,我们必须根据历史数据预测需求。The accuracy imperative. Accuracy isn't a nice-to-have, it's very mission critical, on any particular item. What we worked on was fresh food, or basically the items, you can take an example like rotisserie chicken or fresh beef, these items can expire very quickly. The store manager has to decide very accurately like, what items are there in stock and what items need to be ordered, to make sure that the inventory is very accurate for the next n number of days. The line between a stock shelf and an empty rack is what we are looking over here right now. If there are stockouts or overstock, then it could be a problem. If it's an overstock, obviously the items are going to go to waste. Either it has to be donated or it has to be thrown away. Consider this compounded across millions of square feet of retail. We have 4,700 stores, so you can imagine how critical this could be for a particular store. The next thing I'll say here is, how do we keep inventory accurate at this scale? Our first answer has to be an obvious one, we have to forecast the demand based on the history.
回顾性机器学习模型Backward-Looking Machine Learning Model
现在的情况是,在沃尔玛,我们已经有机器学习模型,能够预测需要订购多少库存。我们有基于历史数据的机器学习模型,这些模型利用历史销售数据进行训练,以预测未来需求。我们会使用一年的,或者可能两年的销售数据,来判断接下来大约 30 天或 60 天需要订购多少库存,等等。对于稳定、重复出现和季节性的趋势,这种方法很可靠。沃尔玛非常重视感恩节。我们知道感恩节期间需要订购 n 件商品,因此这类预测非常准确。整个过程完全自动化,而且可以扩展到各种 SKU 和门店。目前的问题是销售预测的准确性。它的优势在于能够根据历史趋势准确地进行预测。Now the thing is like, in Walmart, we already have machine learning models which can actually predict the amount of inventory that has to be ordered. We have backward-looking machine learning models which are trained on historical sales data to forecast future demand. We use like a year's or maybe two years of sales data, where we are trying to determine, ok, this much amount of inventory has to be ordered for the next maybe 30 days or maybe next 60 days, and so on. It's reliable for steady, recurring, and seasonal trends. Walmart is very focused on Thanksgiving. We know during Thanksgiving we have to order n number of items. That is very accurate for prediction. It's fully automated and it scales across SKUs and stores. The problem right now is sales forecasting accuracy. The pro over here is like, based on the historical trends, it can get it properly.
如果发生一些无法预见、前所未有的事件呢?比如说,暴风雨即将来临。这时,机器学习模型就无法准确判断是否会有暴风雨,以及我们是否需要储备水或其他某些物品。我们能提前很久就知道这些情况吗?机器学习模型可能无法预测到。这些都是门店经理必须应对的问题。他们不能只依赖这种特定的历史趋势。于是问题变成了:我们该如何在已有的可信信号之上,加入实时的现实情境?关键在于,我们已经有了机器学习模型,也知道可以用特定的方式进行预测,因此这成了我们面临的一项工程挑战:我们该如何不再只依赖历史趋势?比如,预测会发生某件事,然后就必须订购这么多库存。如果我们能为此加入一些实时情境呢?What if there are blind unprecedented events. Consider an example where there's a storm coming. Now the machine learning model won't be able to accurately determine if there's a storm, and if we need water or certain other items. Will that be actually available well in advance? That machine learning model might not be able to predict that. These are the things that the store manager has to deal with. They can't just rely on this particular backward trend. The question became, how do we add real-time, real-world context on top of the signals we already trust. The thing is, since we already have the machine learning models and we already know the prediction can be done in a specific way, this was an engineering challenge that came on to us, where we had to determine how should we just not rely on backward trends. Like, this is something that's going to happen, and then this number of stock has to be ordered. What if we can add some real-time context to it?
智能体,而非单体架构:顺序工作流Agents, Not Monoliths: The Sequential Workflow
这就是我们提出多智能体方案而非单体架构的原因——本质上,这是一个由多个智能体按顺序组成的工作流。通过这种智能体流程,可以结合实时数据和预测模型数据,得出准确的决策,并告知门店经理需要订购多少件商品。我们是怎么做到的?基本上,我们在这个顺序式智能体工作流中加入了多智能体编排,让智能体依次协作。首先,第一个智能体会针对某个部门从各种数据源收集上下文。以某个部门为例,或者像我刚才提到的生鲜食品部门,它会从 BigQuery 等各种来源获取所有元数据。然后将这些上下文提供给智能体,从而生成更准确的数据。例如,如果是烤鸡,就需要确定应订购的数量。That's where we came up with a multi-agent — not monolith — basically a sequential workflow of agents where this agentic flow can actually determine, like get the real-time data along with some forecasting model data as well, and get the exact accurate decision that has to be given to the store manager, where these are the number of items that they need to order. How did we do that? Basically, in the sequential agentic workflow, we added multi-agent orchestration, like one agent after another, where first agent would determine, so in this case, it gathers context from various data sources for a particular department. Consider if it's a department, or like as I said about the fresh food, it's getting all the metadata from various sources like BigQuery and so on. That context is then fed to the agent, which outputs more accurate data. If it's like rotisserie chicken, it has to be ordered for the quantity that needs to be determined.
然后,第二个智能体会使用这些数据,并整合由数据工程管道准备的历史销售数据。我们还有另一个管道,用来获取更多上下文。它会汇总并整合两组数据集,然后将其提供给第三个数据智能体。这个智能体相当重要,它会分析上下文以及前一个智能体的输出,并在此处引入一个依据机制。正如我所说,仅仅依靠回溯历史数据的机器学习趋势,并不足以得出准确的预测。可能会有一个天气智能体,或者调用天气 API;也可能有正在发生的热门事件或促销活动。它可以收集这些上下文信息,从而更准确地预测应该多订还是少订库存。最后,第四个智能体会生成最终的自然语言建议指令,例如“将库存增加百分之几”等等。这就是我们创建的完整顺序工作流。它专门针对某个特定部门。Then the second agent consumes that data, and then it synthesizes past sales data prepared by the data engineering pipeline. We have another pipeline which is set to get more context. What it does is, there's an amalgamation of two datasets which is collated, and then it is fed to another third agent data. Now this agent is quite important, which analyzes the context and output from the previous agent, and there is a grounding mechanism over here now. Consider, as I said, just a backward ML trend is not going to get us the exact prediction. There might be a weather agent, or there might be some weather API call. There could be a trending event that's happening, a sales event is happening over there. It can gather that context and it can make more accurate predictions, now that it has to order more or either less of the inventory. Then, finally, the fourth agent which produces the final natural language recommendation directive, which is like, increase the stock by this percent, and so on. That's the entire sequential workflow that we created. This was particularly targeted for a specific department.
输出与人在环路中参与The Output and the Human-in-the-Loop
接下来讲输出部分,这就是“人在回路”。我们在这里尝试做的是:所有这些上下文生成之类的工作都没问题,但我们的唯一目标是让店长收到明确的指令。这个明确的指令不是仪表盘,而是一条清晰的命令:周末前将果蔬区的苹果库存增加 15%。这样,他们就能清楚地了解自己需要做什么。他们并不是收到指令后就立刻增加库存。正如我提到的,这里还有实时数据集成:MCP 可以让智能体在推理过程中调用实时数据源。所有这些内容都会通过实时工具、MCP 等进行验证,从而确保有可靠依据。关键的检查环节是由店长审核每条建议,店长可以接受,也可以推翻建议,因为他们会亲自去检查和核实苹果是否真的短缺,以及是否确实需要下单。整个流程中都有人参与其中。这是一项功能,而不是备用方案。在最终验证环节进行人工监督,可以发现数据无法捕捉到的本地情况。这正是店长所做的额外验证。Going to the next part, so the output, and this is the human-in-the-loop. What we were trying to do over here was, all this context generation and everything was fine, but our only goal was the store manager has to get a clear directive. The clear directive was not a dashboard, it was just a clear command. Increase apple stock 15% in produce ahead of the weekend. They are having a clear context on what they need to do. It's not just that, they are just going to increase the stock right away. There's a real-time data integration as I mentioned, which is like, MCP lets agents pull live data sources during reasoning. All of that is verified using live tools, MCPs, and so on, which is grounded properly. The critical checkpoint is, the store manager reviews each recommendation, and the store manager can either accept it or override it, because they will manually go and check and verify if there is actually a shortage of apples, if they do want to order it. There was a human in the loop in this entire pattern. This is a feature not a fallback. Human oversight in the final validation layer was catching the local context that the data cannot. That was the additional validation that the store manager was doing.
生产环境上线及后续故障Production Rollout, and Subsequent Failures
现在,关键的部分来了。接着我们进入了生产阶段。试点阶段简直像变魔术一样,因为我们可能只在 10 家或 15 家门店进行了测试,随后就得到了明确的结果和连贯的建议,利益相关方也相当满意。然后,我们切换到了全面规模的夜间运行。这并不是一种实时场景,店长不会与应用进行交流;他们只会在一天开始时收到一条建议。沃尔玛门店清晨开门时,店长会收到这条建议,然后据此采取行动。是的,我们就是这么做的。我们把它推广到了整个连锁体系,覆盖了全部 4,700 多家门店。然而,在单个门店规模下行得通的东西,到了数千家门店的规模往往就行不通了。下面这四次失败让我们明白了原因。因为我们发现,好吧,我们已经把它投入生产,并让整个连锁体系都能使用它。Now this is where the important aspect comes. Then we went to production. The pilot was magic, because we tested it on maybe 10 stores or 15 stores, and then we had a clear output, coherent recommendations, and the stakeholders were quite happy about it. Then we flipped the switch to full-scale nightly runs. This was not like a real-time context where the store manager is communicating with the app, it's just a recommendation that the store manager gets during the start of the day. As Walmart stores open in the early morning, they get this recommendation and then they act upon it. Yes, we did this. We went to full chain, like all 4,700-plus stores that we rolled it out to. Then, what works at the scale of one rarely survives the scale of thousands. Here are the four failures that taught us why. Because we saw that, ok, we went to production, we made it like full chain available.
最初在 10 家门店的试点中,推荐效果很好,我们也收到了不错的反馈。当时有很多工程团队和数据科学团队参与,他们对所有内容都进行了分析。关键是,我和团队的任务是将其部署到生产环境中,之后我们开始发现大量故障。主要有四类故障,让我们明白了究竟发生了什么。Initially for a 10-store pilot, recommendations were great, we got good feedback. There were a lot of engineering teams, data science team getting involved, and they had everything analyzed. The main thing was, me and my team's task was to get it to production, and then we started observing a lot of failures. There were four main failures which taught us what exactly happened.
现在我来谈谈这些失败案例。这些是我们在大语言模型领域一直常见的失败情况,也是我们应对这些问题的方式。第一个问题是幻觉和模式违规。如你所见,针对幻觉和模式违规,我们必须强制使用结构化输出,因为智能体工作流会获取上下文、所有数据以及输出。有时输出会很含糊,因为我们并不总是会验证它是否符合提供给最终用户的要求。如你所见,我们不得不添加一层模式验证,基本上就是通过某种 JSON 格式进行一致性验证。我可以举一个不好的输出示例。下面这条建议曾发送给一位门店经理。如你所见,我认为你或许应该在周末为畅销的生鲜商品增加一些库存,大约增加 15% 左右。I'm moving on towards the failures now. These are the common failures that we have always seen in the LLM world, and this is how we also tackled it. The very first one was hallucinations and schema violations. Here as you can see, hallucinations and schema violations were like, we had to enforce structured outputs, because the agentic workflow was getting the context, it was getting all the data, the output as well. The output was vague at times, because it was not always validated how it has to be given to the end user. Here you can see like we had to add some schema layer, which is basically to validate outputs via some JSON format of identical validation. I can give a bad example output over here. This was one of the recommendations that went to one of the store managers. As you can see over here, I think you should probably increase some stock for the weekend, maybe around 15% or so, for produce items that sell well.
这看起来像是一条逻辑连贯的建议。但它说要增加库存,却没有说明增加什么商品的库存,这就说不通了。是苹果?烤鸡?到底是什么?我们不知道。它只是说增加大约 15%,而且应该是生鲜区里的某种商品。现在,店经理还得去确认究竟是哪种商品库存不足。这条建议毫无道理,但它给出的置信度仍然相当高。问题在于,它虽然通过了 schema 校验,但从输出质量的角度来看却说不通。我们通过结构化输出解决了这个问题,同时也确保商品信息能根据特定的 SKU 进行校验,包括它所属的部门。如果是生鲜商品,就必须提供商品名称——也就是那边的 Honeycrisp 苹果——以及 SKU。It's like a coherent recommendation. It doesn't make sense, because it says that you have to increase the stock, but what stock? We don't know. Is it apples? Is it rotisserie chicken? What is it? We don't know. It's just saying that around 15%, and it should be about something that's in the produce section. Now the store manager has to go and verify which is the item that's low on stock. This didn't make sense, and it still gave a pretty high confidence. The thing is it did validate across the schema but it didn't make sense from a good output perspective. What we did is we fixed it with structured output, but also making sure that the item is also validated across a specific SKU, whether it's like which department it belongs to. If it's a produce, the item name has to be there, which is the Honeycrisp Apple right over there, and the SKU.
这个置信度确保它符合必须遵循的部门要求。这可以尽可能地扩展。库存指令、给定的架构,都会通过一个通用架构进行验证。正如我提到的,这是相同的输出。现在,架构已强制执行,每个字段都经过类型定义和验证:确切的 SKU、商品、部门和调整量。没有任何歧义了。这是第一次失败。This confidence level made sure like this is adhering to the department that it has to be. This can be extended as possible. The stock directive, the schema which is given, and this is all validated across a common schema. As I mentioned, here's the same output. Now schema enforced, every field typed and validated: the exact SKU, item, department, and adjustment. No ambiguity left. This was the first failure.
然后,再来看第二种失败。这也是我们采用全链路方案后遇到的情况,问题在于语义错误。这是什么意思?你需要通过语义校验来确保数据完整性。尽管我们当时使用了结构化输出,还是出现了问题。问题出在数据工程上,因为创建的工作流是一个隔夜运行的作业,我们会从各种来源收集数据。沃尔玛的每种农产品或每个部门都有大量数据。我们拉取数据后,发现有些内容映射正确,但有些内容映射不准确。这种情况可能只是数百个商品中的个例,但我们确实发现了问题。我可以举个例子。正如你在这里看到的,所有内容都符合架构,但可以看到我在这里标出了问题。Then, again, now the second failure. This is something that we encountered once we were full chain as well, where it was semantically wrong. What do we mean by that? You're ensuring data integrity with semantic validation. Even though we did have structured output there was a problem. The problem was the data engineering, because the workflow that was created was an overnight job, where we gathered data from various sources. Walmart has so much data for each produce, or each department. Once we pull the data, there were certain things that were getting mapped properly but certain things were not getting mapped accurately. This was a one-off situation maybe out of hundreds of items that we found out there was an issue. I can give an example over here. As you see here, everything is matching to the schema, but as we can see I have highlighted over here.
在沃尔玛有多个部门,SKU 也都是唯一的。但问题在于,系统可能会匹配到一个商品编号相同、部门却不同的商品。另一个部门也可能有相同的商品编号。这里唯一不同的部分就是部门。如果某个商品显示为 Honeycrisp 苹果,但它来自 auto_parts,那么系统就应该向最终用户推荐 auto_parts 部门的商品;可它却把这个 auto_part 显示成了 Honeycrisp 苹果,这显然说不通。这是数据摄取层的一次故障:基本上,数据来源处的数据没有被正确映射。我们还必须验证 SKU 是否正确,以及商品名称是否也来自同一个 SKU。这就是其中一次故障。这是一种很危险的故障:JSON 完全有效,但由于 SKU 冲突,它却把 Honeycrisp 苹果映射到了 auto_parts。At Walmart there are multiple departments. The SKUs are unique as well, but the problem is it can map one of the items which has the same item number, but the department is different. The other department might have the same item number. The only varying part is the department over here. If there's a product that's coming as Honeycrisp Apple, but it is coming from auto_parts, so there should be some recommendation for auto_parts which was showing to the end user, but for an auto_part it was showing as a Honeycrisp Apple, which doesn't make sense. This was a failure at the data ingestion layer, where basically, wherever the data was being fetched from, it was not correctly being mapped. We had to also validate if the SKU is correct and also the item name is also coming from the same SKU. This was one of the failures. It was a dangerous kind of failure, perfectly valid JSON, but it maps Honeycrisp Apple to auto_parts because the SKUs collided.
Schema 无法捕获这个问题,只有通过 schema 验证才能发现。我们是如何确保修复这个问题的?这就是我们引入 grounding 机制的部分。如你所见,我们在这里引入了一次 MCP 工具调用,基本上用于验证一致性:如果收到一条股票指令,我们就会通过一个 MCP 客户端连接到相应的数据源。然后,我们会从该数据源中查找属于该项的正确目录。我们还确保,与特定数据管道无关的项目不会被处理。这就是我们确保每个来自智能体的输出都必须通过某种 grounding 机制进行验证的做法。这是我们遇到的另一个故障。The schema can't catch this, only schema validation can. How did we ensure to fix this? This is the part where we did the grounding mechanism. As you can see, we introduced an MCP tool call over here, basically validate coherence, where if you are getting a stock directive, we have an MCP client which is connecting to the proper data source. From that proper data source, we are looking up the proper catalog that belongs to that item. We made sure that any item that is not relevant to that particular data pipeline, it should not be processed as well. That's where we ensured, ok, this is something that every output coming from an agent has to be validated with some grounding mechanism. This was another failure that we encountered.
然后还有一个问题。这是很常见的情况:输出消失了。我这是什么意思?这里可以看到不可靠推理,也就是故障会破坏原本准确的推理;然后还有弹性推理。我指的是可能会出现网络问题,比如我们知道的网络分区。这里可以看到,我们启用了一些日志记录。因为在当时的流水线中,有多个代理各自执行多项任务,而它们的任务只是将输出保存到某种持久化存储中。如果发生 db_write 故障会怎样?比如这里可以清楚地看到一个超时错误,也就是连接重置。由于连接重置,输出现在就消失了。最初我们没有机制来处理输出消失的情况。比如可能有 4700 家门店,其中一些门店甚至没有保存输出,而门店经理只是打开应用,看到“好吧,今天没有推荐”,就以为一切正常。Then there was one more. This is the place where it's very common, where outputs were vanished. What do I mean by that? Over here you can see unreliable inference, which is failure disrupts perfect inferences, and then there is resilient inference. What I mean by that is there could be network issues, like network partition can happen as we know. Here you can see we had some logs enabled. Because in the pipeline, the way it was, there are multiple agents doing multiple tasks, and then their task was to just save the output to some persistent storage. What if there is a db_write failure, like here you can see clearly there is a timeout error which is the connection reset that has happened. Because of the connection reset the output has just vanished now. We didn't have a mechanism initially where if the output is vanished, maybe there are like 4700 stores, maybe some of the stores were not even saving the output and the store manager was just opening the app, and seeing like, ok, there's no recommendation today, that means everything is proper.
这是我们观察到的一个失败。那么我们是如何解决这个问题的呢?这就要说到智能体工作流智能体的机制了。我们原本使用的是顺序智能体,后来决定将其切换为循环智能体。可以看到,我这里重点强调的是最大迭代次数,也就是我们添加的有界重试。如果发生任何类型的故障,智能体工作流都会确保进行重试。 目前可以看到这里有多个子智能体,例如数据收集智能体、综合智能体和 grounding 智能体。我们为整个循环添加了迭代次数。这样做可能不太节省成本,但我们也可以将最大迭代次数设置给某个具体的智能体,也就是负责主要工作的智能体。在这个例子中,我展示的是让整个智能体确保工作流得到正确执行,从而保存输出;你可以根据需要增加迭代次数。比如这里,我只是以五次迭代为例。That was a failure that was observed. How did we fix that as well? This is where the mechanism of the agentic workflow agent comes over here. We had a sequential agent, and we then determined to let's switch it to a loop agent. As you can see, the main thing that I'm highlighting over here is the max iterations. These are the bounded retries that we have added. If there are any sort of failures happening, the agentic workflow will ensure to retry. Right now, you can see there are multiple sub-agents over here, like data gathering agent, synthesis agent, grounding agent. We add an iteration for the entire loop. This might be not that cost efficient, but maybe we can add this max iteration to a particular agent as well where the main work is handled. In this case, I'm showing the entire agent can make sure the workflow is computed properly, so that the output is saved and you can increase the number of iterations as much as you want. Like here, I've just given as an example of five iterations.
接下来,我们之前一直处于盲飞状态。可观测性必不可少,这一点非常重要。既然我们已经具备完整链路,就必须确保整个工作流都具有可观测性,这是非常常见的需求。我指的是什么?常规的工程实践中,可能会遇到 5xx 或 4xx 错误。这里也一样:如果我们发现架构违反了 schema,或者重试没有发生,或者出现了其他问题,就会添加结构化日志。我们确保启用了结构化日志。举个例子,你可以在这里看到重试发生了多少次,比如尝试了两次;或者如果出现了 schema 违反情况,可以看到它产生了多少延迟。启用这些功能,就是为了确保我们能够清楚地了解整个工作流中发生了什么。Next one, so we were flying blind. Observability is a must. This is a very important thing. Since we had full chain available, the very common thing that we want to ensure is we should have observability in the entire workflow. What do I mean by that? The regular way of doing the engineering is you can have maybe 5xx errors or 4xx errors. Even here it's the same case, like if we saw like there's a schema violation, or if there are retries that didn't happen, or something that went wrong, we were adding structured logging. Structured logging was ensured. Over here you can see, as an example, is how many times the retries happened, like two attempts. Or if there was a schema violation, how much latency it had. All of this was enabled just to make sure that we have clear visibility into what's happening in our entire workflow.
正如你们在这里看到的,如果 LLM 的响应不符合 schema,或者工具响应失败,我们都进行了完善的日志记录,并会再次重试。我们的目标是达到 99% 的成功率,所以我添加了一些示例,比如错误率为 97%、失败率为 2.3% 等。我们也确保了可观测性到位。As you can see over here, we had proper logging if the LLM response doesn't match the schema, if there is a tool response that failed, so it was retrying again. We were trying to reach a success rate of 99%, so this is some example that I added, like if there's a 97% error rate, 2.3% of failure rate, and so on. We made sure that observability is also in place.
成本因素The Cost Factor
话虽如此,这就是四个主要问题。现在我想谈谈我们当时正在构建的内容中非常关键的一部分。解决了这些问题之后,接下来摆在我们面前的问题就是成本。这是我们最关心的问题,因为我们希望将其投入生产。这是我们努力实现的一项非常关键的工作,但我们依赖所有基础模型,而且规模很大,比如有 4700 家门店,因此生成的令牌数量相当多。运行整个解决方案需要多少成本,就是接下来的问题。这里涉及的是 PTU 问题。解决方案投入生产后,我们使用了海量的输入和输出令牌。由于采用的是基础模型,我们决定为所需的运行规模预留 400 个 PTU。That being said, these were the four main failures. Now I want to get to the very crisp part of what we were building over here. With failures behind us, the next question on the table was cost. This was the biggest question that was running on to us, because we wanted to get this into production. This was a very critical thing that we were trying to get in, but we were leveraging all foundational models, and with a high scale, like 4700 stores, the amount of tokens generated is quite high. How much of this whole solution is going to cost to run, is what was the next question. The thing over here is the PTU problem. When the solution went to production, we had humongous amount of input and output tokens being used. Since it was a foundational model, we decided to secure 400 PTUs for that amount of scale that we need to run.
对于 400 个 PTU,我们每个月几乎要被收取 10 万到 12 万左右的费用,而这并不是合适的解决方案,因为我们还要确保库存准确,同时节省成本。某个部门不应该出现浪费。按目前这种情况运行,如果要用这么多 PTU,就说不通了。PTU 就像预留容量,我们必须预留一整天。无论是哪家供应商提供 PTU,我们都必须按全天 24 小时购买,而且需要按月或按年订阅。现在的问题是,这是一个批处理智能应用,只会在夜间运行,不会全天运行。我们不处理任何实时流量。我们却要为 24 小时的 400 个 PTU付费,而 PTU 预留的是全天容量。For 400 PTUs, we were almost being charged around 100k to 120k per month, and the solution was not that, because we are trying to also make sure that the inventory is accurate, also save cost. There should not be wastage happening in a particular department. Running at this position, it doesn't make sense, if these much PTUs are going to be used. PTUs is like reserved capacity, and we have to reserve it for the entire day. Any of these vendors who are providing the PTUs, we have to take it for the entire 24 hours, and it's a monthly or yearly subscription that we have to take in. Now the problem is, this is a batch intelligence application, it's only going to run overnight. It's not going to run the entire day. We are not serving any live traffic. For us, we were being charged 400 PTUs for 24 hours, and PTUs reserve capacity for the entire day.
我们的工作负载是夜间批处理,并非 7×24 小时运行。我们却一直在为全天候的容量付费,而这些容量只有在实际使用时才会用到。这是我们最亟待解决的问题:我们只需要在特定的时间段内使用容量,全天候付费并不划算。于是我们开始探索有哪些选择。由于这是一个基础模型,基础模型最大的优势在于训练充分,适用于此类企业级规模的应用。接下来我们要考虑的是:应该选择哪种 AI 模型?如你所见,我们可以选择更便宜的模型,比如开源模型或其他模型;它们可能会带来一些延迟,但也可能比我们现有的模型更便宜,无论现有模型是 GPT-4.1 还是 Gemini 等。或者,我们也可以减少 PTU,这也是一种选择;还可以选择按需付费。我们一直在权衡质量与成本,但这两者都不理想,因为我们既需要高质量,又希望成本更低。这就是我们要解决的核心问题。Our workload was nightly batch run, which was not 24 by 7. We were paying for the round the clock capacity which was being used. This was our most critical problem that we were trying to solve in a particular defined set of time, which didn't make sense because of the cost involved. We started exploring options, what are the options? Because this is a foundational model, the best part about foundational model is they are well trained, they are good for such enterprise scale applications. The next thing that came to us was, what AI model should I choose? Here as you can see, we had cheaper models where we can go with open-source models or any other models, which might introduce some latency, or they could be cheaper compared to the one which we already had, whether it's a GPT-4.1 or Gemini, and so on. Or we can just reduce the PTUs, that was another option. Or we could go with pay-as-you-go. We were debating between quality versus cost, and both were not a good option, because we needed high quality but lower cost. That was the main problem that we had to solve.
我们是怎么做到的?我们做出的决定是采用按需付费。先简单介绍一下背景:PTU 与按需付费的区别在于,正如我前面提到的,按需付费会有延迟问题,而且还会遇到速率限制。我们确实遇到了很多速率限制问题,但问题是,正如我在介绍失败经验时提到的,我们添加了重试逻辑。这个重试逻辑让我们即使遇到速率限制,或者出现任何 4xx 或 5xx 错误,也可以再次重试。重试后,就会重新生成输出。按需付费仍然使用基础模型,响应依然非常准确,而且我们也不需要预留容量。我们不必全天候持续付费,只需使用所需的计算资源即可。How did we do that? The decision that we made was, we went with pay-as-you-go. Now just to go with some background, the problem with PTU versus pay-as-you-go, is pay-as-you-go will come with latency issues, as I've mentioned over here, and there will be rate limiting happening. We did observe a lot of rate limit issues, but now the thing is, as I mentioned in my failures as well, we had added a retry logic. This retry logic enabled us, even if there is a rate limit, if there are any 4xx or 5xx errors, I'm just going to retry again. If I do retry again, the output will be generated again. Now, if it's a pay-as-you-go, it's still a foundational model and it still gives very accurate responses, and there was no reserved capacity as well over here. We were not paying round the clock, we were just using as much compute as we require.
收益是这样的:我们原本每个月要支付大约10万,现在最终实际使用费用只有1万,因为即使有重试,成本也非常低。所有任务只会在那特定的30分钟内运行,当然,运行时间也可能会延长。我们不介意,因为门店已经关门了,这会是一个夜间任务。最终,无论消耗多少计算资源,都会在夜间运行;即使有重试或其他情况,成本也会很低。输出仍然符合我们设定的质量标准,因为有架构强制校验,而且所有数据工程管道都已经修复。这是我们最大的收获。正如我提到的,令牌数量相同、模型相同,只是将定价层级从 PTU 切换为按需付费,成本就大幅下降了。这就是我想在这里提到的重大胜利。The payoff, so what happened over here is, we were supposed to pay around 100k per month, now we are paying just 10k as the final usage, because even with the retries, the cost is just very low. It's just going to happen in that specific 30 minutes, or maybe the time might increase. We don't mind because the stores are already closed, this is going to be a nightly job. Then, eventually, whatever compute is being taken is going to just happen at night, even if there are retries and everything, the cost will be minimal, output will be still matching the quality that we have set, because there is schema enforcement, and all the data engineering pipelines were fixed. This was our biggest win. As I mentioned, same tokens, same model, just a pricing tier switch from PTU to pay-as-you-go, and for a drastic drop in cost. That was the big win that I wanted to mention over here.
规模化构建中的经验教训Learnings, When Building at Scale
每一次失败和每一次修复,都给我们留下了值得铭记的经验。以下是我们在大规模构建过程中学到的东西。其中有些经验我还会再提一次。首先是模式约束。既然我们会重试,一切都已经规划妥当,但模式约束并不只是进行基本的 JSON 校验。我们还必须进行语义验证,因为数据来自各种不同的来源。在 AI 领域,我深刻体会到,上下文必须非常准确。对于我们现有的数据管道,无论获取到什么上下文,只要稍有偏差,就可能产生含糊不清的输出。我们必须确保落实语义验证。其次是数据易用性,也就是让数据更容易理解和使用。我们还需要具备一定的可观测性。对于接收到的数据,我们需要了解数据管道的运行情况。Every failure and every fix left us with a lesson worth carrying forward. Here's what we learned, building at scale. These are some of the learnings that I'm going to mention once again. Basically, schema enforcement. Since we are retrying, everything is all planned out, but schema enforcement is not just the one thing that happens over here, basic JSON validation. There has to be semantic validation, because data, what is coming from various sources, like in the AI domain, what I've learned very well is context has to be very accurate. With the data pipelines that we have, whatever context we get, if there is even a slight mismatch, it can just return vague output. We have to make sure semantic validation is in place. Data usability, making data easy to understand and use. We need to have some observability as well. Whatever the data that is coming in, we need to see how the pipelines are running.
所有这些因素都必须纳入考量。接下来是数据完整性。从整体来看,我学到的一点是,保持数据的准确性和一致性非常重要。这是关键特性之一。第二点是,数据工程决定了 AI 质量的上限。正如我这里提到的,数据质量关系到 AI 结果是否可靠、结论是否准确可信、数据校正、修复上游数据问题、数据工程、确保数据质量,以及有缺陷的数据。这些都是什么意思呢?整个背景是,我们当时运行的是一个夜间作业,因此特别重视数据工程本身。由于我们从各种来源获取数据,所以在这一方面投入了大量精力,必须对来自不同来源的数据进行验证。我们编写的所有脚本都经过了业务团队、数据团队和工程团队的验证。All those things have to be taken into consideration. Then comes the data integrity. Maintaining accuracy and consistency of data is very important, is what I've learned from this entire perspective. That's one of the key features. Second thing is data engineering limits AI quality. As I mentioned over here, data quality over here is reliable AI results, accurate and trustworthy outcomes, data rectification, fixing upstream data issues, data engineering, ensuring data quality, and flawed data. What do we mean by all of this? The entire context over here, since it was a nightly job that was being run, this had a huge emphasis on the data engineering aspects itself. Because we were getting data from various sources, there was a lot of focus that was added into this perspective, where data coming from various sources has to be verified. The amount of scripts that we created were validated with the business and the data team, with the engineering team.
我们确保数据足够准确后,就能通过恰当、具体的提示词,将上下文正确地传递给各个智能体,从而生成我们想要的准确输出。由于这是一个多智能体工作流,我们必须确保来自各种来源的数据足够准确。这是我们从整个工作流中学到的主要经验。另外,正如我提到的,数据有缺陷、输入不可靠也会导致问题:一旦输入不恰当,所有智能体就会产生奇怪的输出,因为输出可能不符合架构,也可能符合架构,却只生成含糊的结果,最终就是这样返回的。构建重试逻辑是我在整个过程中学到的最重要的一点。我们一直非常强调这一点。We ensured that once the data is very accurate, then that context will be fed properly to the agents with a proper particular prompt, and that will generate the exact output that we are looking for. Because it's a multi-agent workflow, we have to ensure that the data that is coming from various sources has to be very accurate. That was our main goal that we learned from this entire workflow. Also, like flawed data, as I mentioned, unreliable input is also like, once the input is not proper, all the agents will react in a weird output, because it might either not match to the schema, or it might just match to the schema also, but just generate vague outputs, and that's how it would return. Building retry logic, this was one of the most important aspects that I went through. We have been very much emphasizing on this.
重试也可能陷入非常糟糕的循环:如果规划不当,就会不断重试,从而大幅增加成本。由于这里涉及 token,因此必须进行非常精确的规划。正如我在最初的流程中提到的,我们过去会在基础层(也就是根级)进行重试,也就是所有智能体所在、工作流运行的层级。理想情况下,智能体式重试应当在真正需要的环节触发,例如确认我们是否从正确的数据源获取了上下文,避免后续智能体产生幻觉;也可能是处理其他可能出错的情况。从一开始就在这里实现重试,减少了意外故障。这有助于主动改进系统、节约成本并提升效率,最终带来更好的用户满意度。Retries can be a very bad loop as well, where if you don't plan it properly, it can just keep retrying, and that would just increase a lot of costs. Just because there are tokens involved over here, you have to plan it very accurately. As I mentioned in the initial flow, we used to retry it at the base, like root level, where all the agents are, like where the workflow runs. Ideally, the agentic retry should be in such a pattern where it is actually needed, whether we are getting the context from the proper data source, so that the further agents don't have to hallucinate, or there could be something that can go wrong. Retry over here, implemented from the outset, reduced unexpected failures. There's proactive system enhancement, cost saving and efficiency. It results into better user satisfaction.
下一个经验教训是可观测性。这是整个工作流程中的关键要点之一,也是大家关注的重点。可追踪性很重要,结构化日志记录很重要,增强对系统的理解也很重要。因为一旦启用了追踪,我们最初运行整个工作流程时,就能发现问题所在;而当时我们无法确定到底出了什么问题,只是因为没有设置恰当的追踪。如果无法判断 LLM 是在产生幻觉,还是模型只是遭到了速率限制,那么这些信息就必须清晰可见。有一些工具可以帮助我们提升可见性。把这些工具配置好,就能确保应用非常稳健,能够经受住各种故障,从而具备很强的韧性。这是我在这里要提到的一个非常重要的方面。接下来是让基础设施与需求相匹配。这是我们认识到的关键一点:基础设施应该用于夜间批处理作业。The next learning perspective is observability. This is one of the key things from the entire workflow, that everyone is focused on. Traceability is important, structured logging is important, and enhanced system understanding. Because once you have tracing enabled, for us, initially, when we were having this entire workflow running, we were not able to determine, ok, what's going wrong, just because there are no proper traces set up. If you're not able to identify if the LLM is hallucinating, or if the model is just getting rate limited, all that has to be clearly available. There are tools which help us add those visibility, and then having that in place, make sure that your application is very robust, and can survive any failures to make it very resilient. That's a very important aspect that I'll mention over here. The next thing is matching infrastructure to requirements. This is the key thing that we realized, which is the infrastructure should be used for a nightly batch job.
这里我们可以看到,在实时基础设施中,例如用户正与 LLM 进行对话的场景,你可以准确配置一组 PTU,等等。而在注重成本效益的基础设施中,你需要确保不必只分配 PTU。在我们的案例中,我们选择按需付费,或者也可以使用开源模型。只要它能提供合适的性能和正确的输出,那就是理想的选择。接下来是我想表达的最后一点:明天早上 6 点,门店经理将能够自信地调整库存。他们不了解我们的架构验证、循环重试机制,也不了解我们每晚进行的 API 优化。他们也不需要了解。这才是最终的衡量标准,也就是工程系统的韧性。这就是我的看法。Here, we can see that the real-time infrastructure, like if you have a real-time infrastructure where users are having conversations with the LLM, in that case, you can have an accurate set of PTUs set up, and so on. In cost effective infrastructures, you need to ensure that you don't need to actually have PTUs only allocated. Here, in our case, we were opting either for like pay-as-you-go, or you can even go with open-source models. As long as it's giving you the proper performance, the correct output, that's the ideal approach that you should be going with. The next one is, I've reached the end, which is, tomorrow at 6 a.m., a store manager will confidently adjust the inventory. They don't know about our schema validation, our loop retries, our nightly API optimizations. They don't have to as well. It's just the ultimate metric, which is the resilient engineering. That's what the perspective is.
摘要Summary
这里简单回顾一下:schema 是基本门槛,语义才是真正的工作重点。要关注超越基本 JSON 结构的校验检查。数据工程决定 AI 的质量,所以输入是垃圾,输出也会是垃圾。重试逻辑非常重要。如果出现网络超时或幻觉,重试可以确保输出始终准确。可观测性是必不可少的,跟踪和日志记录都非常重要。接下来,要让基础设施匹配常规需求。如果这是一个每晚运行、对延迟不敏感的批处理作业,就要确保不必依赖 PTU,否则成本可能会远超预期。这就是主要目标。Just to recap over here, schema is our table stakes, semantics is the real work. Focus on validation checks that go beyond basic JSON structure. Data engineering limits AI quality, so garbage in results into garbage out as well. Having retry logic is very important. If there are network timeouts, hallucinations, retry can ensure that your output is always accurate. Observability is mandatory. Tracing, logging is very important. Then match infrastructure to the regular requirements. If it's a nightly non-latency sensitive batch job, then you have to ensure that you don't need to actually rely on PTUs, because that would just cost you even more than what's expected. That's the main goal.
问题与解答Questions and Answers
参与者 1:你们是如何评估新模型相较于原有时间序列预测模型的优势或效果的?你之前提到,在构建这个智能体工作流之前,你们有一些预测模型,也就是经典的机器学习时间序列模型。你们是如何评估这个新的智能体模型是否更好的?Participant 1: How did you assess the benefits or effectiveness of the new model compared to your legacy time series forecasting models? You said before you built this agentic flow, you had some forecasting models, the classical ML time series models. How did you assess whether this new agentic model was better?
Aditya Mulik:问题是,基本上,我们在这个用例中使用了时间序列预测模型,因为我们有大量销售数据。我们用过去两年的销售数据来训练预测模型。现在,这个预测模型只能针对一组固定事件,按照准确的模式输出结果。比如遇到感恩节这样的事件,时间序列预测模型就能准确判断需要什么。但如果某个地方正在进行限时促销,或者竞争对手正在进行限时促销,又或者遇到某种情况,比如即将来临的风暴呢?这时,预测模型就无法判断了。这就是我们想要引入智能体工作流的原因。我们的总体目标是生成输出,同时也希望建立一种实时数据机制。因此,我们决定采用智能体工作流。这就是我们决定以这种方式获得输出的原因。Aditya Mulik: The thing is, basically, we had like time series forecast model, what we were using in this use case, because we had a lot of sales data. We were looking at the past two years of sales data for the forecasting model. Now that the forecasting model can just output in an accurate pattern for a fixed set of events, if it's a Thanksgiving event, the time series forecasting model will accurately determine what is needed. What if there is a situation where there's a flash sale happening somewhere, or there's a competitor having a flash sale, or consider if there is a certain situation, like a storm is coming. Then now the forecasting model won't be able to determine that. This is where we wanted to introduce agentic workflows. The entire goal was we have to create an output, but we wanted some real-time data mechanism as well. That's where we decided to go with the agentic workflow. That's how we decided to get the output here.
参与者 2:你们只在测试阶段、试运行阶段保留日志吗?那生产环境呢?你们还会在生产环境保留所有日志吗?Participant 2: Did you keep the log only in testing, in the trial phase, or what about in production? Do you still keep all the logs in production?
阿迪蒂亚·穆利克:关于生产环境,你刚才提到?Aditya Mulik: For production, you mentioned?
参与者 2:你们在生产环境中保留了所有日志吗?Participant 2: Did you keep all the logs in production?
Aditya Mulik:我们是如何确定的?Aditya Mulik: How did we determine?
参与者 2:我们了解到你会记录所有日志,并检查所有日志;在测试期间,这有助于你分析问题出在哪里。你在生产阶段也保留了所有日志吗?Participant 2: We understand you write down all the logs, you check all the logs, during the testing it will help you to analyze what's wrong. Did you keep all the logs in the production phase?
Aditya Mulik:我们是如何确保生产环境中的日志记录得以维护的?当时使用了多种工具。最初,我们选择了云服务商本身提供的方案,他们有自己的日志工具和机制。我们还为每个智能体工作流都添加了自定义日志。每个智能体都有自定义函数,比如我在某个 MCP 工具中提到的那个,它会对某个 SKU 进行验证。针对该 SKU,我们添加了一些日志,用来判断是否发生故障,以及是否发生了 db_writes 或 db_reads。如果出现任何故障,我们就会添加自定义日志;我们也有自己的仪表板。最初,我们使用云服务商提供的仪表板,但后来也创建了自己的自定义仪表板来进行验证。Aditya Mulik: How did we ensure logging is maintained in production? There are multiple tools that were being used over here. Initially, we opted with cloud vendors themself, where they have their own logging tools and mechanism. We had our own custom logs added to every agentic workflow. Each agent that had custom functions, like as I mentioned in one of the MCP tools, where it was validating across one of the SKUs. In that SKU, we were trying to determine, like we were adding some logs, if there is a failure happening, or if there is any db_writes that's happening or db_reads happening. If there are any failures, we added custom logs, we had our own dashboards. Initially, we went with the cloud vendor dashboards, but we had our own custom dashboards to verify that.
参与者 3:在这次会议上,我们有多场讨论如何评估智能体。我觉得就你的情况而言,这个问题尤其值得探讨:鉴于你的智能体已面向众多用户部署到生产环境中,如果你对智能体进行更改,会如何评估?又如何进行回归测试和评估?Participant 3: At this conference, we had multiple sessions about evaluating the agents. I think for your case, it's especially interesting to hear, given it's deployed in production on many users, if you do changes to your agent, how do you evaluate it? How do you do regression testing and evaluations?
Aditya Mulik:这也是我在演示中没有提到的内容,因为我们最初采用的是 MVP 工作流程。起初,我们的做法是先推出 MVP,再确定如何衡量库存准确性。我们没有纳入的内容包括评估。我们是以迭代的方式开展工作的,当时有一些初步设想。比如,如果涉及某个特定部门——就像我提到的烤鸡部门,我了解到它的保质期大约是 24 到 48 小时——那么也应该为这个部门设置一组评估集。我们最初采取的流程是获取实时数据。有了这些数据后,我们就能逐步加入评估、基于事实的机制,甚至治理机制。有时我们还需要确保定价信息等内容不会被纳入。所有这些都被考虑在评估集中。这就是我们的做法。我在演示中没有提到这一点,因为这是我们在迭代过程中逐步完成的。Aditya Mulik: This is the thing that I didn't include in my presentation as well, because this was our initial workflow where we went with an MVP. Because initially, our process was to come with an MVP, how should we determine the inventory accuracy. The things that we didn't include were evals. We did work upon in an iterative fashion where we had a certain perspective, like if there is a particular department, in this case, as I mentioned about rotisserie chicken, the shelf life is about 24 hours to 48 hours, is what I know about. There should be a certain eval set for particular departments as well. What we did initially was to go with a flow where we are getting real-time data. Once we have that data coming in, then we were able to iteratively add evals and a grounding mechanism, and even governance. Because at times, they were like, we had to make sure there are pricing information and everything that should not be coming in. All that was considered in an evaluation set. That's how we had approached it. That was not one of the perspectives that I did include, because that's something that was iteratively performed.
参与者 4:你提到,门店经理需要对建议采取行动,要么接受,要么覆盖。门店经理有没有可能什么都不做?由于下一次夜间运行可能使用不同的参数,并生成不同的建议,这条建议会不会因此过时?Participant 4: You mentioned that the store manager needs to act on the recommendation, either agree or override. Is there a possibility that the store manager does not take any action? Does the recommendation become stale because the next nightly run might have different parameters, and that might be a different recommendation.
Aditya Mulik:问题在于,店长并没有立即采取行动。最初在试点阶段,我们对整个流程进行了非常全面的验证。店长可以先进行核查,因为这本来就是他们日常工作的一部分;他们有自己的应用程序,用来核实到货库存。这些内容最初只是作为建议提供给店长,由他们手动核验。随着系统全面投入生产,并经过数周又数周的迭代,他们逐渐发现预测越来越准确,因为预测所依据的正是他们实际获取到的上下文信息。唯一的一点是,整个过程中始终有人参与把关。因为即使收到建议,他们也不会马上采取行动,而是会先核实库存,再做决定。流程就是这样进行的,并不是说他们总会照着建议采取行动。Aditya Mulik: The thing is, the store managers didn't act upon it right away. The way it was done was initially when we were in the pilot phase, this was all being validated very thoroughly. The store manager has the ability to first go because it's kind of like their day-to-day process, they have their own applications where they're verifying the inventory that's coming in. This was just as a recommendation that was initially being shared to their store manager. They were manually validating it. As this went to full production, and over the iterative process of weeks and weeks, they were able to determine that the predictions were becoming more and more accurate, because that was actually the context that they were getting. The only thing was there was always a human in the loop perspective over here. Because even if the recommendation has come in, they won't just take the action right away, they will verify the inventory and then only they'll take a call. That's how it was done. It's not that they always acted upon it.
参与者 5:你提到了成本方面。考虑到在全球范围内推广的成本,业务团队最终是如何判断是否值得的?还是说需要权衡其他因素?Participant 5: You mentioned the cost aspect. How did business decide in the end, is it worthwhile, given the cost to roll it out globally, or is there a tradeoff to take into account?
Aditya Mulik:这是我们最初启动的一个概念验证(POC)。一开始,推荐完全是基于机器学习模型生成的,这种方式已经运行了很长一段时间。随着智能体工作流逐渐发展起来,我们也已经制定了推广计划,打算先在部分试点门店上线。最初的计划是看看它如何融入整个生态系统,因为我们不想打乱现有流程。门店目前的运营效率已经很高了。我们只是在这里额外增加了一层,确保推荐能更加准确。之后,这个 POC 从试点阶段推广到了整个生产环境,覆盖了 4700 家门店。这个概念经过验证后,便正式部署了。我们还通过迭代不断增加更多推荐。最初,我们计划只针对某个特定部门开展,后来就这样逐步扩大了规模。Aditya Mulik: This was an initial POC that we started off with. The way it was working out was initially recommendations were just based on machine learning models themselves. That's how it was running from a longer time. As this agentic workflow started coming through, and then we did already have something which was planned out to have this rolled out, like to certain pilot stores. The plan was initially to see how this fits in the entire ecosystem, because we didn't want to disturb the existing flow, because as the stores are operating right now, they're well efficient. This is just an additional layer that we added over here, just to make sure like, ok, this is getting more accurate recommendations. Then it went out as a POC, POC to the entire production, like 4700 stores. Then it was foolproof as a concept that got deployed. We iteratively kept adding more and more recommendations. Our initial plan was to do it for a specific department itself. Then that's how we scaled it up.
查看更多带文字稿的演示文稿See more presentations with transcripts