I am confused with the uses of "ahí", "allí" and "allá".
It seems they are used according to different situations.
Could you please tell me what are the differences and provide some examples?
As far as I know, there are no strong differences between those words, at least in spoken language. There might be tiny differences according to the dictionary, but here are a few examples of their use, at least uses I can think of:
This can be explained with the three grades of demonstratives and of verbal persons:
The acá and allá versions are less precise. You might in English say over here or around there. Por acá is around here, por allá is over there somewhere. There is no *ahá version for euphonious reasons; people use por ahí to mean out there somewhere, as though it were the -á version of the middle (2ª persona) degree.