Ahi, also known as Vritra, existed in the Vedic literature. Vritra, the enemy of Indra was actually known as Ahi in the Vedas. He had three heads. There is a story involving Indra and Vritra or Ahi in the Rigveda.
Here it is stated that Vritra kept the waters of the world captive until he was killed by Indra. Indra destroyed his ninety nine fortresses. There was a battle between Indra and Ahi and Ahi broke Indra`s two jaws, but was then thrown down by Indra and crushed down.