A broker-integrated algorithm for electromagnetic counterpart searches to gravitational-wave events in O4a and O4b runs | Synapse