Solution (source code)

= Solution

Squared-error posterior risk is minimized by the posterior mean. Hence
$$
\boxed{\hat\theta_{\rm Bayes}=E[\theta\mid X]=\frac{m+1}{\lambda+X}.}
$$