Abstract
Building sophisticated task-oriented dialogue systems with Large Language Models (LLMs) often requires complex orchestration of multiple specialized agents. Current frameworks frequently interleave conversational logic with low-level implementation code, leading to maintenance challenges and debugging difficulties. This paper introduces ADL (Agent Declarative Language), a YAML-based language designed to separate high-level business logic from execution. By treating agent definitions as declarative programs interpreted by a multi-agent system (MAS), ADL enables automated runtime optimization and enhanced static analysis.
Introduction
While LLMs have simplified the creation of individual agents, orchestrating a network of specialized agents remains a significant engineering hurdle. Popular frameworks like AutoGen and LangGraph often require developers to embed agent logic within intricate Python boilerplate. This high coupling results in "maintenance nightmares" where logic changes require navigating deep code paths, and "optimization gaps" where the system cannot easily improve performance without manual reprogramming. Furthermore, when logic is buried in code, it becomes difficult for both humans and LLMs to detect errors such as infinite loops.
The ADL Framework
ADL addresses these issues by providing a structured, declarative format for defining agents and their interactions. The language is interpreted by MICA, an open-source multi-agent system designed to execute ADL programs.
Core Agent Types
ADL categorizes agents into four distinct types to handle different conversational needs:
- KB Agent: Specialized in information retrieval from external sources like FAQs or documentation.
- LLM Agent: Manages business logic through natural language instructions and tool usage.
- Flow Agent: Provides rigid, step-by-step control for sensitive workflows, such as payment processing or identity verification.
- Ensemble Agent: Acts as an orchestrator, utilizing a "triage" mechanism to select the appropriate sub-agent for a given user request.
Natural Language Programming
A key feature of ADL is its support for natural language conditions. Developers can define policies and branching logic in plain English (e.g., if: the user claims "Yeah"). At runtime, the MICA system uses an LLM to evaluate these conditions, allowing for flexible yet structured dialogue management.
Orchestration and Optimization
By decoupling the "what" (logic) from the "how" (execution), ADL allows the underlying MAS to perform automated optimizations. One such strategy is Merging, where consecutive agent calls—such as a guardrail check followed by a main agent response—are combined into a single LLM prompt. This reduces both the number of API calls and the overall latency of the system.
Because ADL is a structured language, it also enables LLMs to act as static analyzers. LLMs are significantly more effective at identifying logic bugs in a structured YAML format than in hybrid Python/Prompt code, where function-calling logic can obscure the actual conversation flow.
Experimental Results
The authors evaluated ADL using case studies involving a Bookstore Chatbot and a Retail Banking Bot, comparing it against OpenAI’s Swarm and Rasa-CALM.
Efficiency and Performance
The study compared five orchestration methods within ADL to measure token consumption and response speed. The "Merging" strategy emerged as the most efficient, significantly reducing overhead compared to traditional sequential methods.
As shown in the results, the Merging strategy achieved a token cost of 540 tokens and a latency of 2.34s, whereas the "First-success" method required 1732 tokens and over 10 seconds of latency.
Debugging and Reliability
In a zero-shot test using GPT-4o to detect an infinite loop bug in a banking bot, the LLM correctly identified the error in the ADL implementation. In contrast, when presented with equivalent code in the Swarm framework, the LLM failed to understand the complex function-calling logic and hallucinated a non-existent loop. This demonstrates that ADL’s readability directly translates to better automated debugging and system reliability.
Conclusion
ADL provides a robust framework for building multi-agent chatbots by separating conversational logic from implementation. This declarative approach not only simplifies development and maintenance but also unlocks significant performance gains through automated orchestration strategies like Merging. Future work will explore standardizing interaction patterns for larger-scale agent networks and developing more proactive selection strategies for ensemble agents.
The MICA system and ADL specifications are available as open-source tools to encourage further research in declarative agent orchestration.
Summary updated