  We present a Bayesian graph neural network (BGNN) that can estimate the weak
lensing convergence ($\kappa$) from photometric measurements of galaxies along
a given line of sight. The method is of particular interest in strong
gravitational time delay cosmography (TDC), where characterizing the "external
convergence" ($\kappa_{\rm ext}$) from the lens environment and line of sight
is necessary for precise inference of the Hubble constant ($H_0$). Starting
from a large-scale simulation with a $\kappa$ resolution of $\sim$1$'$, we
introduce fluctuations on galaxy-galaxy lensing scales of $\sim$1$''$ and
extract random sightlines to train our BGNN. We then evaluate the model on test
sets with varying degrees of overlap with the training distribution. For each
test set of 1,000 sightlines, the BGNN infers the individual $\kappa$
posteriors, which we combine in a hierarchical Bayesian model to yield
constraints on the hyperparameters governing the population. For a test field
well sampled by the training set, the BGNN recovers the population mean of
$\kappa$ precisely and without bias, resulting in a contribution to the $H_0$
error budget well under 1\%. In the tails of the training set with sparse
samples, the BGNN, which can ingest all available information about each
sightline, extracts more $\kappa$ signal compared to a simplified version of
the traditional method based on matching galaxy number counts, which is limited
by sample variance. Our hierarchical inference pipeline using BGNNs promises to
improve the $\kappa_{\rm ext}$ characterization for precision TDC. The
implementation of our pipeline is available as a public Python package, Node to
Joy.
