5. Given $I$ is the incenter of $\triangle A B C$, $A C=2, B C$ $=3, A B=4$. If $\overrightarrow{A I}=x \overrightarrow{A B}+y \overrightarrow{A C}$, then the value of $x+y$ is $(\quad)$.
(A) $\frac{1}{3}$
(B) $\frac{2}{3}$
(C) $\frac{4}{9}$
(D) $\frac{5}{9}$
5. B.

In $\triangle ABC$, $I$ is the incenter, and $AI$ is extended to intersect $BC$ at point $D$. Then the ratio in which $D$ divides $BC$ is
$$
\lambda=\frac{AB}{AC}=\frac{4}{2}=2.
$$

Thus, $\overrightarrow{AD}=\frac{1}{3} \overrightarrow{AB}+\frac{2}{3} \overrightarrow{AC}$.
Given $BC=3$, then $BD=2$, $DC=1$.
In $\triangle ABD$, the ratio in which $I$ divides $AD$ is
$$
\lambda'=\frac{AB}{BD}=\frac{4}{2}=2,
$$

which means $\overrightarrow{AI}=\frac{2}{3} \overrightarrow{AD}=\frac{2}{9} \overrightarrow{AB}+\frac{4}{9} \overrightarrow{AC}$.
Therefore, $x+y=\frac{2}{3}$.