RunAgent: Constraint 기반 실행으로 자연어 Plan을 해석하는 Multi-Agent 실행 플랫폼
RunAgent: Interpreting Natural-Language Plans with Constraint-Guided Execution
TL;DR Highlight
LLM이 자연어 플랜을 단계별로 확실히 실행하도록 IF/GOTO/FORALL 같은 제어 구문과 자동 constraint 검증을 붙인 에이전트 실행 프레임워크.
Who Should Read
LLM 에이전트가 복잡한 멀티스텝 태스크를 실행할 때 중간에 틀리거나 빠뜨리는 문제를 겪고 있는 AI 엔지니어. 플랜 기반 워크플로우 자동화를 구축 중인 백엔드 개발자.
Core Mechanics
- 자연어 플랜에 IF, GOTO, FORALL 같은 제어 키워드를 섞어 쓰는 'agentic language'를 도입해서 LLM의 유연성과 프로그래밍 언어의 결정론적 실행을 동시에 확보했음.
- LLM이 'for all 항목에 대해 반복 실행'을 시키면 일부만 처리하는 문제가 있는데, FORALL 키워드로 이 문제를 명시적으로 해결함.
- 실행 시작 시점에 task와 instance를 분석해서 atomic constraint(단일 조건 하나짜리 제약)를 자동 생성하고, 각 스텝 출력마다 관련 constraint만 골라서 검증함.
- 각 스텝마다 LLM 직접 호출 / Python 코드 생성+실행 / Tool 호출 중 어떤 방식이 최적인지 자동 판단하고, 개발자가 prefix(LLM:, PYTHON:, TOOL:)로 직접 지정도 가능함.
- constraint 검증을 두 단계(reason 생성 → judge 판정)로 나눠서 LLM이 제약 위반 여부를 판단하다가 스스로 문제를 풀려는 현상을 방지함.
- 스텝 실패 시 에러 메시지를 context에 XML 태그로 임시 추가하고 재시도하는 error correction 루프가 있으며, 최대 재시도 초과 시 fallback LLM으로 강제 진행함.
Evidence
- Natural-plan Calendar Scheduling에서 RunAgent 81.1% vs 최신 SOTA PlanGEN Best-of-N(Gemini-2.0-Flash) 68.9%, GPT-4o 직접 풀기 58.3%로 모두 초과.
- constraint 검증 모듈을 끄면 75.4%로 떨어짐 → constraint checking이 5.7%p 기여한다는 ablation 결과.
- McNemar 검정 결과 chi-square 253.17, p-value 5.29×10⁻⁵⁶으로 RunAgent가 GPT-4o 플랜 구현보다 통계적으로 유의미하게 우수함.
- SciBench 수학 데이터셋(Stat/Calc/Diff)에서 GPT-4o 직접 풀기 72.2/70.7/50.0% 대비 RunAgent 80.6/78.1/62.0%로 전 카테고리 개선.
How to Apply
- 기존 LLM 에이전트가 '모든 항목에 대해 처리' 같은 반복 태스크를 자주 빠뜨린다면, 플랜 스텝에 'FORALL [항목 리스트]: [작업]' 형태로 작성하고 이를 감지해 개별 서브스텝으로 분해하는 컴파일러 레이어를 붙이면 됨.
- 멀티스텝 워크플로우에서 각 스텝 직후 제약 검증을 넣고 싶다면, 논문 Appendix의 Constraint Generation Prompt를 그대로 가져다 task+instance를 넣어 atomic constraint 리스트를 만들고, Constraint Relevance Prompt로 현재 스텝과 무관한 제약을 필터링한 뒤 검증하는 2단계 구조를 구현하면 됨.
- 알고리즘/수치 계산 스텝은 LLM 직접 답변보다 Python 코드 생성+실행이 정확도가 높으므로, 스텝 텍스트에 'PYTHON:' prefix를 붙이거나 Python Judge 프롬프트(논문 Appendix)를 써서 자동 분기하는 로직을 추가하면 됨.
Code Example
# RunAgent Constraint Generation 프롬프트 사용 예시 (논문 Appendix 그대로)
import openai
def generate_constraints(task: str, instance: str) -> str:
messages = [
{
"role": "system",
"content": """You are an expert at extracting constraints that MUST NOT be violated when solving a task instance.
You will be given:
- A task description
- A specific instance of the task
Your job:
- Output a comprehensive list of constraints that should not be violated while solving the instance.
- Include all explicit hard requirements from the task/instance.
- Include any implicit but necessary constraints/assumptions needed to correctly interpret the instance.
- Do not include any solution, schedule, or plan, ONLY constraints.
Critical constraint quality requirements:
- Make constraints ATOMIC: each numbered item must contain exactly ONE requirement.
- If a requirement contains "and", "or", multiple clauses, or multiple checks, split it into multiple numbered constraints.
- Avoid compound / multi-part constraints.
- Avoid solver goals and optimization goals. Only hard validity/legality constraints.
Output format: Output ONLY a numbered list of constraints as plain text."""
},
{
"role": "user",
"content": f"Task: {task}\nInstance: {instance}"
}
]
response = openai.chat.completions.create(
model="gpt-4o",
messages=messages
)
return response.choices[0].message.content
# 사용 예시
task = "Schedule a meeting for all participants within work hours 9:00-17:00"
instance = "Schedule 1-hour meeting for Alice and Bob on Monday. Alice: busy 10:00-11:00. Bob: busy 14:00-15:30."
constraints = generate_constraints(task, instance)
print(constraints)
# 출력 예:
# 1. The meeting must be scheduled between 09:00 and 17:00.
# 2. The meeting duration must be exactly 1 hour.
# 3. Alice must not have any other meeting during the scheduled time.
# 4. Bob must not have any other meeting during the scheduled time.
# 5. The meeting must be scheduled on Monday.Terminology
관련 논문
adamsreview: Claude Code용 멀티 에이전트 PR 코드 리뷰 파이프라인
Claude Code에서 최대 7개의 병렬 서브 에이전트가 각각 다른 관점으로 PR을 리뷰하고, 자동 수정까지 해주는 오픈소스 플러그인이다. 기존 /review나 CodeRabbit보다 실제 버그를 더 많이 잡는다고 주장하지만 커뮤니티에서는 복잡도와 실효성에 대한 회의론도 나왔다.
Claude를 User Space IP Stack으로 써서 Ping에 응답시키면 얼마나 빠를까?
Claude Code에게 IP 패킷을 직접 파싱하고 ICMP echo reply를 구성하도록 시켜서 실제로 ping에 응답하게 만든 실험으로, 'Markdown이 곧 코드이고 LLM이 프로세서'라는 아이디어를 네트워크 스택 수준까지 밀어붙인 재미있는 사례다.
AI Agent를 위한 Git: re_gent
AI 코딩 에이전트(Claude Code 등)가 수행한 모든 툴 호출을 자동으로 추적하고, 어떤 프롬프트가 어느 코드 줄을 작성했는지 blame까지 가능한 버전 관리 도구다.
Agent-Native CLI를 위한 설계 원칙 10가지
AI 에이전트가 CLI 도구를 더 잘 사용할 수 있도록 설계하는 원칙들을 정리한 글로, 에이전트가 CLI를 도구로 활용하는 빈도가 높아지면서 이 설계 방식이 실용적으로 중요해지고 있다.
Agent-harness-kit: MCP 기반 멀티 에이전트 워크플로우 오케스트레이션 프레임워크
여러 AI 에이전트가 서로 역할을 나눠 협업할 수 있도록 조율하는 scaffolding 도구로, Vite처럼 설정 없이 빠르게 멀티 에이전트 파이프라인을 구성할 수 있다.
Tilde.run – AI Agent를 위한 트랜잭션 기반 버전 관리 파일시스템 샌드박스
AI 에이전트가 실제 프로덕션 데이터를 건드려도 롤백할 수 있는 격리된 샌드박스 환경을 제공하는 도구로, GitHub/S3/Google Drive를 하나의 버전 관리 파일시스템으로 묶어준다.
Original Abstract (Expand)
Humans solve problems by executing targeted plans, yet large language models (LLMs) remain unreliable for structured workflow execution. We propose RunAgent, a multi-agent plan execution platform that interprets natural-language plans while enforcing stepwise execution through constraints and rubrics. RunAgent bridges the expressiveness of natural language with the determinism of programming via an agentic language with explicit control constructs (e.g., \texttt{IF}, \texttt{GOTO}, \texttt{FORALL}). Beyond verifying syntactic and semantic verification of the step output, which is performed based on the specific instruction of each step, RunAgent autonomously derives and validates constraints based on the description of the task and its instance at each step. RunAgent also dynamically selects among LLM-based reasoning, tool usage, and code generation and execution (e.g., in Python), and incorporates error correction mechanisms to ensure correctness. Finally, RunAgent filters the context history by retaining only relevant information during the execution of each step. Evaluations on Natural-plan and SciBench Datasets demonstrate that RunAgent outperforms baseline LLMs and state-of-the-art PlanGEN methods.