AI Agent Infrastructure
Context window management
Explains what counts toward the context window, why more space does not fix missed details, and how to measure and trim input before each call.
What you will be able to do
- Measure the input tokens of a request before sending it.
- Decide what to retrieve, trim or summarize for each agent step.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in AI Agent Infrastructure
- Token budgetsAdvanced · 4 min
Explains why token budgets must be enforced in code, how input and output tokens differ, and how to find the tasks that use the most tokens.
- Cost per taskAdvanced · 5 min
Shows how to calculate cost per task from billing tags and completed-run counts for each task type, and why failed runs must stay in the spend figure.
- Retrieval permissionsAdvanced · 4 min
Shows how a retrieval step filters results by user identity before any passage reaches the model, and why prompt rules are not an access control.
- Vector index freshnessAdvanced · 5 min
Explains how pull indexers, schedules and change detection set the delay between a source change and a searchable update, and how to measure that delay.
- Memory consentAdvanced · 5 min
Explains what a valid consent record must hold for an assistant's memory, how withdrawal must reach derived copies, and what to check in the data stores.
- Prompt injection defensesAdvanced · 5 min
Explains how untrusted text can steer an agent, why filters are only a signal, and how to limit tools, data and approvals so that an injected instruction has no path to…