2. Let $a, b \in \mathbb{R}^{+}, i^{2}=-1$, and there exists $z \in \mathbb{C}$, such that
$$
\left\{\begin{array}{l}
z+\bar{z}|z|=a+b i, \\
|z| \leqslant 1 .
\end{array}\right.
$$

Then the maximum value of $a b$ is
2. $\frac{1}{8}$.

Let $z=x+y i\left(x, y \in R, i^{2}=-1\right)$, substitute into the given equation and by the definition of equality of complex numbers we get
$$
\left\{\begin{array}{l}
a=x \cdot\left(1+\sqrt{x^{2}+y^{2}}\right), \\
b=y \cdot\left(1-\sqrt{x^{2}+y^{2}}\right) .
\end{array}\right.
$$

From $|z| \leqslant 1$ we get $0<x^{2}+y^{2}<1$, and $0<x, y$. From (1) and (2) we get $2 a b=2 x y\left(1-\left(x^{2}+y^{2}\right)\right) \leqslant\left(x^{2}+y^{2}\right)(1$ $\left.-x^{2}-y^{2}\right) \leqslant\left(\frac{x^{2}+y^{2}+1-x^{2}-y^{2}}{2}\right)^{2}=\frac{1}{4}$. Therefore, $a b \leqslant$ $\frac{1}{8}$. When $x=y$ and $x^{2}+y^{2}=1-x^{2}-y^{2}$, i.e., $x=y=\frac{1}{2}$, $a b=\frac{1}{8}$. Hence, the maximum value of $a b$ is $\frac{1}{8}$.