8. In tetrahedron $ABCD$, $\triangle ABD$ is an equilateral triangle, $\angle BCD=90^{\circ}$, $BC=CD=1$, $AC=\sqrt{3}$, $E, F$ are the midpoints of $BD, AC$ respectively, then the cosine value of the angle formed by line $AE$ and $BF$ is $\qquad$
Given, $A C=\sqrt{3}, B C=1, A B=\sqrt{2}$, then
$\angle A B C=90^{\circ} \Rightarrow B F=\frac{1}{2} A C=\frac{\sqrt{3}}{2}$,
and $C E=E B=\frac{\sqrt{2}}{2} \Rightarrow G B=\frac{\sqrt{10}}{4}$,
$F G=\frac{1}{2} A E=\frac{\sqrt{6}}{4}$, in $\triangle F G B$,
$\cos \angle G F B=\frac{\frac{3}{4}+\frac{3}{8}-\frac{5}{8}}{2 \cdot \frac{\sqrt{3}}{2} \cdot \frac{\sqrt{6}}{4}}=\frac{\sqrt{2}}{3}$. Therefore, the cosine of the angle formed by the lines $A E$ and $B F$ is $\frac{\sqrt{2}}{3}$.