Robots are already being used to perform all kinds of surgeries. They are usually used as tools to assist surgeons but in the future they will perform surgeries on their own. According to John Hopkins University, the Smart Tissue Autonomous Robot (STAR) managed to reconnect two ends of an intestine in 4 animals with better accuracy than humans
a structural light–based three-dimensional endoscope and machine learning–based tracking algorithm developed by Kang and his students guides STAR.
The STAR can adjust its surgical plan in real-time just like a human surgeon. You can find out more about it here.