5. Let the complex numbers $z, -z, z^{2}-z+1, z^{2}+z+1$ correspond to points $A, B, C, D$ in the complex plane, respectively. Given that $|z|=2$, quadrilateral $ABCD$ is a rhombus, and such $z=a+b \mathrm{i}$ (where $\mathrm{i}$ is the imaginary unit, $a, b \in \mathbf{R}$), then $|a|+|b|=$ $\qquad$ (Fu Lexin, problem contributor)
5. $\frac{\sqrt{7}+3}{2}$.

As shown in Figure 3, by symmetry, it is easy to see that segment $AB$ is the diameter of the circle $|z|=2$ in the complex plane. Let the diagonals $AC$ and $BD$ of the rhombus intersect at point $E$, then $AC \perp BD$, so point $E$ is also on the circle $|z|=2$. Since $E$ is the midpoint of $AC$, the complex number corresponding to point $E$ is $\frac{z+z^{2}-z+1}{2}=\frac{z^{2}+1}{2}$, hence $\left|\frac{z^{2}+1}{2}\right|=2$, which means $\left|z^{2}+1\right|=4$.

Given $|z|=2$, we know $\left|z^{2}\right|=4$, so $z^{2}$ corresponds to a point on the circle $|w+1|=4$ and $|w|=4$. As shown in Figure 4, it is easy to see that $z^{2}=4(\cos \theta \pm \mathrm{i} \sin \theta)$, where $\cos \theta=-\frac{1}{8}$. Also,
$$
\left|\cos \frac{\theta}{2}\right|=\sqrt{\frac{1+\cos \theta}{2}}=\frac{\sqrt{7}}{4}, \quad\left|\sin \frac{\theta}{2}\right|=\sqrt{1-\cos ^{2} \frac{\theta}{2}}=\frac{3}{4} .
$$

Combining $z=2\left(\cos \frac{\theta}{2}+\mathrm{i} \sin \frac{\theta}{2}\right)$, we have
$$
|a|+|b|=2\left(\left|\cos \frac{\theta}{2}\right|+\left|\sin \frac{\theta}{2}\right|\right)=\frac{\sqrt{7}+3}{2} .
$$