Ship production AI
AI Engineering Bootcamp
maven.com/tailabs/ai-engineering-bootcamp
Find the smallest set of tokens that maximises the chance of the right answer

Dr. Aki Wijesundara
Co-Founder, TAI Labs
Two paths from TAI Labs. Each card shows exactly what we cover.

For engineers & technical builders
Build and ship production AI agents
What we cover
Scan to enrol
maven.com/tailabs/ai-engineering-bootcamp

For PMs, founders & operators
Direct AI tools and ship real products
What we cover
Scan to enrol
maven.com/theaiinternship/ai-pm-bootcamp-and-cert
How many tokens the API will accept without erroring.
How many tokens it can actually hold accuracy across.
Those are different numbers. The gap is where teams get burned.
Today: three problems · three fixes · one budget
Every token attends to every other token. Double the context and you quadruple the pairwise relationships. Attention gets thinner, not smarter.
Retrieval accuracy is high at the start and end of the window, and sags in the middle. Same fact, different position, different answer.
Near-miss content is worse than no content.
Model has a single authoritative source. Higher chance of the right answer.
One is correct. Two look right. The model cannot tell which is authoritative. Accuracy drops.
Stuffing “maybe relevant” material is not free. It actively competes with the truth.
Passing NIAH at 500k tokens does not mean the model can reason over 500k tokens. Real work degrades much earlier.
Single-shot QA is one big blob. An agent accumulates its own exhaust.
By turn 40, most of the context is a record of things that did not work.
If two or more of these are true, you do not have a prompt problem. You have a context problem.
Show token count and output quality after each pass. This is the core of the session.
config.v1.json · config.final.json · config.FINAL2.json. The model will pick the wrong one with confidence.
One current source of truth. Everything else is gone or archived outside the window.
Two versions of the same config file is the single most common cause of the model doing the wrong thing.
If removing it would not change the answer, it is decoration.
Constraints, decisions, facts the answer depends on, and nothing else.
| Instead of | Keep |
|---|---|
| Full transcript | Summary of decisions and open questions |
| Sample rows | Schema + 2 example rows max |
| Both file versions | The diff |
| Full implementation | Function signature + docstring |
Never bury the instruction mid-window. Top and bottom are the high-attention zones.
You pay for every definition on every turn. Tool selection accuracy degrades as the menu grows.
Load tools per step, or expose a small allowlist. Planning and execution should not share the same surface.
This is what separates the session from a blog post: the failure teaches the keep rule better than the success.
When something comes in, something goes out.
You guess what the agent will need. The window fills with maybes.
Filesystem, grep, and targeted retrieval as context. Navigation beats speculation.
Summarise and reinitialise. Keep decisions and constraints. Discard redundant tool output.
Write state to a file outside the window. Pull it back on demand across thousands of steps.
A specialist burns 10k tokens in a clean window and returns a 1.5k summary.
| Situation | Reach for |
|---|---|
| Conversational flow that needs continuity | Compaction |
| Long iterative work with milestones | Structured note-taking |
| Parallel research threads | Sub-agents |
Aggressive trimming that reshuffles your prefix kills cache hits. The cheapest context is often the one you do not change.
Log token counts per turn on one agent. You cannot cut what you cannot see.
Delete your worst duplicate. Re-run. Measure the delta.
Pick one raw tool dump and truncate or paginate it.
Leave with one sentence: find the smallest set of high-signal tokens that maximises the chance of the right answer.
Same two programmes. Scan a QR, then take the next step.

For engineers & technical builders
Build and ship production AI agents
What we cover
Scan to enrol
maven.com/tailabs/ai-engineering-bootcamp

For PMs, founders & operators
Direct AI tools and ship real products
What we cover
Scan to enrol
maven.com/theaiinternship/ai-pm-bootcamp-and-cert
Agents are where it gets hard: the window refills every turn, and nobody is steering it unless you build the harness.
AI Engineering Bootcamp: build and ship production AI agents
maven.com/tailabs/ai-engineering-bootcamp

Dr. Aki Wijesundara
TAI Labs