Project case study / AdMind
Giving ad decisions reasons and boundaries
A video-advertising prototype that combines model evidence, player events and explicit rules to choose when, where—or whether—an ad may appear.

- My contribution
- Personal project · Product prototype, decision engine and player integration
- Project period
- 2026
- Scope
- Public prototype
From evidence to an explainable action
- Collect video and player evidence
- Validate the request and context
- Reject ineligible plans
- Rank eligible plans and positions
- Execute, defer or block with reasons
Start with the viewing situation
A scheduled break can interrupt a climax. A pause overlay can cover the object someone stopped to inspect. Rescue or medical footage can make an otherwise valuable opportunity inappropriate. AdMind explores these situations through three scenarios: timing around narrative peaks, protecting a paused frame and blocking advertising in protected contexts.
The outcome is an execution plan with a time, format and position, or a reason to defer or block it. The interface exposes the evidence and trade-offs behind that result.
Connect the demonstration to the engine
My project work brings together a React and TypeScript video experience, a typed decision engine, a schema-validated video-analysis boundary and browser-side pause-frame analysis. The product UI and API adapters share the decision layer. This makes the explanation traceable to the same logic that generates the result.
TwelveLabs supplies time-coded model evidence; MediaPipe supplies browser-side visual analysis. AdMind's own rules decide what those signals permit. The public narrative examples use cached analysis, so visitors need no API key. The frequency-cap example below goes one step smaller: it uses the repository's fixed request fixture and calls no model.
Apply hard rules before ranking
Consider the S1 fixture: one guaranteed campaign has three creative variants and two possible times, 45 and 82 seconds. These form six candidate plans. With the original frequency count of one against a cap of three, the engine selects a six-second muted card at 82 seconds. What should happen when the same viewer's supplied count has already reached three?
The AdMind strategy checks hard constraints before calculating scores. Changing only frequencyCount from one to three rejects all six plans. Moving the ad to a quieter moment or offering a different format cannot repair a frequency violation; a higher bid cannot put a rejected plan back into ranking. The result carries blocked, no selected plan and a delivery-shortfall flag.
This choice leaves the commercial goal unmet in this decision. Keeping the shortfall explicit gives the caller a result it can handle, rather than silently weakening the cap. Audit entries retain FREQUENCY_CAP for each rejected candidate and finish with NO_ELIGIBLE_PLAN, making the reason inspectable without a model explanation.
One changed count, no eligible plan
Start with createS1Request("admind") and set frequencyCount to frequencyCap. These are request and response excerpts; omitted fields come from the full S1 fixture, so the input below is not a standalone API request.
Request excerpt · count reaches cap
{
"strategy": "admind",
"policy": {
"frequencyCount": 3,
"frequencyCap": 3
}
}Observed local response · excerpt
{
"outcome": "blocked",
"selected": null,
"rejectedCount": 6,
"commercialShortfall": true
}Observed locally on 30 November 2026 at commit 2db56a5; the unchanged engine suite also passed all 13 tests. This deterministic fixture check made no model request and delivered no ad.
Allow the answer to be no placement
During a stable pause, MediaPipe analyzes the frame locally. The placement scorer compares four corners against visual targets and reserved subtitle and control areas. It can reject every corner; unavailable visual evidence also returns no placement. These branches make uncertainty part of the execution behavior.
There is also a timing problem: browser inference may finish after playback resumes and cannot simply be canceled once started. Each pause attempt receives a session token. Completing an invalidated or older token returns false; a valid result can be consumed only once. This separates the lifetime of an expensive calculation from the lifetime of the decision it was meant to support.
Separate rule checks from model quality
On 30 November 2026, the repository's unchanged decision-engine test file was run in an isolated local copy: all 13 tests passed, including the frequency-cap check. A separate observation of the S1 fixture recorded the before-and-after responses above. At the cap, it returned six rejected candidates and no ranking audit entry. This checks the implementation with known inputs, not whether a model can discover a safe moment in unfamiliar video.
Other checked-in tests specify pause placement, unavailable-evidence behavior and stale-token rejection; those checks were not rerun for this example. Visual evaluation is also separate: the documented frame set still includes agent-drafted labels and unresolved product review. Neither this rule check nor the landing-page screenshot establishes ad delivery, detection accuracy, revenue or viewer retention.
Keep the prototype's scope explicit
The example exercises strategy=admind and trusts the frequency count supplied in the request. It does not check how real impressions are counted or synchronized across devices; the baseline comparison follows a separate path. AdMind remains a prototype on a limited media set, with session-local deferral and uncalibrated risk weights. Reliable impression accounting, reviewed visual labels and durable campaign orchestration each need their own evidence before production use.