How does per-tenant cost gating change the context-engineering policy in a multi-tenant product?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Context engineering becomes parameterised by tenant: same persona and system prompt, but top-k, summary depth, rerank, and model class scale with the plan so the free tier is profitable and the enterprise tier uses
Think of an all you can eat restaurant that has two memberships. The basic membership gets a small plate, no dessert station, and house-brand soft drinks. The premium membership gets a big plate, the dessert station, and the imported drinks. The kitchen is the same. The recipes are the same. The waiter is the same. What changes is how much each member can put on the plate and which stations they can visit. If you gave everyone the big plate the restaurant would lose money on the basic members. If you gave everyone the small plate the premium members would be paying for things they cannot use. The agent works the same way. The persona is the kitchen. The plate size and the dessert station are the tenant-tuned context knobs.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 minutes: name what stays constant (persona, schema, safety) vs what scales (top-k, rerank, summary, model, budget), give an envelope for each of three tiers, and call out cost per user as the monitoring metric.
| Knob | Free tier | Pro tier | Enterprise tier |
|---|---|---|---|
| Working context budget | 4-8k tokens | 16-24k tokens | 32-64k tokens |
| Top-k retrieval | 3-5 | 8-12 | 15-25 |
| Reranker | Off | Local / cheap | Cohere Rerank v3 / Voyage Rerank-2 |
| Summary depth | Single rolling | 2-level | 3-level + semantic |
| Model class | GPT-5-mini / Haiku 4 | GPT-5.5 / Sonnet 4.6 | GPT-5.5 Pro / Opus 4.7 |
| Persistent memory | Session-only | Week-long | Persistent with admin controls |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Running the same context policy for every tenant and trying to recover margin with billing math. The fix is at the assembly layer, not the invoice.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.