I’m not aware of SO’s plans to remain profitable and relevant, but I do know they have an enterprise offering. I’ve seen ads on LinkedIn recently for MCP functionality tied to the enterprise SO offering that lets you use it as a knowledge base. I could see that potentially being a path to stay relevant.
The place I work at tried using an SO enterprise instance and it was quite ineffective. We didn't have the toxicity of the public instance, but generally having a Q&A forum double as a knowledge base is an oddball format that doesn't work out. Adding AI integration is not likely to compensate for that.