4. Given a regular quadrilateral pyramid $\Gamma$ with a height of 3, and the angle between the side face and the base is $\frac{\pi}{3}$. First, place an inscribed sphere $O_{1}$ inside $\Gamma$, then sequentially place spheres $O_{2}, O_{3}, O_{4}, \cdots$, such that each subsequent sphere is tangent to the previous sphere and the four side faces of $\Gamma$. The sum of the volumes of all the spheres placed is $\qquad$.
As shown in the figure, construct the axial section $P E_{1} F_{1}$ of the regular quadrilateral pyramid. According to the problem, $\triangle P E_{1} F_{1}$ is an equilateral triangle. Knowing that the height of the regular quadrilateral pyramid is 3, the radius $r_{1}=1$ of the inscribed sphere $O_{1}$, thus $\frac{P M}{P O}=\frac{1}{3}$, meaning the similarity ratio of $\triangle P E_{1} F_{1}$ to $\triangle P E_{2} F_{2}$ is $\frac{1}{3}$. Therefore, the radius $r_{2}=\frac{1}{3}$ of sphere $O_{2}$. The radii of the other spheres follow this pattern, so the total volume of all the spheres placed inside is
$$
V=\frac{4 \pi}{3} \cdot \frac{1}{1-\frac{1}{3^{3}}}=\frac{18 \pi}{13} .
$$