banditkeep

v0.1.0
io.github.CloudCorpRecords/banditkeep Checked 2 days ago Published 1 month ago

Decision memory for agents: bandit campaigns that learn which action works in which context.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_campaign

Create a new decision campaign. Accepts algorithm ("linucb" or "thompson_sampling"), alpha, and optional budgets for actions that cost something limited. Use Thompson Sampling for natural Bayesian exploration with no tuning needed.

ParameterTypeDescription
arms *arrayArray of string values for this parameter (optional).
campaign_id *stringIdentifier of the campaign.
algorithmstringAlgorithm to use.
alphanumberAlpha parameter for the algorithm.
budgetsarrayBudget allocation per arm.
decay_half_life_hoursnumberDecay half-life in hours.
feature_dimintegerFeature dimension size.
featuresarrayArray of string values for this parameter (optional).
metadataobjectMetadata for this call (optional).

list_campaigns

List all active campaigns (shows algorithm and alpha) — useful to check what exists before calling get_intuition.

campaign_diagnostics

Inspect per-arm learning state: theta_norm, prediction counts, reward rates, and entropy health. Use when a campaign doesn't seem to be learning or one arm is dominating.

ParameterTypeDescription
campaign_id *stringIdentifier of the campaign.

campaign_report

Business-level convergence report. Tells you whether the campaign has statistically converged and which arm is winning with confidence intervals.

ParameterTypeDescription
campaign_id *stringIdentifier of the campaign.

get_intuition

Ask BanditDB which arm to pick for a given context. Optional exclude_arms / eligible_arms narrow the choice for this request only. Returns the arm and an interaction_id to save.

ParameterTypeDescription
campaign_id *stringIdentifier of the campaign.
context *Context for the decision: an object of features or an array of values.
eligible_armsarrayArray of string values for this parameter (optional).
exclude_armsarrayArray of string values for this parameter (optional).

batch_get_intuition

Get decisions for multiple campaigns in a single round-trip. Pass a list of {campaign_id, context} dicts.

ParameterTypeDescription
predictions *arrayPredictions payload.

record_outcome

Report whether the chosen action succeeded (1.0) or failed (0.0). Updates the shared model.

ParameterTypeDescription
interaction_id *stringIdentifier of the interaction.
reward *numberReward value.

archive_campaign

Soft-delete a campaign. Pauses predictions/rewards but preserves all learned weights.

ParameterTypeDescription
campaign_id *stringIdentifier of the campaign.

restore_campaign

Restore an archived campaign to active status with all weights intact.

ParameterTypeDescription
campaign_id *stringIdentifier of the campaign.

campaign_budget

Budget spend per resource: consumed, remaining, utilization, shadow price, exhaustion.

ParameterTypeDescription
campaign_id *stringIdentifier of the campaign.

add_arm

Add an action to a live campaign, optionally warm-started from existing arms and with budget costs.

ParameterTypeDescription
arm_id *stringThe arm identifier for this call.
campaign_id *stringIdentifier of the campaign.
costsobjectCosts payload.
groupstringGroup identifier or name.
warm_startarrayArray of string values for this parameter (optional).

set_arm_status

Pause, retire, or reactivate an action. It keeps everything it learned.

ParameterTypeDescription
arm_id *stringThe arm identifier for this call.
campaign_id *stringIdentifier of the campaign.
status *stringStatus filter for this call.