In comparison SARS survivors from 2003 still have immunity (I believe the same is with MERS).
I'm not replying directly to you, but the duration of the immunity isn't terribly important past a certain point. The vaccine is much, much safer than infection. It prevents overwhelming of medical resources, and can reduce the community transmission levels to an extent that it can end a pandemic. Those are the primary benefits, not better or worse immune memory. That would just be a fringe benefit if it were the case.
I agree that the vaccine is probably safer. However, propaganda that covid19 infection doesn't give you as good immune memory as the vaccine is outright false and should be considered as vaccine misinformation on major platforms.
It sounded like they're making some assumptions because the mRNA vaccine causes most people to produce a higher level of antibodies for a longer period of time vs the real virus. However, antibodies are not the only part of immune system, so it's possible that other parts of the immune system may still be effective.
The real answer is we don't know that yet conclusively, but we do know the vaccine is effective, so until we have a better understanding it's a good idea to be vaccinated regardless (especially if you have any risk factors).
Around 9-12 months ago, a study came out that said antibodies from infection last 3 months. They couldn't say any longer though because that study only had 3 months of data. Unfortunately, this was largely reported on as "up to 3 months", making a lot of people think immunity only lasted a maximum of 3 months.
Since then, now that we have more data, further studies have come up that keep extending that duration. Last I recall I think there was one that got to "at least 14 months"..? But these ones don't get as much spread as the original wrong reporting, so it got kinda stuck as "don't create long-lasting immunity".