5. The axial section $SAB$ of the circular cone is an equilateral triangle with a side length of 2, $O$ is the center of the base, $M$ is the midpoint of $SO$, and the moving point $P$ is within the base of the cone (including the circumference). If $AM \perp MP$, then the length of the trajectory formed by point $P$ is $\qquad$
5. $\frac{\sqrt{7}}{2}$.

Establish a rectangular coordinate system in space. Let
$$
\begin{array}{l}
A(0,-1,0), B(0,1,0), S(0,0, \sqrt{3}), \\
M\left(0,0, \frac{\sqrt{3}}{2}\right), P(x, y, 0) .
\end{array}
$$

Thus, $\overrightarrow{A M}=\left(0,1, \frac{\sqrt{3}}{2}\right), \overrightarrow{M P}=\left(x, y,-\frac{\sqrt{3}}{2}\right)$.
Since $A M \perp M P$, we have,
$$
\left(0,1, \frac{\sqrt{3}}{2}\right) \cdot\left(x, y,-\frac{\sqrt{3}}{2}\right)=0 \text {. }
$$

Therefore, $y=\frac{3}{4}$, which is the equation of the locus of point $P$, and its length within the circular base is
$$
2 \sqrt{1-\left(\frac{3}{4}\right)^{2}}=\frac{\sqrt{7}}{2} \text {. }
$$