In my opinion, "allí" and "ahí" are the same word all together. If you sound both of them out, they sound no different than the other. They both even have the same number of syllables.
allí = a-yi
ahí = a-i
It shouldn't matter which variant you use for "there" It is only when you assimilate a velar consonant in the middle of it that it becomes "here". Similar to the difference in there and here. In English, we add a letter to say.. "there"
Adding a velar consonant.. such as a letter than sounds like /k/ /g/ or /x/ <== "H" sound, converts the word. If you were to actually pronounce the h in "ahí" as if it were "ají" You would then have a a word that sounded like "here".
The same goes for "aguí" It sounds no different than "aquí" because of the velar consonant.
Now, what really determines the distance, is that very last syllable's vowel. In the above examples, you'll notice that they all end in a /i/ "ee" sound, which is a closed vowel. If you drop the /i/ and add an /a/... an open vowel, then you have flipped the word on its head and it means something different.
allí => allá Changing the context from "There!" to "Over there!"
aquí => acá Changing the context from "Here!" to "Over here!".. or "Right here!"
The main idea here is that the closed vowel indicates you are dictating to someone near year. It is also used in diminutives, but that's another story altogether.
When you stress that closed vowel, /i/, the sound doesn't travel as far as if you were to use an open vowel... /a/
It's more or less the difference between squealing and squalling.