Solution
In a regular pentagon each interior angle is $108^\circ$ and each diagonal makes $36^\circ$ with the adjacent sides. Angle chasing in the figure gives $\angle GAI=\angle AIG=18^\circ$, so $AG=GI$ and $\angle AGI=180^\circ-2\cdot18^\circ=144^\circ$. Thus $\triangle AGI$ is isosceles, and
$$AI=2(AG)\sin72^\circ.$$
Using $AG=2$ and $\sin^2 72^\circ=\dfrac{5+\sqrt5}{8}$, we get
$$AI^2=4(AG)^2\sin^2 72^\circ=16\cdot\frac{5+\sqrt5}{8}=\boxed{10+2\sqrt5}.$$