7. If for any real number $x$, the function
$$
f(x)=x^{2}-2 x-|x-1-a|-|x-2|+4
$$

is always a non-negative real number, then the maximum value of the real number $a$ is
7. 1 .

From the conditions, we have $\left\{\begin{array}{l}f(0)=-|1+a|+2 \geqslant 0, \\ f(1)=-|a|+2 \geqslant 0 .\end{array}\right.$
Solving this, we get $-2 \leqslant a \leqslant 1$.
When $a=1$, we have
$$
f(x)=x^{2}-2 x-2|x-2|+4,
$$

which is $f(x)=\left\{\begin{array}{ll}x^{2}, & x \leqslant 2 ; \\ x^{2}-4 x+8, & x>2\end{array}\right.$.
It is easy to see that, for any real number $x$, the value of $f(x)$ is always a non-negative real number.
Therefore, $a=1$ meets the requirement.
Hence, the maximum value of the real number $a$ is 1.