A new PI or the brilliant current PI We, STEM students, until we get somewhat a permanent position in our career, we work in different labs, with different PIs and people throughout our student life, starting from bachelor to our post-doc; we like some, we hate some, and in rare occasions, we really like some.
Even though I'm just starting to my master's degree this year, I've worked with a couple of different PIs already, seen different research environments &amp; groups, worked with many different Ph.D./Master students &amp; technicians, dealt with much administrative staff, got around many unnecessary formalities.
Now, I'm currently working (as a short-term intern) with a brilliant PI, with brilliant Ph.D. students in an amazing institute with friendly &amp; supportive administrative &amp; technical staff.
Even though my current affiliation with this group &amp; institute is temporary, it is quite possible (and probable) that I can do my Ph.D. here.
However, if I look into the past, it is clear that all those new experiences - working with different people, in different places - had a positive impact on me, and each case I was glad to move to a new research group, with a new project.
That is why I have the Marriage Problem: I'm quite happy with my current settings here, so if I want to do my Ph.D. here I'll know what I will be getting into, who I will be working with, what the research experience will be, etc.
However, if I choose (or want to) do my Ph.D. elsewhere, I don't know whether I will happy there, whether the PI will spare as much time as my current PIs, whether I will be able to work as efficiently as I'm working with my current PI, whether the actual research will be interesting as that of my current PI, whether I can get along with other students &amp; staff, etc.
I'm sure that this is a common dilemma that many academics have faced/been facing during their career. So my question is the following:
What criteria are important to consider in such a situation? Would not-changing-PI have a big opportunity cost if you happened to be able to work with almost anyone you want? Would I be taking a lot of risks in the early stages of my career if I happen to pursue a research direction that I'm not familiar with? Can you share you experiences if you have any?
The criteria I think are important here:

Growing your social capital. In academia, the size and diversity of your professional network is a huge determinant of your success (think co-authors on grant applications and papers, colleagues on editorial teams, and advisors for your PhD students as well as diversity of ideas, methods, and philosophies, and, yes, employment opportunities). It sounds like you've already built a great network where you are, so a good thing to do might be to go an build another one somewhere else, obviously without abandoning your current contacts and relationships.
Slightly contradicting my first point, what kind of professor do you see yourself in a couple of decades? Some people love interdisciplinary research projects, leadership positions in international networks and consortia, and variety and mobility in general. Others do their best work spending years or decades looking into one or two big questions, surrounded by good PhD students and loyal colleagues. I.e., it's also a personality question.
How would the move affect your life outside work? Will you have to sell your house, move to another part of the country you've never lived in (or to another country that speaks another language), and rebuild your life? Do you have care responsibilities for your parents or children? Can your finances handle it? All this is a huge thing that often gets overlooked in the pursuit of some imaginary professional success. Over the decades, I've seen junior colleagues move to the UK from the other side of the globe just to pack up and go somewhere else 2 years later, without much to show for it.