Multi-agent systems built on large language models (LLMs) are difficult to reason about. Coordination errors such as deadlocks or type-mismatched messages are often hard to detect through testing. We introduce a domain-specific language for specifying agent coordination based on message sequence charts (MSCs). The language separates message-passing structure from LLM actions, whose outputs remain unpredictable. We define the syntax and semantics of the language and present a syntax-directed projection that generates deadlock-free local agent programs from global coordination specifications. We illustrate the approach with a diagnosis consensus protocol and show how coordination properties can be established independently of LLM nondeterminism. We also describe a runtime planning extension in which an LLM dynamically generates a coordination workflow for which the same structural guarantees apply. An open-source Python implementation of our framework is available as ZipperGen.
翻译:基于大语言模型(LLM)构建的多智能体系统难以进行推理分析。诸如死锁或消息类型不匹配等协调错误往往难以通过测试发现。我们提出一种基于消息序列图(MSC)的领域特定语言,用于规范智能体协调行为。该语言将消息传递结构与LLM动作(其输出仍不可预测)相分离。我们定义了该语言的语法与语义,并提出一种语法导向的投影方法,可从全局协调规范生成无死锁的局部智能体程序。我们通过诊断共识协议演示该方法,并展示如何独立于LLM的非确定性建立协调属性。我们还描述了一种运行时规划扩展,其中LLM可动态生成同样具有结构保证的协调工作流。本框架的开源Python实现ZipperGen已公开发布。