The gist of the question is how to infer what a cat is asking for.
Generally, I make myself available to the cat. Acknowledge their meow, make eye contact, stand in front of them, and wait for the cat to explain what it wants.
That seems to generally work. From experience, cats understand your silent attention as not knowing what to do. Usually, I'll get an indication of what they want in absence of a response from me.
If the cat wants affection, they'll approach you for it.
If they want food, they might start interacting with your hands (where the food comes from, according to them).
If the cat doesn't respond, gently step towards it. The idea is that if it wants you to follow (e.g. my cat brings me to the couch if he wants to sleep on my lap), the cat will start leading you once you move towards it.
It's not impossible that they simply want attention. My cat has a habit of meowing when he's next to me and I'm playing a game; but he stops once I look at him (and might even refuse petting). Sometimes, he just wants to be looked at.
It's also possible that the cat is simply greeting you. Since you don't live together, it's possible that it knows to maintain a friendship with you, even if it doesn't currently need anything.
This is similar to why some cats have a tendency to stay close to you, even if not interacting with you. Our cats always sleep near me, and if I move to a different room, so do they (yet they keep their distance because they want to sleep).
Lastly, if the cat was previously domesticated, it's possible that they're asking to stay with you. Our youngest one was a street cat, who was way too young (4 months) to be out on his own (and from experience, he never got enough time with his mom to begin with).
He approached my girlfriend and meowed to her on the street. Softhearted as she is, she picked him up and walked home with him (with no struggling from him whatsoever). He was incredibly friendly and let us handle him any way we wanted to. It's clear that he had been a pet at one point (knowing about the litterbox etc), so we surmise that he was being especially nice in order to be allowed to stay with us.
In general, if the cat wants something from you, it's up to the cat to explain what it wants. Make it clear that you're listening to its request, and allow for it to figure out how to communicate what it already knows it wants.
If you feel like the message isn't getting across, try doing things and see if the cat engages you.
- If you think it wants to be pet, extend your hand and see is they eagerly look at your hand.
- If you think it's food related, bring some food.
- If you think it was just a simple "hello", divert your attention to something else, turn away, and see if you get another meow.
Neither us nor you know what the cat wants. All you can do is interact with it and get it to reveal its intentions to you.