AI agent audit prototype · Built on Stockurai

Daily allocation of constrained product across channels

Prepared for Jane Doe · Specialty pharmaceuticals · December 3, 2026

Sample data for illustration.
DecisionHow to split limited product across specialty pharmacies and distributors each day
OptionsAllocate · Hold · Reallocate
Data sourcesSpecialty pharmacy dispense data, 852 inventory by channel, Order system and production plan
PolicyExisting patients first, within the written fair-allocation policy
Deploying an AI agent for a decision like this? Request a formal proposal, or describe the agent’s decision to create a custom AI agent audit prototype.
STEP 01

Targets

Targets are what the system watches. Here, they are the specialty pharmacies and distributors being supplied, with days on hand, open orders and existing patients on therapy.
TargetDays on handOpen orderExisting patientsStatus
Pharmacy A (Northeast)5.2 days1,200 units840Active
Pharmacy B (Southeast)9.8 days900 units610Active
Distributor C (National)14.5 days3,000 unitsn/aWatching
Pharmacy D (Midwest)7.1 days700 units420Active
STEP 02

Target detail

Where the feeds meet: the outside world (pharmacy dispense and patient starts by region) and the organization's own records (852 inventory, open orders, production forecast). Every signal is weighed against both.

Pharmacy A dispense and stock (7 days)

DateDispensedOn handDays on handNew starts
Nov 203101,6105.214
Nov 192951,7805.912
Nov 183051,9506.415
Nov 172882,1207.211
Nov 163002,3307.813
Nov 132922,5008.610
Nov 122842,6909.412

Supply and policy position

Existing patients840 on therapy, served first
Open order1,200 units, 2 days late
Last quarter's share620 units would be allocated
Safety stock7 days on hand
Feeds
DispenseDispenses and patient starts by region · Daily
ChannelOn-hand stock at pharmacies and distributors · Daily
SupplyOpen orders and production forecast by lot · Daily
STEP 03

Alerts: what the system watches for

Alerts are code-free. Pick a field, an operator and a value. Each alert watches one thing, such as days on hand at a pharmacy or a late production lot, and fires when it happens.

Edit alert

Pharmacy A below 7 days on hand
Days on hand
Crossing below
Safety stock (7 days)
1 Day
PreviewDays on hand crossing below Safety stock (7 days)

Configured alerts

Days on hand under 7Channel
Dispense up 15% in 7 daysDispense
New starts above regional averageDispense
Open order past due dateSupply
Production lot delayedSupply
Channel stock above 21 daysChannel
STEP 04

Decision logic: alerts, conditions, plays and rules

Alerts evaluate data in real time. Conditions add triggered alerts up to a score, and plays organize the conditions. Rules turn a play’s score into a real-time recommendation on the live feed. The policy gate stops any allocation that puts new starts ahead of existing patients or breaks the written fair-allocation policy, however the score looks. Rules drive the recommendations, not AI.

Play: Allocate to channels at risk of stockout

+20Stockout risk
  • Days on hand under 7
  • Open order past due date
+15Existing patients at risk
  • Dispense up 15% in 7 days
+10New starts waiting
  • New starts above regional average
+5Supply is short
  • Production lot delayed

Rules

Score ≥ 35ALLOCATE
Score 15–34HOLD
Channel stock > 21 daysREALLOCATE

Policy gate

PriorityExisting patients before new starts
PolicyWritten fair-allocation policy
Max per allocation20% of available supply
ApprovalSupply allocation committee
STEP 05

Live feed

This is the screen the decision team watches. Each card is a recommendation on one channel partner, printed the moment its rule is met, with the score and time it fired.

Allocate (1)

Pharmacy A (Northeast)  5.2 days on hand · Score 50
Allocate 900 units; covers 840 existing patients first
11/20 07:30 AM

Reallocate (1)

Distributor C (National)  14.5 days · Score 25
Reallocate 600 units toward Pharmacy D (Midwest)
11/20 08:05 AM

Hold (1)

Pharmacy B (Southeast)  9.8 days on hand · Score 30
Stock adequate; recheck after Nov 26 lot arrives
11/20 07:45 AM
STEP 06

Audit trail: one recommendation, start to finish

Every recommendation is logged and traceable. Anyone can see which dispense and inventory data arrived, which conditions were met, who approved the allocation and how it compared with last quarter's share.
Pharmacy A (Northeast) — Audit trail

Data received

Channel feed1,610 units on hand, 5.2 days, 2026-11-20 06:00
Dispense feed310 dispensed, 14 new starts
Supply feed1,200 units open, 2 days late

Play evaluated → rule fired

✓ Stockout risk (+20)
✓ Existing patients at risk (+15)
✓ New starts waiting (+10)
✓ Supply is short (+5)
Score50 → ALLOCATE
Policy gatePassed: existing patients covered first, within 20% cap

