cs.AIAug 13, 2026

Retrieval-grounded robot program generation and simulation-based correction via Model Context Protocol

Authors: Zhichao Zhou, Siyuan Chen, Omkar Salunkhe, Ebru Turanoglu Bekar, Johan Stahre, Anders Skoogh

Organizations: Department of Mechanical Engineering, Chalmers University of Technology, Hörsalsvägen 7a, Gothenburg, SE-412 96, Sweden

Abstract

Flexible manufacturing requires industrial robots to be reprogrammed rapidly as product variants change. This paper presents a language-model-based workflow that generates, validates, and iteratively corrects ABB RAPID robot programs from natural language task descriptions. A dual-stream retrieval-augmented generation (RAG) pipeline grounds code generation in verified technical documentation and production templates, reducing domain-specific errors produced by ungrounded language models. A custom Model Context Protocol (MCP) server connects the language-model client directly to ABB RobotStudio for automated code upload, simulation execution, and diagnostic feedback. The evaluation combines a 30-query retrieval benchmark, scoped code-generation checks, and RobotStudio case studies in a simulated pickand- place manufacturing cell. The simulation loop exposes execution failures that static and semantic checks alone cannot catch, including suction release-height errors, unreachable placement targets, and configuration-dependent recovery motions. The results show how RAG and MCP can connect grounded code generation with executable feedback from industrial robot simulation software, while reducing but not eliminating expert setup and final supervision.

Figures & tables

Explore similar work

CardsList
  1. RAPID: Robot Agentic Programming from Demonstrations

    Sep 24, 2026Yuyao Liu, Jiayuan Mao, David Hsu +2Program SynthesisContact-Rich Robotic Manipulation

  2. Domain-Adaptable Reinforcement Learning for Code Generation with Dense Rewards

    May 20, 2026Erfan Aghadavoodi Jolfaei, Daniel Maninger, Abhinav Anand +2RL for Code GenerationReinforcement Learning