一句话:提出按复杂度排序的微服务到LLM多智能体系统重构方法,结合内联QA回归与人类介入保障迁移稳定性。
针对零售供应链中SaaS微服务系统向非确定性LLM多智能体系统(MAS)迁移缺乏结构化路径且易引发不稳定的问题,本文提出一种基于量化复杂度准则排序服务迁移优先级的系统化重构方法。该方法在架构演进中内嵌基于QA的回归分析,确保遗留服务逻辑与概率性智能体推理之间的功能等价;并引入Human-in-the-loop机制,在智能体输出违反预定义QA不变式时解决决策缺口。在含9个微服务和13个API的供应链基准上评估,复杂度排序重构相比随机迁移在一致性、延迟和成本上分别提升2%、21%和23%,相比逆序迁移分别提升6%、25%和31%,并减少了回滚和人工干预。该工作为在微服务边界内约束智能体非确定性提供了稳健流程。
Retail supply chain management is increasingly reliant on complex SaaS-based microservice systems (MS). While integrating LLM-powered agents offers a significant opportunity for intent-based orchestration, the transition from deterministic microservices to non-deterministic Multi-Agent Systems (MAS) lacks a structured migration path and risks severe system instability. In this paper, we propose a systematic refactoring methodology that prioritizes service migration based on quantified complexity criteria. As the architecture evolves, we embed Quality Assurance (QA)-based regression analysis inline to ensure functional parity between legacy service logic and probabilistic agentic reasoning. To safeguard against logic failures, our framework incorporates a Human-in-the-loop (HITL) mechanism that resolves decision-making gaps when agent outputs violate predefined QA invariants. We evaluated our approach on a supply chain benchmark of 9 microservices with 13 APIs. Our results reveal that complexity-ranked refactoring improves consistency, latency, and cost by 2%, 21%, and 23% over random migration, and by 6%, 25%, and 31% over reverse-ranked order migration, respectively. Furthermore, this ranked approach minimizes rollbacks and human interventions. This work contributes a robust process for containing agentic non-determinism within microservice boundaries through continuous QA alignment and strategic human intervention.