Decision

ActionAllocated 900 units to Pharmacy A
Approved byAllocation committee, 07:52

Outcome

Last quarter's share would give620 units
Existing patients covered840 of 840
ResultNo existing-patient stockout at this site
STEP 07

Daily flags

A short daily list of things worth a look, separate from the live feed. Channels running low on days on hand, regions with surging new starts, and production forecast changes that shift what can ship.
ChannelPharmacy A at 5.2 days on hand
Below 7-day safety stock; 840 existing patients served
DispenseSoutheast new starts up 30% in 5 days
Usual weekly change is ±8%; check against policy
SupplyLot release moved from Nov 22 to Nov 26
Forecast supply down 4,000 units this week
ChannelDistributor C holds 14.5 days of stock
Well above peers; reallocation candidate
STEP 08

ROI scoring and baseline

The optimization engine scores every decision. Every recommendation is measured against allocating by last quarter's share of volume, and against the best split that could have been made once demand was known. The gap is the ROI you can measure.
TargetDecisionsExisting-patient fill rate %BaselineBest possibleCapturedResult vs baseline
Pharmacy A (Northeast)1897.491.299.178%+6.2 pts
Pharmacy B (Southeast)1496.893.598.961%+3.3 pts
Pharmacy D (Midwest)1295.992.098.263%+3.9 pts
Distributor C (National)1195.294.097.040%+1.2 pts

Baseline: Last quarter's share of volume. Best possible: Best split with hindsight. Sample figures; in a live installation, these come from the organization’s own decisions and data.

STEP 09

AI Agent Decision Data

The agent is one more feed. Stockurai doesn’t call or run the agent. It records every output and scores it against the rules, the decision makers and the outcome, in shadow: flags never block anything.
RecommendsAllocation agent

Reads dispense, channel and supply data each morning and recommends Allocate, Hold or Reallocate for each channel partner.

When it acts: Before the supply allocation committee meets; the committee decides.

Recommendation:AllocateHoldReallocate
Agrees with rules87%
Agrees with decision makers84%
Policy breaches flagged1
Disagreements graded8

Agent feed: sample records

TimeTargetRecommendationModelAgent’s reason
11/20 07:28 AMPharmacy A (Northeast)Allocatev1.45.2 days on hand; 840 existing patients
11/20 07:28 AMDistributor C (National)Reallocatev1.424 days of stock on hand
11/20 07:28 AMPharmacy D (Midwest)Holdv1.4Stock adequate until the next lot
11/19 07:30 AMPharmacy B (Southeast)Allocatev1.4Allocate 30% of supply to cover new starts

Policy breaches flagged

Pharmacy B (Southeast) · Allocate
Over 20% of supply, and new starts ahead of existing patients
11/19 07:30 AM · Flagged; committee allocated 20% to existing patients

Checked against the policy gate the moment each output arrives.

Agent's call against the rules' call, last 30 days

AgentAllocateHoldReallocate
Allocate1940
Hold2301
Reallocate013

Rows are the agent's call, columns the rules' call. The agent allocates earlier than the rules when a channel's stock is falling fast. Shaded cells are agreement.

Disagreements, graded on the outcome

TargetAgentRulesDecision makersWhat followedBetter call
Pharmacy B (Southeast)AllocateHoldHoldTwo existing patients missed fills that weekAgent
Pharmacy D (Midwest)AllocateHoldHoldStock lasted until the next lot arrivedRules

Drift

PeriodModelAgreement
Augv1.385%
Sepv1.386%
Octv1.4new88%
Novv1.487%

Steady since v1.4. A sudden drop would matter here, since allocation errors reach patients within days.

Where scoring is limited. Unfilled demand in a channel that received less product is estimated from its dispense history. The audit produces scoring and evidence; it doesn’t certify the agent.
STEP 10

Fit and next steps

What we’d check first

Why
  • Same daily decision, clear data feeds and a written policy to build rules around
  • Existing-patient fill rate gives a measurable way to judge each recommendation
To verify
  • How current 852 and dispense data are, and by channel
  • Compliance sign-off on rules matching the fair-allocation policy
  • Who must approve each recommendation
Extend with AI
  • Demand forecasts by region and rules for new product constraints

Next step: a formal proposal

ScopeThe decision, targets and data feeds
RulesRules and policy gate, written out
ROIHow ROI is measured against the current process
TermsSetup estimate, timeline and license terms
Where it runsThe organization’s own AWS account
Request a formal proposal Create a custom AI agent audit prototype

For IT and data teams: an AI data pipeline

Stockurai is licensed to researchers and institutions for real-time analysis of equity markets, with AI and machine learning built into the process. The same AI data pipeline can be built for this decision.

Design prototype prepared by Stockurai · Sample data for illustration only · stockurai.com