Thompson sampling

Shipped
alias bandit

Bayesian bandit balancing exploration and exploitation.

Example

How Thompson sampling decides — the pool is evaluated and the winner is assigned. Each strategy selects differently.

type == "lead"selectedTriggerNew LeadWebhookExploreThompson samplingStrategyae-westμ 0.72ae-eastμ 0.61 · explorecentralμ 0.55Assigned
Show the code
// Thompson sampling selects from the pool and assigns.
engine.Route(ductor.Route{
Match: `routable.type == "lead"`,
Strategy: "thompson_sampling",
Pool: "sales-team",
})
 
// Durable, observable, exactly-once.
decision, err := engine.Dispatch(ctx, routable)

How it works

A multi-armed bandit that samples per-arm posteriors to balance exploring uncertain recipients against exploiting known winners. Optional module; durable posteriors land with the strategy state plane.

ExplainableStateful