How to/Data aggregation
PROCESS 01 / FROM REQUEST TO DATASET

How the data
gets to the writer.

Soccer, NFL, and NBA use one question-based pipeline. League settings choose the feeds. The answers become one saved dataset before the writer composes a screen.

SoccerNFLNBAInteractive system guide
01 / THE WHOLE REQUEST

Follow the data.

Step through the same request
Pipeline explorer Illustrative run
USER REQUEST

Show the latest Chelsea vs Arsenal match, Palmer's market value history, and Chelsea's injury news.

Planner↓
Planned questions3 questions
q1Chelsea vs Arsenal · latest meeting
q2Cole Palmer · market value history
q3Chelsea · latest injury context
Illustrative run. The provider setting changes soccer's structured feed.
02 / THE ROUTING DECISION

The league chooses the API layer.

The planner identifies the league for each question. Soccer can use ESPN and FotMob. Other supported leagues use ESPN.

Soccer feed provider
INPUTUser requestPlan the questions this screen needs to answer
For each question
DECISIONWhich league?
SoccerPremier League, LaLiga, and supported competitions
SOCCER API LAYER
ESPN

Tables, fixtures, results, and match data

Structured feed provider
FotMob

Player values, photos, and optional match ratings

Player data + enrichment
Other supported leaguesNFL · NBA
SHARED ESPN API LAYER
ESPN

Games, standings, box scores, rosters, injuries, and player statistics

Generic adapter · ESPN headshots

ESPN in both provider modes

Normalize feed results
SHARED OUTPUTAnswers by question IDanswers.q1 · answers.q2 · answers.q3
ANY LEAGUE · OUTSIDE FEED COVERAGE

The planner routes news, context, and uncovered facts to web research.

→
Parallel + readerCited answer in the same output
Feed coverage by question +
What the question needsWho answersWhat happens next
Structured soccerTables, fixtures, results, match reports, leaders, and recent scorers within supported competitionsESPNNormalized values enter collection. A match can receive optional FotMob ratings.
NFL and NBAGames, standings, leaders, team statistics, rosters, reported injuries, player statistics, and game logsESPNOne generic adapter reads both leagues. Headshots come from ESPN. FotMob is not used.
Soccer player market valuesA dedicated player question in either provider modeFotMobA prepared chart enters collection. Soccer identity and photo lookups also use FotMob.
Context and uncovered dataSoccer injuries, transfers, news, playoff champions, unsupported competitions, and facts beyond feed coverageParallel + readerSearch and page excerpts become a cited finding, then an answer record.
↳
Provider selection happens before the call.

A failed structured feed becomes unavailable. It does not switch providers or start a web search. Missing optional soccer ratings leave the base match intact.

What the source tag means +

The internal source: "espn" tag identifies a structured question. FotMob can answer it for soccer in fotmob mode. The snapshot source label is also coarse. Read each answer's source attribution to identify the provider.

Provider selection ↗Planning rules ↗
What the league registry controls +

LEAGUE_CONFIG supplies paths, supported feeds, season rules, default clocks, preferred statistics, research domains, and photo sources. The planner derives its league instructions from this configuration. Soccer keeps its existing presenter. NFL and NBA share espn-generic.ts.

LeagueESPN season yearDefault game clock
SoccerStart year. 2025 is 2025/26.Europe/London
NBAEnd year. 2026 is 2025-26.America/New_York
NFLSeason year. 2025 is 2025.America/New_York

The request's time zone sets the planner's date and game-card clock. Without it, the planner uses UTC and cards use the league default. Web research still uses the UTC date.

A domestic soccer table can name the league winner. NFL and NBA champions come from playoffs, so champion questions use web research. Knockout soccer cup winners also use the web.

League configuration ↗Planner date ↗
03 / INSIDE ONE WEB QUESTION

Search broadly. Read selectively.

Parallel Search + Extract

Each web question starts two searches together. Preferred domains follow the subject's league. NBA uses ESPN, NBA, and Basketball Reference. NFL uses ESPN, NFL, and Pro Football Reference. This example shows soccer.

q3 Chelsea injury contextOne web question
KEYWORD QUERIES PLANNED TOGETHER
Chelsea injury updateChelsea team news return
Same objective + same query bundle in both requests
2 concurrent Search calls
PREFERRED DOMAINS≤ 5 pages
Trusted football sources

