Course home →
NVIDIA · Securing Agents · reference

The materials catalog behind web_search

When an agent in this course calls the web_search tool you wire by hand in Module 1c, nothing ever leaves your browser. The tool ranks the course's own materials catalog, a fixed and fully inspectable corpus that ships inside the page itself. That catalog is organized into two tiers, and the sections below walk through the whole pipeline, from loading the catalog and running the agent's own ranking against it to seeing how the corpus is kept current and reading the ranking functions line by line.

How the catalog is split and served

The whole backend is one static file named assets/materials_index.json that holds entries in and splits them into cached and on-demand. Because it ships in the same bundle as the page the browser loads it same-origin with no key and no CORS. webSearch ranks both tiers together so that one query reaches a glossary definition and a paper abstract through a single shared surface.

Cached · the NVIDIA glossary

The 79-term glossary index ships in full, and seven of those terms also carry their complete vendored article alongside the definition. All of that text already travels with the page so the agent can quote it word for word inside the bundle without reaching across the network for a live connection. The index rarely changes. Nearly every search the agent runs still draws on it and so the copy riding along in the bundle earns its place in the cache many times over.

On-demand · papers and posts

Larger sources such as the arXiv abstracts and the posts from the NVIDIA developer blog ship instead as a catalog card that carries a title, a short blurb, and the source URL but leaves out the full text. The agent surfaces that card and follows the link out to the source whenever it needs more than the blurb offers. Because these entries are bulky and far less likely to be reused than a glossary definition the cache earns little by holding them and the agent fetches them fresh on demand.

Vendored sources become a static catalog, then an in-memory cache, then ranked results without a live network call.

How it stays current (and how you would fix it)

A vendored corpus drifts away from its sources over time unless something actively keeps it honest. That job belongs to a single script, scripts/materials/pull_materials.py, which is written so that any drift it finds is surfaced to everyone at once and described in exactly the same words.

The pull script fingerprints each source, and the same drift result appears in CLI, CI, and the validator screen.

The loop runs like this. A contributor (or the deploy build) runs the pull, and every source gets fingerprinted in _materials.json. Passing --check re-fetches each source and flags any drift or outage. That same status lands on the validation screen, reachable from the site's landing page or reproduced locally with python3 scripts/validation/validate_bundle.py, and it names the exact command to fix whatever broke. Nothing about the corpus is a moving target you have to trust.

Run the search the agent runs

The cell below shows the real pipeline behind one web_search call drawn as one node per step. Edit the query in the first node and hit Run all. The catalog loads from cache and every entry across both tiers gets scored together. The surviving top matches are then formatted into the exact text block the model reads back with each match's tier marked alongside it. The scoring node runs the same algorithm that helpers.webSearch uses. Change a weight and watch the ranking move.

Call the functions, edit and run

Two functions back the one tool contract. webSearch is the broad, ranked lookup over the whole catalog the agent grounds answers in; instantAnswer is the narrow one that returns a single glossary definition only when the query names a term. Both run key-less against the cached catalog: edit the queries below and Run, then open the helpers tab to read each function's real source, pulled live from _shared.js so it cannot drift from what runs.

Every material it can find ·

The list below is the full catalog that the ranking searches over. A cached entry carries its complete text inside the bundle and a deep glossary term brings its vendored article along too under mats/glossary_raw/, while an on_demand entry appears only as a card that links out to its source. Filter it to see what the agent could ground a claim in.

MaterialTierKindTagsBlurb