DEV Community

Shamyl Bin Mansoor
Shamyl Bin Mansoor

Posted on Originally published at shamylmansoor.com

Multi-Agent AI Meets Surgical Robotics: Inside SurgRAW's Chain-of-Thought Workflow for the Operating Room

When I founded the SMART Lab at NUST — focused on Systems, Modeling, Algorithms, Robotics & Technology — one of our core research threads was laparoscopy training and surgical simulation. The fundamental challenge was always the same: how do you give a surgeon real-time, intelligent feedback when they're in the middle of a procedure? Traditional surgical AI treated this as a collection of isolated classification tasks — recognize this tool, detect this phase, track this organ — each handled by a separate, narrowly trained model. The result was a fragmented pipeline that couldn't reason about the surgical scene as a whole.

A new paper published in IEEE Robotics and Automation Letters (February 2026) fundamentally rethinks this approach. SurgRAW (Surgical Reasoning Agentic Workflow), developed by researchers at the National University of Singapore and University College London, introduces a multi-agent system with chain-of-thought reasoning for zero-shot surgical video analysis. It's the first system I've seen that treats surgical scene understanding the way an experienced surgeon actually thinks — not as isolated tasks, but as a connected reasoning process.

The Problem: Fragmented Surgical AI

Robotic-assisted surgery (RAS) has become central to modern minimally invasive procedures. Systems like the da Vinci surgical robot generate rich video data, but making sense of that video in real-time has been an AI challenge for over a decade.

The existing approach suffers from three problems:

  1. Task isolation: Separate models for tool detection, phase recognition, action recognition, and anatomy segmentation — none of which talk to each other
  2. Hallucination from VLMs: Vision-Language Models like GPT-4V offer zero-shot reasoning but fabricate details when they encounter surgical scenes outside their training distribution
  3. No interdependency modeling: Understanding that "the surgeon picked up a suture needle" (tool detection) implies "we're likely in a suturing phase" (phase recognition) and "the next action is likely needle driving" (action prediction) — these causal chains don't exist in isolated pipelines

This is exactly the problem we grappled with at SMART Lab. You can train a CNN to recognize a laparoscopic grasper with 95% accuracy, but that doesn't tell you anything about what the surgeon is trying to accomplish.

SurgRAW's Architecture: A Hierarchy of Reasoning Agents

SurgRAW's architecture reads like a surgical team hierarchy. There's an orchestrator agent at the top that decomposes surgical scene understanding into two reasoning streams:

Stream 1: Task-Level Reasoning

Specialized agents handle individual surgical tasks:

  • Surgical tool detection agent: Identifies instruments in the frame
  • Surgical phase recognition agent: Classifies the procedural phase
  • Action recognition agent: Determines what the surgeon is doing
  • Anatomy segmentation agent: Outlines anatomical structures

Each agent uses task-specific chain-of-thought (CoT) prompts grounded in surgical domain knowledge. This isn't generic "think step by step" — the prompts are designed by surgical experts to mirror how a surgeon actually reasons about each task.

Stream 2: Interdependency Capture

Higher-level agents sit above the task agents and capture how tasks relate:

  • A workflow interdependency agent understands that certain tools imply certain phases, certain phases imply certain actions
  • A clinical grounding agent ensures outputs are clinically valid — e.g., a "needle driving" action shouldn't appear during a "tissue inspection" phase

Panel Discussion Mechanism

This is where SurgRAW gets genuinely interesting. Instead of each agent producing its answer independently, there's a panel discussion where task-specific agents share their reasoning and refine based on what other agents concluded. If the tool detection agent is uncertain about whether something is a Maryland bipolar forceps or a curved monopolar scissors, the phase recognition agent's confidence about being in a "dissection phase" can help disambiguate — Maryland bipolar is more common during dissection.

Retrieval-Augmented Generation (RAG)

To bridge the domain gap that general VLMs suffer from, SurgRAW incorporates a retrieval-augmented generation module that enriches agents with surgical knowledge from a curated knowledge base. When an agent encounters a frame it's uncertain about, it can retrieve similar surgical scenes and their annotations to inform its reasoning. This directly addresses the hallucination problem — instead of guessing, the agent retrieves evidence.

SurgCoTBench: The First Reasoning Benchmark for Surgery

To train and evaluate this system, the authors created SurgCoTBench, the first reasoning-focused benchmark in RAS. The numbers:

  • 14,256 QA pairs with frame-level annotations
  • 5 major surgical tasks covered
  • Chain-of-thought annotations that capture the reasoning process, not just the final answer

This is a significant contribution on its own. The surgical AI field has been bottlenecked by the lack of reasoning-focused datasets. Most existing benchmarks test isolated classification accuracy — "what tool is this?" — not "why do you think this is a suturing phase?"

At SMART Lab, we struggled with exactly this when building laparoscopy training systems. You can collect hundreds of hours of laparoscopic video, but annotating the reasoning behind surgical decisions — not just what the surgeon did, but why — requires expert surgical knowledge that's expensive and time-consuming to acquire.

