When you are so still and free from mental modulations, that is when you are a yogi. Then you can know the answer. That is why the still consciousness, yogic consciousness is called sarvajna. In that state of samadhi, the seed of all-knowingness is present in that consciousness.