Multi-Agent DSL Framework: A New Paradigm for Complex Event Processing

Project Vision & Core Challenge

Vision: To create a highly efficient, scalable, and adaptive multi-agent system for real-time complex event processing.

Challenge: Traditional systems struggle with dynamic, unpredictable events and lack a feedback loop for continuous adaptation.

Project Overview

With the widespread adoption of Large Language Models (LLMs) in multi-agent systems, tasks often require multi-round reasoning, structured outputs, and collaborative decision-making among agents. However, existing frameworks generally lack a Domain-Specific Language (DSL) that explicitly supports task decomposition, agent communication, and runtime optimization.

Inspired by SGLang (NeurIPS 2024), we introduce a novel Multi-Agent DSL framework designed to unify high-level agent programming with efficient low-level execution. This work bridges the gap between agent-oriented programming and high-performance runtimes, offering a reproducible and extensible platform for research in multi-agent collaboration, structured generation, and AI systems engineering.

Core Innovations

  • Extended DSL Primitives: We introduce primitives like spawn, route, gather, with_sla, contract, blackboard, on, and emit to explicitly model task decomposition, routing, constraints, and collaboration. (DSL原语:扩展了spawn, route等原语,用于任务分解、路由和协作)
  • Runtime Optimizations (运行时优化):
    • RadixTrie Prefix Caching: Reduces redundant computations by reusing common prefixes across different tasks. (RadixTrie前缀缓存:复用任务前缀,减少重复推理)
    • Cache-Aware Scheduling: Prioritizes tasks with longer prefixes to improve throughput and response time. (缓存感知调度:长前缀优先,提升吞吐与响应)
  • Structured Output Generation: Supports Regex and lightweight cFSM validation to ensure outputs conform to the required format. (结构化输出:支持Regex/cFSM校验,保证输出格式)
  • Event-Driven Architecture: A built-in EventBus enables asynchronous communication and coordination among agents. (事件驱动:内置EventBus,支持多智能体异步通信)
  • Full-Stack Reproducibility: The framework is delivered with integrated examples, experiments, unit tests, A/B comparison tools, and a CLI for zero-dependency execution. (可复现性:集成示例、测试与命令行工具,零依赖运行)

Our Solution: The Multi-Agent DSL Framework

A specialized DSL that orchestrates multiple intelligent agents to collaboratively handle complex scenarios.

  • Declarative: Define "what" to do, not "how."
  • Adaptive: Agents dynamically adjust to real-time events.
  • Scalable: Built for high-throughput and low-latency.

System Architecture

Our framework features a modular, decoupled architecture that ensures scalability and maintainability, separating high-level logic from the execution runtime.

System Architecture Diagram

The DSL Primitives: Building Blocks of Intelligence

Our DSL is built on a few key primitives that enable powerful, declarative workflows.

# Example: Autonomous Driving Workflow
workflow "autonomous_driving" {
    monitor(event_source="traffic_camera")
    detect(pattern="accident", confidence > 0.8)
    dispatch(agent="safety_agent", action="secure_scene")
    dispatch(agent="reroute_agent", action="plan_detour")
    feedback(channel="system_metrics", data="latency, throughput")
}

Live Demo

Showcasing the system's real-time event processing capabilities.

(A live demo would be embedded or linked here to demonstrate the framework in action.)

Use Case 1: Smart City - Performance Analysis

Optimizing urban services like 311 incident response through intelligent event processing.

Cache Hit Rate (Smart City)
Cache Hit Rate: Demonstrates the effectiveness of our caching strategy.
Latency Distribution (Smart City)
Latency: Achieves sub-second processing times for critical events.

Use Case 2: Autonomous Driving - Decision Efficiency

Enhancing safety and traffic flow in autonomous vehicle coordination.

Event Type Share (AD)
Event Distribution: Shows the variety of complex events our system handles.
Clearance vs. Reroute Time (AD)
Decision Time: Enables rapid, critical decision-making for rerouting and scene clearance.

Summary & Future Work

Summary: Our framework provides a robust and efficient solution for real-time, complex event processing, validated in two demanding use cases.

Future Work:

Q&A

Thank you for your attention. We are now open for questions.