Abstract: Execution frameworks such as LangGraph represent agent workflows as deterministic control-flow graphs over language model calls and external tools. While this abstraction enables modular orchestration, routing decisions are typically fixed by explicit conditionals. Once a branch is taken, alternative execution paths are discarded unless manually reintroduced through handcrafted recovery logic.
We propose probabilistic and Bayesian extensions of LangGraph-style execution. In the probabilistic formulation, routing is defined as sampling from a state-dependent distribution over candidate nodes rather than selecting a single deterministic branch. Log-probabilities are computed from signals such as model confidence, evidence strength, or structured metadata, allowing uncertainty to be represented explicitly at the control layer. Deterministic routing arises as a degenerate zero-entropy special case.
In the Bayesian formulation, tool reliability is modeled using conjugate Beta priors updated from observed success indicators. Posterior expectations are incorporated into routing distributions, enabling adaptive reallocation of probability mass toward consistently reliable tools across sessions.
We provide a formal analysis establishing strict expressivity separation between deterministic and probabilistic routing, conditions under which stochastic routing improves expected correctness, and asymptotic optimality of posterior-mean-based tool selection. Controlled demonstrations illustrate recovery from suboptimal tool choices and evidence-dependent fallback behavior. The framework remains fully compatible with existing LangGraph infrastructure while extending it with principled stochastic and Bayesian control.
Loading