4. As shown in Figure 4, given that the two medians $B D$ and $C E$ of $\triangle A B C$ intersect at point $G$, and points $A, D, G, E$ are concyclic, $B C=6$. Then the length of $A G$ is . $\qquad$
4. $2 \sqrt{3}$.

As shown in Figure 10, extend $A G$ to intersect $B C$ at point $F$, and connect $D E$, which intersects $A G$ at point $M$.
Obviously, $G$ is the centroid of $\triangle A B C$, and $A G=2 G F$.
Also, $D E \Perp \frac{1}{2} B C$, and $M$ is the midpoint of $A F$, thus
$$
\begin{array}{l}
E M=\frac{1}{2} B F=\frac{1}{2} F C=M D=\frac{3}{2}, \\
A M=\frac{1}{2} A F=\frac{3}{2} G F, \\
M G=A M-G F=\frac{1}{2} G F .
\end{array}
$$

Therefore, $A M=3 M G$.
By the intersecting chords theorem, we have $A M \cdot M G=E M \cdot M D$.
Thus $3 M G \cdot M G=\left(\frac{3}{2}\right)^{2}$
$$
\begin{array}{c}
\Rightarrow M G=\frac{\sqrt{3}}{2} \Rightarrow A M=\frac{3 \sqrt{3}}{2} \\
\Rightarrow A G=A M+M G=2 \sqrt{3} .
\end{array}
$$