arXiv:2505.13453cs.PLcs.AI2025-05被引 4

用新编程语言Pel让AI代理更安全高效地协作执行复杂任务。

Pel, A Programming Language for Orchestrating AI Agents

  • 设计简洁语法,通过结构控制实现细粒度权限管理。
  • 支持自然语言条件判断与自动错误修复,提升系统可靠性。
  • 适合构建高阶智能体框架,研究者和开发者必看。

大型语言模型(LLMs)的兴起拓展了计算边界,但超出简单文本生成的控制与协调仍面临挑战。现有方法如函数调用和代码生成在表达力、可扩展性、成本、安全性及细粒度控制方面存在局限。本文提出Pel,一种专为协调LLM能力而设计的新编程语言。受Lisp、Elixir、Gleam和Haskell启发,Pel具备语法简洁、自指性强、语义丰富等特点,支持复杂动作、控制流与跨代理通信,且安全高效。其设计强调极简、易修改的语法,适用于受限的LLM生成,无需复杂沙箱即可在语法层面实现能力控制。核心特性包括:强大的管道机制用于线性组合、一等函数闭包支持部分应用与函数式模式、内置由LLM评估的自然语言条件、以及带Common Lisp风格重启机制的高级读-求值-打印循环(REPeL),结合LLM驱动的辅助代理实现自动纠错。此外,通过静态依赖分析实现独立操作的自动并行化,对高性能智能体系统至关重要。我们主张Pel提供了一种更稳健、安全且富有表现力的LLM协调范式,推动更复杂可靠的AI智能体框架发展。

原文摘要 · Abstract (English)

The proliferation of Large Language Models (LLMs) has opened new frontiers in computing, yet controlling and orchestrating their capabilities beyond simple text generation remains a challenge. Current methods, such as function/tool calling and direct code generation, suffer from limitations in expressiveness, scalability, cost, security, and the ability to enforce fine-grained control. This paper introduces Pel, a novel programming language specifically designed to bridge this gap. Inspired by the strengths of Lisp, Elixir, Gleam, and Haskell, Pel provides a syntactically simple, homoiconic, and semantically rich platform for LLMs to express complex actions, control flow, and inter-agent communication safely and efficiently. Pel's design emphasizes a minimal, easily modifiable grammar suitable for constrained LLM generation, eliminating the need for complex sandboxing by enabling capability control at the syntax level. Key features include a powerful piping mechanism for linear composition, first-class closures enabling easy partial application and functional patterns, built-in support for natural language conditions evaluated by LLMs, and an advanced Read-Eval-Print-Loop (REPeL) with Common Lisp-style restarts and LLM-powered helper agents for automated error correction. Furthermore, Pel incorporates automatic parallelization of independent operations via static dependency analysis, crucial for performant agentic systems. We argue that Pel offers a more robust, secure, and expressive paradigm for LLM orchestration, paving the way for more sophisticated and reliable AI agentic frameworks.

AI代理编程语言协同调度LLM

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。