4. As shown in Figure 3, in $\triangle A B C$, $M$ is the midpoint of side $B C$, and $M D \perp A B, M E \perp A C$, with $D$ and $E$ being the feet of the perpendiculars. If $B D=2, C E=1$, and $D E \parallel B C$, then $D M^{2}$ equals $\qquad$
4.I.

Let $D M=x, M E=y, A D=z, A E=w$.
Since $D E / / B C$, we have $\frac{z}{2}=\frac{w}{1}$, i.e., $z=2 w$.
Because $B M=M C$, we have $S_{\triangle A K M}=S_{\triangle A M}$, i.e., $\frac{1}{2} x(z+2)=\frac{1}{2} y(w+1)$.
Thus, $2 x+x z=y+y w$.
By the Pythagorean theorem, we get
$$
\left\{\begin{array}{l}
2^{2}+x^{2}=B M^{2}=M C^{2}=1^{2}+y^{2}, \\
x^{2}+z^{2}=A M^{2}=y^{2}+w^{2},
\end{array}\right.
$$

i.e., $\left\{\begin{array}{l}x^{2}+3=y^{2}, \\ x^{2}+z^{2}=y^{2}+w^{2}\end{array}\right.$
Subtracting (2) from (3) gives $z^{2}-3=w^{2}$.
Substituting $z=2 w$ into the above equation yields $4 w^{2}=3+w^{2}$.
Thus, $w=1, z=2$.
Substituting them into equation (1) gives $y=2 x$.
Then, from equation (2), we get $x^{2}=1$, i.e., $D M^{2}=1$.
Note: We find $A B=4, A C=2, B C=2 \sqrt{5}, B C$ is the longest side, so $\angle B, \angle C$ are acute angles, and points $D, E$ are indeed on the sides.