14. As shown in the figure, in acute $\triangle A B C$, $A C=B C=10$, and $D$ is a point on side $A B$. The incircle of $\triangle A C D$ and the excircle of $\triangle B C D$ that is tangent to side $B D$ both have a radius of 2. Find the length of $A B$.

 untranslated text remains the same as the source text.
As shown in the figure, $C N=C G \Rightarrow C B+a=C H+2 b$
$\Rightarrow C H=C B+a-2 b$, and $C H=C M$,
then $C B+a-2 b=C A-c \Rightarrow a+c=2 b$.
Also, $\angle 1+\angle 2=90^{\circ} \Rightarrow \triangle O_{1} A M \sim \triangle B O_{2} N$
$\Rightarrow \frac{A M}{O_{1} M}=\frac{O_{2} N}{B N} \Rightarrow a c=4$.
In $\triangle A B C$, $A B=a+c+2 b=4 b$
$\Rightarrow \cos \angle C A B=\frac{2 b}{10}=\frac{b}{5}$, in $\triangle O_{1} A M$, $\tan \angle 1=\frac{2}{c}$, using the double angle formula we get
$\frac{b}{5}=\frac{1-\frac{4}{c^{2}}}{1+\frac{4}{c^{2}}} \Rightarrow b\left(1+\frac{4}{c^{2}}\right)=5\left(1-\frac{4}{c^{2}}\right)$. Noting that $b=\frac{1}{2}(a+c)=\frac{1}{2}\left(c+\frac{4}{c}\right)$,
thus $\left(c+\frac{4}{c}\right)\left(1+\frac{4}{c^{2}}\right)=10\left(1-\frac{4}{c^{2}}\right) \Rightarrow\left(c+\frac{4}{c}\right)\left(c+\frac{4}{c}\right)=10\left(c-\frac{4}{c}\right)$
$\Rightarrow\left(c+\frac{4}{c}\right)^{2}=\left(c-\frac{4}{c}\right)^{2}+16=10\left(c-\frac{4}{c}\right) \Rightarrow c-\frac{4}{c}=2$ or 8.
When $c-\frac{4}{c}=2$, $c^{2}-2 c-4=0 \Rightarrow c=\sqrt{5}+1, a=\sqrt{5}-1 \Rightarrow A B=4 \sqrt{5}$;
When $c-\frac{4}{c}=8$, $c^{2}-8 c-4=0 \Rightarrow c=2 \sqrt{5}+4, a=2 \sqrt{5}-4 \Rightarrow A B=8 \sqrt{5}$, at this time $\cos \angle C A B=\frac{2 \sqrt{5}}{5}>\frac{\sqrt{2}}{2} \Rightarrow \angle C A B<45^{\circ}$, which contradicts the acute $\triangle A B C$. In summary, $A B=4 \sqrt{5}$.