Skip to contents

bayesgrove is an R package for recording Bayesian model reviews alongside the analysis. It runs models with cmdstanr or brms, collects diagnostics, and can block downstream computation until you record a review with a rationale. Branches keep alternative models and their decisions in the same project.

Fit a model
  └─ Diagnostics raise a blocking review
       ├─ Downstream computation waits
       └─ You review the evidence and record a decision
            └─ Resolve the review, then continue or branch to a revised model

Results are cached. Reports contain the graph, decisions, and artifact index. Review rules are opt-in: enable a workflow pack to choose which checks apply.

Install

# install.packages("pak")
pak::pkg_install("sims1253/bayesgrove")

Model fitting also requires cmdstanr with CmdStan, or brms.

Start here

Follow the getting-started tutorial: fit a model, inspect a failed predictive check, record a review, and try a revised model. The example Stan programs ship with the package.

For the experimental search interface, see the recorded model search tutorial. It records P/A/D revisions, evidence, comparisons across lineages, and decisions, with Record, Guide, or Enforce intervention. R users, agents, and Glade can use the same research operations; the interface does not require a UI.

For an interactive session, bg_repl(handle) shows pending reviews and suggested actions for an existing project.

To learn about… Read
Nodes, reviews, decisions, and execution holds Concepts
Divergences and reparameterization Eight schools
Comparing models and accepting or rejecting branches Roaches case study
Review packs and custom executors Extensions

Browse all guides for simulation studies, teaching, and sharing project bundles, or use the function reference. Run bg_api_boundary() to check which functions are stable or experimental.

Background

bayesgrove encodes the Bayesian workflow as software, following the workflow paper (Gelman et al., 2020) and the Bayesian Workflow book (Gelman, Vehtari, McElreath, et al., 2026). It is a guide for people learning the workflow and a constrained environment for experienced analysts and agents. Its research-search vocabulary, which describes a model as a joint distribution (P), posterior approximator (A), and training data (D) judged by goal-dependent utilities, comes from the Bayesian model taxonomy of Bürkner, Scholz, and Radev (2023). Simulation-based calibration checks follow the original method (Talts et al., 2018).

The graph engine is dagriculture. Glade is an experimental interface built on the same R API.

Use citation("bayesgrove") for citations.