2. For any point $A(x, y)$ in the plane region $D$:
$$
\left\{\begin{array}{l}
x+y \leqslant 1, \\
2 x-y \geqslant-1, \\
x-2 y \leqslant 1
\end{array}\right.
$$

and a fixed point $B(a, b)$ satisfying $\overrightarrow{O A} \cdot \overrightarrow{O B} \leqslant 1$. Then the maximum value of $a+b$ is $\qquad$
2. 2 .

According to the problem, for any $(x, y) \in D$, we have $a x+b y \leqslant 1$.
By taking $(x, y)=(1,0),(0,1)$, we get the fixed point $B(a, b)$ satisfying the necessary conditions $\left\{\begin{array}{l}a \leqslant 1, \\ b \leqslant 1,\end{array}\right.$, which implies $a+b \leqslant 2$.
Thus, $(a+b)_{\text {max }} \leqslant 2$.
For the fixed point $B(1,1)$, for any $A(x, y) \in D$, we have
$$
\overrightarrow{O A} \cdot \overrightarrow{O B}=(1,1) \cdot(x, y)=x+y \leqslant 1 \text {, }
$$

with equality holding at point $A\left(\frac{1}{2}, \frac{1}{2}\right)$.
Therefore, the point $B(1,1)$ satisfies the problem's conditions, and in this case, $a+b=2$.
Hence, $(a+b)_{\text {max }}=2$.