I did something similar but based on matching abbreviations:
For example
kn pho/eutri
to enter photos/europe_trip. It doesn't track frecency or anything, just matches strings. My algorithm is also used in nushell's cd command.kn also supports multiple dots:
kn .. # enters parent
kn ... # enters grandparent
etc.