ESPN, BBC, official leagues, established football data sites

OPEN WEB≤ 8 pages
Broader coverage

Useful pages beyond the preferred domains

Preferred first · deduplicate exact URLs
Readable search excerptsKeep useful pages from both groups
↳
Two searches. One question.

Both Search calls receive the same 2 or 3 keyword queries. Preferred results lead, exact duplicate URLs are removed, and readable pages form the evidence for the reader.

What multiple searches means here +

A normal sports web question makes two Search HTTP requests, each containing all of its 2 or 3 planned queries. Two web questions therefore normally make four Search requests, plus up to one Extract request per question. URL deduplication happens inside each question. The reader's structured-output retry can regenerate a finding, but it does not rerun the searches.

04 / THE DATA CONTRACT

Research ends. Composition begins.

All routes meet in one saved dataset. The writer uses that dataset to build a screen. It does not choose sources or gather facts during composition.

01

Shape collected answers

Opus selects, orders and derives values from eligible answers. Prepared market value charts and recent-scorer records pass through.

02

Validate and enrich

Repair small schema slips. Keep valid raw answers for rejected designs. Preserve ESPN headshots for NFL and NBA. Resolve soccer players with FotMob, fill team marks, and remove repeated facts.

03

Save, then write

Store the fields and values under the run ID. Emit the dataset before composition starts. The compiler gives the screen its dataset query.

sports_dataset · shape example
{
  values: {
    answers: { q1, q2, q3 },
    clubs: [...],
    players: [...]
  },
  fields: [...],
  asOf: "...",
  source: "mixed"
}

The snapshot holds prepared values. Team and player lists appear when available. Raw fallbacks have list limits.

How NFL and NBA records fit components +

The generic adapter reads box-score and game-log cells by position. NFL columns can repeat labels such as YDS for different statistics. RecordTable keeps at most 7 statistic columns. Match records keep scores by period. Season results fit FixturesHeatmap, and athlete careers fit ClubTimeline.

The designer receives contracts for the sports in the plan. These feed records remain eligible for model shaping. Only prepared soccer market value charts and recent scorers bypass that step.

Table columns ↗Design eligibility ↗
What a follow-up researches +

Kept questions retain their saved answers and screen parts. Only revised or added questions run through research and dataset preparation. Saved team lists keep their order so existing indexed references still identify the same team.

Follow-up reuse ↗
What checks the final screen? +

The compiler admits valid streamed statements, checks which questions their data references cover, and can request one repair round. It adds deterministic fallback parts for uncovered questions. An unavailable question must show its note. This is a presentation fallback after research, not another source lookup.

Compiler coverage and fallback ↗
05 / FAILURE AND RECOVERY

A gap stays visible.

Each stage has its own recovery rule. Dataset and composition recovery make no new source calls.

RESEARCH

One question fails

Keep the other answers. Mark the failed question unavailable with a note. An empty but valid feed can still be a complete answer.

ENRICHMENT

Ratings are missing

Keep the match. Optional FotMob ratings can be omitted without losing the base answer.

DATASET

A design has a mistake

Repair small slips in place. A failed design keeps that question's validated raw answer. If no returned design is usable, regenerate once. Invalid raw data makes the question unavailable.

COMPOSITION

A question is uncovered

Let the writer repair it, then use a deterministic fallback part if needed. The saved data remains available.

WHY THIS SHAPE

League rules change. The pipeline stays shared.

The registry comment puts league differences in configuration. The planner comment says routing text comes from that registry so a new league does not require another prompt. A new sport still needs response fixtures and behavior checks.

The dataset code states that a schema mistake should cost polish, not the screen. The research code says failed or uncited answers should report a gap instead of inventing data. Per-question routing lets one screen combine feed statistics and web context, and most failures stay with their own question.

The repository does not explain why mixed is the default or why the search limits have their exact values.

Registry intent ↗Generated routing rules ↗Dataset recovery intent ↗Research recovery intent ↗
Built from the local implementationunified-sports-aggregation · Source links point to main.Checks cover 8 soccer and 24 NFL/NBA feed cases with recorded responses and scripted model replies. They make no live provider calls.Evidence includes repository docs and git history. External discussions and telemetry were not consulted.
Open the Preview ↗