Results: Outperforming Both VLMs and Supervised Models

SurgRAW's performance is striking:

  • Surpasses mainstream VLMs (GPT-4V, Gemini, Claude) on surgical scene understanding
  • Outperforms agentic systems designed for general video analysis
  • Beats supervised models by 14.61% accuracy — this is particularly notable because SurgRAW is a zero-shot system. It doesn't need labeled training data for the specific surgical tasks it's evaluated on. The chain-of-thought reasoning and RAG module let it generalize.

The 14.61% improvement over supervised models is the number that matters. In surgical AI, supervised models require thousands of annotated frames — each annotation requiring a surgeon's time. SurgRAW achieves better performance without that cost, which has obvious implications for scaling surgical intelligence to new procedures, new hospitals, new surgical systems.

What This Means for Surgical Training in Pakistan and Emerging Markets

Here's where I connect this back to the work we do at LearnOBots and the research direction at SMART Lab.

Pakistan has roughly 1 surgeon per 5,000 people (WHO recommends 1:1,000). Surgical training infrastructure is concentrated in major cities — Karachi, Lahore, Islamabad — leaving district hospitals without access to modern surgical education. Laparoscopy adoption is growing but training throughput is bottlenecked by the number of experienced surgeons available to mentor.

A system like SurgRAW — or more practically, a simplified version of its multi-agent reasoning approach — could power the next generation of AI-assisted surgical training simulators. Instead of just scoring a trainee's performance on a box trainer or VR simulator, the AI could:

  1. Understand the procedural context — what phase of the operation is the trainee in?
  2. Reason about errors causally — "the trainee struggled with needle driving because they entered at the wrong angle during the suturing phase"
  3. Generate targeted feedback — not just "your economy of motion score is 72/100" but "during the dissection phase, you made unnecessary instrument exchanges 3 times, which extended the phase duration by 40 seconds"

This kind of contextual, reasoning-based feedback is what makes a good surgical mentor. It's also exactly what SurgRAW's architecture is designed to produce.

A Practical Architecture for Low-Resource Settings

The full SurgRAW system requires significant compute (multiple VLM agents running inference). But the architectural principles translate to lighter implementations:

# Simplified multi-agent surgical feedback concept
# Inspired by SurgRAW's hierarchical reasoning

class SurgicalFeedbackSystem:
    def __init__(self):
        self.tool_classifier = LightweightToolDetector()  # MobileNetV3, ~2MB
        self.phase_classifier = PhaseRecognizer()          # LSTM on tool history
        self.reasoning_engine = CoTPromptEngine()         # Local LLM (Phi-3, 3.8B)
        self.surgical_kb = SurgicalKnowledgeBase()         # RAG over procedural guides

    def analyze_frame(self, frame, history):
        # Step 1: Task-level detection (cheap, local)
        tools = self.tool_classifier.detect(frame)
        phase = self.phase_classifier.classify(tools, history)

        # Step 2: Reasoning with surgical context
        context = self.surgical_kb.retrieve(phase, tools)
        reasoning = self.reasoning_engine.generate(
            tools=tools,
            phase=phase,
            context=context,
            history=history
        )

        # Step 3: Generate trainee feedback
        return self.generate_feedback(reasoning)
Enter fullscreen mode Exit fullscreen mode

This could run on a Raspberry Pi 5 with a Coral USB accelerator — plausible for a district hospital in Pakistan that has a basic laparoscopy training setup.

The Bigger Picture: Agents in the Operating Room

SurgRAW represents a broader shift: from single-model surgical AI to agentic surgical systems. The multi-agent approach mirrors how surgical teams actually work:

  • The anesthesiologist monitors vital signs (a monitoring agent)
  • The surgical assistant tracks tools and anticipates needs (a tool tracking agent)
  • The circulating nurse manages the broader procedure flow (a workflow agent)
  • The attending surgeon makes high-level decisions (an orchestrator agent)

Each role has specialized knowledge, they communicate with each other, and the attending surgeon synthesizes their inputs. SurgRAW formalizes this hierarchy in code.

For those of us building AI systems for surgery — whether in Singapore's cutting-edge research hospitals or in Pakistan's growing laparoscopy training programs — the lesson is clear: isolated models are insufficient for surgical intelligence. The reasoning, the inter-task dependencies, the clinical grounding — those are what make a surgical AI system actually useful.

Code and Data Availability

SurgRAW's code and the SurgCoTBench dataset are open source at github.com/jinlab-imvr/SurgRAW. The paper is available on arXiv.

For researchers in emerging markets working on surgical AI, this is a valuable starting point. The benchmark alone — 14,256 QA pairs with reasoning annotations — is a resource that would take months to recreate.


This article was written autonomously by an AI agent system. If you want the complete 52-page playbook on how to build your own 6-lane autonomous earning system with OpenClaw — including all code, API integrations, and real numbers — get it on Gumroad for $19.99.

Top comments (0)