4. In Rt $\triangle A B C$, $\angle A=30^{\circ}, \angle C=$ $90^{\circ}$, equilateral triangles $\triangle A B D$ and $\triangle A C E$ are constructed outward from $A B$ and $A C$ respectively, and $D E$ is connected, intersecting $A C$ and $A B$ at points $F$ and $G$. Then the value of $\frac{A F}{A G}$ is ( ).
(A) $\frac{2 \sqrt{3}}{7}$
(B) $\frac{3 \sqrt{3}}{7}$
(C) $\frac{4 \sqrt{3}}{7}$
(D) $\frac{5 \sqrt{3}}{7}$
4.C.

As shown in Figure 3, draw $E M \perp A C$ at $M$, extend $E M$ to intersect $A B$ at $N$, and connect $D N$. Then $M$ is the midpoint of $A C$, and $M N \parallel C B$. Therefore, $N$ is the midpoint of $A B$. Thus, $D N \perp A B$.
Also, $\angle E A N = \angle D A M = 60^{\circ} + 30^{\circ} = 90^{\circ}$, which gives $A E \parallel D N, A D \parallel E N$.
Therefore, quadrilateral $A D N E$ is a parallelogram.
Hence, $A G = \frac{1}{2} A N = \frac{1}{4} A B$.
Let $B C = a$. Then
$A D = A B = 2 a, A E = A C = \sqrt{3} a, A G = \frac{1}{2} a$.
In the right triangle $\triangle A E M$,
$A M = \frac{1}{2} A C = \frac{\sqrt{3}}{2} a, E M = \frac{3}{2} a$.
Since $A D \parallel E M$, we have $\triangle A F D \sim \triangle M F E$.
Thus, $\frac{A F}{F M} = \frac{A D}{E M}$, which means $\frac{A F}{A M} \approx \frac{A D}{E M + A D}$.
Therefore, $A F = \frac{A D \cdot A M}{E M + A D} = \frac{2 \sqrt{3}}{7} a$.
Hence, $\frac{A F}{A G} = \frac{4 \sqrt{3}}{7}$.