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)$, both satisfy $\overrightarrow{O A} \cdot \overrightarrow{O B} \leqslant 1$. Then the maximum value of $a+b$ is $\qquad$
2. 2 .

From the problem, we know that for any $A(x, y) \in D$, we have $a x+b y \leqslant 1$.
By taking
$$
(x, y)=(1,0),(0,1),(-1,-1) \text {, }
$$

we get that the fixed point $B(a, b)$ satisfies the necessary conditions
$$
\left\{\begin{array}{l}
a \leqslant 1, \\
b \leqslant 1, \\
a+b \geqslant-1
\end{array} \quad \Rightarrow a+b \leqslant 2\right. \text {. }
$$

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 {. }
$$

When $(x, y)=\left(\frac{1}{2}, \frac{1}{2}\right)$, the equality holds.
Thus, the point $B(1,1)$ satisfies the conditions of the problem, and in this case, $a+b=2$.
Therefore, $(a+b)_{\max }=2$.