Français

Context, reliability & provenance

Applied AI — Advanced Level · Session 8 · Yann Isola
Preparation Claude Certified Architect

Context Window Viewer

Simulate an agent investigation ComplianceScan turn after turn and watch the context window fill up. Then apply a management strategy — filtering tool results (PostToolUse hook), sliding window, summary, hybrid — and compare the consumed tokens and the saturation round. Reminder: the API is stateless — all context is returned (and charged) each round.

Settings

Fixed costs: system 3,200 tk · 12 tools 4,100 tk · output reserve 8,000 tk · lathe ~800 tk.

Context window — tower 0

System Def. tools Summary Historical Tool results Exit reserve
Current context
0
Filling
0 %
Cumulative entry charged
0
Saturation
Ready. Choose a strategy and run the simulation.

Strategy comparison table

StrategySaturation TowerFinal context (tk) Cumulative entry charged (tk)Loss of informationVerdict 150 laps
Click “Compare” to complete the table.
⚠ Window sizes are volatile and depend on the model: check the official Anthropic documentation. The educational point — saturation arithmetic and the gap between strategies — remains valid whatever the size.

Provenance Chain Builder

A ComplianceScan report states: “Customer profile C-4471 is high risk requiring manual review. » Trace the chain of provenance: from the final assertion to the primary sources, including tool calls and prompt version. Click on each link to inspect it — then play the role of auditor with the citation checker .

The channel — click to inspect

Link inspection

Select a link in the chain.

Citation checker (mock audit)

Each statement in the report carries a pointer call_id + record_id . The verifier resolves them against the audit log. One of the three quotes was hallucinated by the model — will you know which one before you run the check?

The two provenances — architect’s checklist

DimensionOrigin of data Origin of generator
Question“Where does this statement come from? »“What produced it?” »
Contenttool, call_id, record_id, source documentprompt version (hash), model id, temperature, timestamp
Verificationresolution of pointer against result raw in the newspapermanifest + full log (raw/ctx)
Trapplausible hallucinatory quote → obligatory mechanical verificationpromise bit-by-bit regeneration: outputs are “deterministic-ish”, the guarantee is the log

Cost Calculator — Message Batches API

Scale the nightly reprocessing of ComplianceScan: volume × model × cache → total cost, with and without the Batches API (asynchronous processing, 50% reduction ⚠, 24-hour SLA ⚠). The system prompt (compliance policy) is shared by all requests: it is the ideal candidate for the cache.

Settings

Result

Estimated total cost:
JobTokensEffective price ($/Mtk)Cost ($)
Click “Calculate”.

Comparison of the 4 configurations

ConfigurationCost ($)Economy vs synchronous

Architect reminders

  • custom_id — your only correlation key: the order of the results is not guaranteed. It also carries the idempotence of recovery and the audit chain.
  • ended ≠ everything was successful — break down query by query: succeeded / errored / canceled / expired . Retry of stranded items at your expense.
  • 24 hour ALS ⚠ — most batches finish in less than an hour, but the downstream architecture must tolerate the entire day. Anti-case: anything that has a human waiting.
  • Batch + cache are cumulative ⚠ — exact terms: check the official price list for the day, date it and source it in your figures.
⚠ All prices on this page are educational orders of magnitude fixed at the editorial office. For all actual costing: official Anthropic price list, dated and sourced.