RAG and MCP Generate, Correct Robot Programs

Zhichao Zhou, Siyuan Chen, Omkar Salunkhe, Ebru Turanoglu Bekar, Johan Stahre, Anders Skoogh· August 25, 2026 View original

Key takeaways

  • Language models can generate and correct robot programs from natural language.
  • A dual-stream RAG pipeline grounds code generation in verified documentation.
  • Model Context Protocol (MCP) connects AI to robot simulation for feedback.
  • Simulation-based correction identifies execution failures not caught by static checks.

Who benefits

ManufacturingAutomotiveRoboticsIndustrial AutomationAerospace

Summary

This paper introduces a language-model-based workflow that generates, validates, and corrects ABB RAPID robot programs from natural language descriptions. It uses a dual-stream RAG pipeline for grounding and a custom Model Context Protocol (MCP) server for simulation-based feedback and iterative correction.

The demand for flexible manufacturing necessitates rapid reprogramming of industrial robots to adapt to changing product variants. This research presents an innovative workflow that leverages language models to generate, validate, and iteratively correct ABB RAPID robot programs directly from natural language task descriptions. The system employs a dual-stream Retrieval-Augmented Generation (RAG) pipeline. This pipeline grounds the code generation process in verified technical documentation and production templates, significantly reducing the domain-specific errors that ungrounded language models often produce. A crucial component is a custom Model Context Protocol (MCP) server, which establishes a direct connection between the language model client and ABB RobotStudio. This connection enables automated code uploads, simulation execution, and diagnostic feedback. Evaluation involved a retrieval benchmark, code-generation checks, and RobotStudio case studies within a simulated pick-and-place manufacturing cell. The simulation loop proved vital in uncovering execution failures that static and semantic checks alone could not detect, such as suction release-height errors or unreachable targets. The results demonstrate how RAG and MCP effectively link grounded code generation with executable feedback from industrial robot simulation software, streamlining robot programming while still requiring expert setup and final supervision.

Why it matters

For manufacturing professionals, this technology offers a path to significantly accelerate robot programming and adaptation, reducing downtime and increasing flexibility in production lines.

How to implement this in your domain

  1. 1Explore integrating RAG-based code generation with robot simulation software for faster programming.
  2. 2Investigate the use of Model Context Protocols to connect AI models directly to industrial control systems for feedback.
  3. 3Develop internal knowledge bases of verified technical documentation and production templates for AI grounding.
  4. 4Pilot AI-assisted robot programming for specific manufacturing tasks to assess efficiency gains.

Original post by Zhichao Zhou, Siyuan Chen, Omkar Salunkhe, Ebru Turanoglu Bekar, Johan Stahre, Anders Skoogh

"arXiv:2608.21417v1 Announce Type: new 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 program…"

View on X

Originally posted by Zhichao Zhou, Siyuan Chen, Omkar Salunkhe, Ebru Turanoglu Bekar, Johan Stahre, Anders Skoogh on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses