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
Strategy comparison table
| Strategy | Saturation Tower | Final context (tk) | Cumulative entry charged (tk) | Loss of information | Verdict 150 laps |
|---|---|---|---|---|---|
| Click “Compare” to complete the table. | |||||
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
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
| Dimension | Origin of data | Origin of generator |
|---|---|---|
| Question | “Where does this statement come from? » | “What produced it?” » |
| Content | tool, call_id, record_id, source document | prompt version (hash), model id, temperature, timestamp |
| Verification | resolution of pointer against result raw in the newspaper | manifest + full log (raw/ctx) |
| Trap | plausible hallucinatory quote → obligatory mechanical verification | promise 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
| Job | Tokens | Effective price ($/Mtk) | Cost ($) |
|---|---|---|---|
| Click “Calculate”. | |||
Comparison of the 4 configurations
| Configuration | Cost ($) | 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.