3 min read
Cylindrical Suturing Evaluation System

TL;DR

Multi-modal system designed to automate the evaluation of complex surgical procedures like “Cylindrical” suturing (e.g., connecting blood vessels). The system utilizes a Retrieval-Augmented Generation (RAG) + Multi-Agent architecture to synthesize clinical feedback, acting as an automated, tire-less senior surgeon.

The Complexity of Cylindrical Suturing

Unlike simple flat wounds, cylindrical suturing requires evaluating complex geometric variables simultaneously most critically, Edge Alignment and Width, alongside slack and angulation. Generating human-readable medical feedback from these independent metrics requires semantic reasoning. Raw numbers (e.g., “Edge Alignment = 4.2”) are unhelpful to a trainee; they need qualitative, actionable advice explaining why the edges misaligned and how to correct their technique.

Agentic AI & Visual RAG Architecture

To provide highly detailed, justifiable, human-like feedback, the system is engineered around a FastAPI backend running a specialized Agentic AI pipeline:

1. Visual Search and Retrieval (CLIP)

When an evaluation is requested, the system uses OpenAI’s CLIP model to convert the suturing image into a mathematical embedding. It compares this vector against a curated Knowledge Base (KB.json) using Cosine Similarity to retrieve the top 3 most visually similar past images that were graded by world-class surgeons.

2. Multi-Agent Team (Groq Llama)

Using the Agno framework, the system orchestrates a “supreme court” of AI agents powered by Groq’s Llama models:

  • Expert Agents: NeuroExpert 1 and NeuroExpert 2 act as independent neurosurgeons. They are given the test image alongside the retrieved historical examples (the Gold Standard) and are instructed to critically evaluate specific subscores.
  • Manager Agent: The “Chief Justice” takes the reports from both experts and the Gold Standard. It uses a weighted mathematical formula (50% Gold Standard + 25% Expert 1 + 25% Expert 2) to calculate the final quantitative score.

3. Automated Report Synthesis

Once the Manager Agent finalizes the evaluation, it generates a comprehensive Markdown report summarizing the qualitative feedback (e.g., “Inconsistent needle bite depth is causing edge misalignment”). A custom PDFReportExporter formats this feedback alongside the calculated subscores (Inter-suture Distance, Slack, Angulation, Position, Edge Alignment) into a polished PDF document, which is asynchronously emailed to the practitioner.