A deterministic re-ranking layer that adapts recommendations to the moment (who's watching, time of day, parent-set intent), with every ranking explained.
Try the demo: https://intentengine.vercel.app/demo
Pick a moment and watch the same catalog re-rank live. Tap any title to see why it ranks where it does.
First commit: February 2026.
Prototype. Built to demonstrate systems thinking and backend architecture, not a production service.
As a parent, I spend real time every day filtering kids' content by hand, because streaming recommendations optimize for engagement rather than the intent I have in the moment ("it's time to wind down," "keep it calm"). My take as an engineer is that this belongs in a deterministic, explainable re-ranking layer instead of a model you can't inspect: the same context should always produce the same, traceable ordering, and every score should break down into signals a person can read. This repo is where I test that idea across more than one domain.
Interactive UI: intentengine.vercel.app
/demo: the multi-vertical re-ranking demo (5 verticals, tweakable signals, live scoring formula). This is the main thing to see.- Home: parent-intent wizard flow with kid browse, content detail, and PIN gate.
Also reachable at the original URL, dist-pied-one-60.vercel.app, which still works.
Problem: In my house, filtering kids' content by hand is a daily chore. Streaming recommendations optimize for engagement, not parental intent.
Solution: A re-ranking layer that sits between retrieval and presentation. Parents express context once ("it's time to wind down"), and the system adapts deterministically and explainably, with no ML required.
Key capabilities:
- Rules-first intent translation (keyword mapping, time-of-day inference)
- Soft-constraint re-ranking (intent re-orders without filtering), with hard gates as the exception: a maturity gate and a bedtime stimulation gate can block items before ranking
- Multiplier-based scoring with transparent formula display
- Prophecy Agent for time-aware scheduling (auto-switch to bedtime mode at 8 PM)
- Multi-vertical demo (Streaming, Music, E-Commerce, Ride Matching, Food Delivery)
- Structured explanations for every ranking decision
- Optional LLM fallback (off by default, env-var gated)
Python Backend: Fully implemented β 1,200+ passing tests (legacy ranking, V4 agentic planning/execution, and the Discover pilot).
Discover finds real things to do (events + places) and ranks them against your goal β faithfully: it never asserts what it can't verify (every attribute is VERIFIED / EXTRACTED / UNKNOWN), excludes items on verified hard constraints (e.g. an 18+ event when kids are in the party), shows unverifiable items as "needs verification" instead of fabricating, and grounds every explanation in evidence. Deterministic and reproducible. (Why abstaining is a feature: When AI Agents Cost More Than the Work They Automate.)
- Live demo API:
intent-engine-backend.vercel.appβ realistic fixture data, no API keys:curl -X POST https://intent-engine-backend.vercel.app/discover/search \ -H 'content-type: application/json' \ -d '{"query":"something educational for my kids","children_ages":[6]}'
- Run the full stack locally (no keys):
cd backend && DISCOVER_DEMO_MODE=1 python3 -m uvicorn intent_engine.api:app --reload, thencd frontend && npm run devβ openhttp://localhost:8080/discover. - Docs: why it matters Β· what's built Β· run / deploy Β· go-live with real data.
Note: The
/demoverticals run the deterministic ranking client-side (mock data). The newer Discover and V4 Agentic Mode flows call the real Python backend β Discover's live API is deployed above.
The /demo page is an interactive demo showing the engine's re-ranking behavior across platforms.
| Feature | Description |
|---|---|
| Platform Tabs | Switch between 5 verticals (Streaming, Music, E-Commerce, Ride Matching, Food Delivery), 8 items each. Streaming carries a PILOT badge in the UI |
| Context Presets | 4 presets per platform (e.g., Evening Wind-Down, Solo Morning, Family Weekend, Focus Session) |
| Signal Sliders | 5 tweakable signals: Time of Day, Viewer Profile, Energy Intent, Device, Learned Routine |
| Before / After | Side-by-side view showing engagement-only vs. intent-adjusted ranking |
| Scoring Formula | Live code-style display showing the multiplier breakdown for any item |
| Stimulation Index | Scores pacing (cuts/min), loudness (LUFS), and motion per title. Values in the demo are estimated. During a wind-down, a hard gate holds back over-stimulating titles even when the age rating is fine. |
| Prophecy Agent | Mock scheduling indicator with countdown timer |
Honest status per vertical. Functional means it has a real catalog, 4 context presets, and 5 signal sliders that drive deterministic client-side scoring. All five verticals are functional in the demo; none are UI-only shells or placeholders. None are wired to the Python backend (the demo scores client-side). The backend v3 domain engine now ships an adapter for all five.
| Vertical | Demo UI | Backend adapter |
|---|---|---|
Streaming (PILOT) |
Functional (client-side) | β
adapters/streaming.py |
| Music | Functional (client-side) | β
adapters/music.py |
| E-Commerce | Functional (client-side) | β
adapters/ecommerce.py |
| Ride Matching | Functional (client-side) | β
adapters/ride_matching.py |
| Food Delivery | Functional (client-side) | β
adapters/food_delivery.py |
No vertical is UI-only or a placeholder. The frontend demo still scores client-side; the backend adapters are exercised by the API and the test suite.
The demo uses a multiplier-based scoring formula:
final_score = base_engagement_score
Γ time_multiplier // time-of-day β calm/active preference
Γ viewer_multiplier // kids/family/adult content matching
Γ energy_multiplier // energy intent alignment
Γ device_multiplier // runtime fit for device size
Γ prophecy_boost // scheduled preference amplification
+ diversity_penalty // penalizes genre repetition
// Hard constraint
if (maturity === "adult" && viewer === "kids") β BLOCKED (score = 0)
| Screen | Description |
|---|---|
![]() |
Multi-platform demo with signal sliders and before/after ranking |
![]() |
Live multiplier breakdown for a selected item |
![]() |
Music platform with wind-down context |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INTENT ENGINE ARCHITECTURE β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββ
β USER / PARENT UI β
β Intent Setup Β· Kid Browse Β· Demo β
βββββββββββββββββ¬ββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββββ
β CONTEXT SIGNALS β
β Time Β· Viewer Β· Energy Β· Device β
βββββββββββββββββ¬ββββββββββββββββββ
β
βββββββββββββββββββββββ΄βββββββββββββββββββββββ
β β
βββββββββββΌβββββββββββ ββββββββββββββΌββββββββββββ
β SIMPLE MODE β β ADVANCED MODE β
β β β β
β IntentTranslator β β IntentParser β
β (keyword mapping) β β (text classification) β
β β β β β β
β IntentRanker β β RankingEngine β
β (soft constraints) β β (multi-factor) β
βββββββββββ¬βββββββββββ ββββββββββββββ¬ββββββββββββ
β β
βββββββββββββββββββββββ¬βββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββββ
β MULTIPLIER SCORING LAYER β
β β
β base Γ time Γ viewer Γ energy β
β Γ device Γ prophecy + diversity β
β β
β Hard constraints: maturity gates β
βββββββββββββββββ¬ββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββββ
β PROPHECY AGENT β
β Time-aware intent scheduling β
β Auto-switch Β· Shift prediction β
βββββββββββββββββ¬ββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββββ
β RANKED OUTPUT β
β Items + scores + explanations β
β + latency breakdown β
βββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Demo.tsx (page) β
β State: activePlatform Β· activeContext Β· signalOverrides β
β useMemo: rankWithSignals(catalog, signals) β rankedItems β
ββββββββββββ¬βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββ€
β LEFT β CENTER β RIGHT β
β β β β
β Context β βββββββββββ ββββββββββββββ β Signal Sliders β
β Switcher β β Before β β After β β (5 signals, 0-1) β
β (verticalβ β column β β column β β β
β 4 cards)β β(engage- β β (intent- β β Scoring Formula β
β β β ment) β β adjusted) β β (live multiplier β
β Prophecy β βββββββββββ ββββββββββββββ β breakdown) β
β Agent β β β
ββββββββββββ΄βββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββ
β² PlatformTabs (Streaming Β· Music Β· E-Commerce Β· Ride Matching Β· Food Delivery)
intent-engine/
βββ backend/ # Python backend (FastAPI + ranking engine)
β βββ intent_engine/
β β βββ schemas.py # Pydantic models (Intent, Item, RankedItem, etc.)
β β βββ rules_translator.py # Rules-first intent translator
β β βββ simple_ranker.py # Soft-constraint re-ranker
β β βββ intent_parser.py # Free-text intent classifier
β β βββ ranking_engine.py # Multi-factor ranker with diversity
β β βββ prophecy_agent.py # Time-aware intent scheduling
β β βββ llm_adapter.py # Optional LLM adapter (OFF by default)
β β βββ api.py # FastAPI REST API
β β βββ core/ # v3 domain engine (adapter_protocol, domain_engine)
β β βββ adapters/ # Domain adapters: streaming, ride_matching, food_delivery, music, ecommerce
β βββ tests/ # 274 tests, all passing
β βββ scripts/ # Demo scripts
β βββ demo_prophecy.py # Prophecy Agent demo
βββ frontend/ # React UI prototype
β βββ src/
β β βββ pages/
β β β βββ Demo.tsx # Interactive re-ranking demo page
β β βββ components/demo/
β β β βββ PlatformTabs.tsx # 5 vertical tabs (Streaming PILOT / Music / E-Commerce / Ride / Food)
β β β βββ ContextSwitcher.tsx # Vertical context preset selector
β β β βββ SignalSliders.tsx # 5 tweakable signal weight sliders
β β β βββ ScoringFormula.tsx # Live multiplier formula display
β β β βββ ProphecyAgent.tsx # Scheduling indicator with countdown
β β β βββ ContentCard.tsx # Item card with score badge + hover
β β βββ data/
β β βββ demoPlatforms.ts # 5 catalogs + signal configs + ranking
β β βββ demoContent.ts # Legacy streaming-only data
β βββ package.json
βββ docs/
β βββ screenshots/ # UI screenshots for documentation
βββ README.md # This file
cd backend
pip install -r requirements.txt
# Run tests
pytest tests/ -v
# Start API server
uvicorn intent_engine.api:app --reload
# Run demos
python -m scripts.demo_runner
python demo_prophecy.pycd frontend
npm install
npm run devOpens on http://localhost:5173. Visit /demo for the interactive re-ranking demo.
The /rank endpoint accepts a mode field:
| Mode | Pipeline | Use Case |
|---|---|---|
simple |
IntentTranslator + IntentRanker | Lightweight keyword/preference matching |
advanced (default) |
IntentParser + RankingEngine | Multi-factor scoring with diversity guardrails |
Time-aware intent scheduling that predicts and automates intent shifts:
from intent_engine.prophecy_agent import ProphecyAgent, IntentSchedule, TimeContext
from datetime import datetime, time
agent = ProphecyAgent()
agent.add_schedule(IntentSchedule(
time_context=TimeContext.BEDTIME,
start_time=time(20, 0),
end_time=time(22, 0),
intent_template={"energyLevel": 15, "tone": "soothing"},
))
# 15 minutes before bedtime, get a proactive suggestion
suggestion = agent.should_suggest_intent_shift(datetime(2026, 2, 20, 19, 50))Problem: Filtering kids' content by hand is a daily chore, and it starts over every session.
Solution: Set intent once, and it auto-switches on schedule.
- Determinism: same input, same output, every time
- Soft constraints: intent re-ranks without filtering; the exception is hard gates (maturity, bedtime stimulation), which block before ranking
- Explainability: every score has a human-readable reason
- Rules first: no LLM dependency; the LLM is optional and off by default
- Safe defaults: unknown input degrades gracefully to base-score ordering
- Safety first: hard constraints (age ratings) apply before any ranking logic
Intent Setup. The parent sets context once: time of day (auto-detected), energy level, and age range. No configuration fatigue; the system infers sensible defaults, and the parent only overrides what matters. This is the entry point for setting context once.
Curated Home. Content rows are re-ranked by the intent engine. "Top picks for your kids" reflects the active intent, not pure engagement scores. The parent sees rows that match their stated context, with energy and age badges on every card.
Kid Browse. The child's view is a Netflix-style hero and category-row layout. Content is pre-filtered and ranked by the intent layer before the child ever sees it. Categories like "STEM Adventures," "Calm & Bedtime Stories," and "Feelings & Empathy" are weighted by the parent's intent, not hard-coded.
Content Detail. Every recommendation is explainable. The "Why we picked this" panel surfaces the ranking rationale: age-appropriate science concepts, encourages curiosity, promotes critical thinking. Parents can see why something was chosen instead of trusting a black box.
PIN Gate. Parent controls sit behind a 4-digit PIN, keeping the child's experience uninterrupted. A familiar pattern: no friction for parents, no access for kids.
Parent Controls. Fine-grained preferences: prioritize educational content, lower-stimulation mode, weekly rotation. Session settings include viewing time limits and "end on a calm note," where the system suggests calming content as the timer winds down. The Trust & Safety card covers the basics: no ads, no autoplay escalation, content reviewed for age-appropriateness.
Re-Ranking Demo (Streaming / Evening Wind-Down). A 41-title catalog ranked for 6:00 PM with a kids viewer profile and low energy. The top 9 are calm kids and family picks; titles over the maturity or stimulation gate sit in a held-back row. SpongeBob (TV-Y7) is held back on stimulation even though its rating is fine. Toggle to Engagement to see what an engagement-only feed would show, tap any title for its reason and meters, and open "Why this order?" for the signal sliders and scoring formula.
Scoring Formula. Every ranking decision breaks down into its parts. For Bluey S4: base(0.58) x time(0.91) x viewer(1.20) x energy(0.90) x device(1.10) x prophecy(1.32) = 0.83. Each multiplier maps to a single signal slider, so an engineer can trace any ranking anomaly back to the signal that caused it. That keeps debugging the ranking tractable.
Music Platform (Wind Down). The same engine works across verticals. In Music with a "Wind Down" context, Sleep Stories Podcast stays #1 (high calm score plus prophecy boost), but Morning Jazz moves up past Deep Focus, because the time multiplier favors familiar, relaxed content over pure ambient. The pipeline is platform-agnostic: swap the catalog and signal configs and keep the same scoring.
E-Commerce (Baby Shower Gifts). Intent-aware ranking also applies outside media. With viewer set to "kids" for a gift-buying context, Organic Baby Blanket and Kids Art Kit jump to the top. Noise-Canceling Headphones and Smart Watch Pro are BLOCKED as adult-maturity items gated by the viewer signal. Board Game Collection (family-friendly) gets a +4 boost. The same formula drives it: viewer(1.20) for kids items vs. viewer(0.00) for adult items.
Screenshots above cover Streaming, Music, and E-Commerce. The Ride Matching and Food Delivery verticals were added later and are best seen live in the demo.
- "The Value of Personalized Recommendations: Evidence from Netflix" (Zielnicki, Aridor et al., 2025) separates the exposure effect of recommendations (what gets surfaced) from the targeting effect (who gets what). Intent Engine's multiplier panel (
base Γ time Γ viewer Γ energy Γ device Γ prophecy) makes that split visible in the UI: exposure lives in thebaseengagement score, and targeting is the set of per-signal multipliers that reorder items on top of it. - "GenPage: Towards End-to-End Generative Homepage Construction at Netflix" (Netflix Technology Blog, 2026) assembles the homepage with a learned generative model. Intent Engine takes the opposite approach: deterministic and explainable rather than generative, where the same context always produces the same, traceable ordering.
- Honest limitation: deterministic scoring gives no causal identification of targeting effects. Because every item is always scored and reordered, never randomly held out, the engine can show what the multipliers do but cannot measure their causal lift. That would require explicit exploration slots (randomized holdouts), which the engine does not currently have.
I used AI as a development accelerator β but the architecture is a series of judgment calls I had to make, and constraints I had to impose, before AI could execute them safely. The questions I had to answer (Should an LLM ever pick the winner? How do you stay honest when data is missing? Is "over-stimulating" the same as "adult"?) and the decisions I landed on are documented as a short ADR-style log:
β Design decisions
The through-line: I set the intent and the constraints; AI accelerated the execution. The way I built it mirrors what it does β human intent and policy in front, deterministic and auditable execution behind.
Built by Jeremiah Walters (GitHub). Exploring how thoughtful systems design can make streaming better for families.
MIT