If the vibe was positive and you really liked the company or the people you met, then you could just send a short email saying thank you for the time and the opportunity, and maybe hoping for a future collaboration together. Then leave it at that.
As Kilisi mentioned in his answer this might be just a polite platitude. People sometimes don't like being rejected for a job, so companies give the bad news with a smile and ending on a positive note.
Some HR departments hold a database of candidates they interviewed, with detailed evaluations, and might follow up after some time if they think you are worth it. For example, if you apply for a job and you are a smart junior, then maybe in 3 years when they have another job, they might call you up for another interview and see how you progressed since they last interviewed you. That gives them a good indication of how you might evolve in the next 3 years. If they really liked you and they have other positions opened, or others will open up in the future and they think you might be a match for that, they will contact you. If this was not the case, then they won't.
But not all companies bother though with keeping such details about previous candidates.
Either way, in this sort of situations, the Hollywood principle usually applies: don't call us, we'll call you.