Limiting/Amplifying Microphone Output?
Compression is something else entirely. 

Auto gain amplifiers are intended to keep the average sound at some preset level and is a common feature in TVs. However, they are not much use for microphones intended to detect speech since most of the time there is no sound. As such the amplifier will be boosting itself most of the time, only to let through sudden load speech before it can react. 

Auto gain amplifiers are also prone to amplifying the background noise. You may have noticed with TVs equipped with this feature when the sound track is quiet, the background "hiss" slowly grows till someone speaks. This is annoying for human listening, but a definite issue for computer recognition.

As such an auto-gain is probably not what you want. Instead you can clip the output to 5V and detect that with the micro. Then have the micro adjust the volume so it knows what levels it is interpreting. Two to four different volume levels should normally suffice.