Thanks! I track all repos mentioned on Reddit, Hacker News and Dev.to (almost in real-time). Then, the ones that are commonly mentioned are considered alternatives/similar. I also use some signals from LibHunt itself - what people are comparing and manually suggesting as alternatives.
For example, my example above is spoiling this logic a bit :D. I've mentioned three projects that are neither alternatives nor similar ones. However, their mentions have been tracked and used as a signal. Yes, it's imperfect, but it works "good enough" in most cases.