4. If the cotangents of the three interior angles $A, B, C$ of triangle $\triangle A B C$, $\cot A, \cot B, \cot C$, form an arithmetic sequence, then the maximum value of angle $B$ is $\qquad$ .
$$
\begin{array}{l}
2 \cot B=\cot A+\cot C=\frac{\cos A}{\sin A}+\frac{\cos C}{\sin C} \Rightarrow \frac{2 \cos B}{\sin B}=\frac{\sin B}{\sin A \sin C} \\
\Rightarrow b^{2}=2 a c \cos B=a^{2}+c^{2}-b^{2} \Rightarrow b^{2}=\frac{1}{2}\left(a^{2}+c^{2}\right) .
\end{array}
$$

Thus, $\cos B=\frac{a^{2}+c^{2}-b^{2}}{2 a c}=\frac{\frac{1}{2}\left(a^{2}+c^{2}\right)}{2 a c} \geqslant \frac{1}{2} \Rightarrow 0<B \leqslant \frac{\pi}{3}$, equality holds when $\triangle A B C$ is an equilateral triangle. Therefore, the maximum value of angle $B$ is $\frac{\pi}{3}$.