Principle
Fetch task details when needed, with a fallback
Loading fewer documents is useful only if the agent still finds the information the task requires. Combine a small starting context with a reliable way to retrieve missing details.
Before you use it
- Use when
- An agent starts every task with huge documentation, memory and historical transcripts loaded into context.
Keep this limit in mind
- Just-in-time retrieval fails if indexing is weak or the agent does not know important information exists.
Current editorial reading
Keep essentials available from the start
Load the goal, required constraints and information needed for the first decision. Keep references to other relevant material and fetch it before making a decision that depends on it. For example, a documentation agent can retrieve one component guide when editing that component, while keeping the project’s writing and disclosure rules available throughout. If a required reference is missing, stop that decision and recover the source.
Compare completeness as well as context size
Try this approach on representative tasks against a suitable preloaded baseline. Check required facts found, wrong decisions, retrieval time and total context used. Anthropic’s guidance describes runtime search as a trade-off: it may be slower and can miss key information without suitable tools and guidance. Preload material that is predictably needed when retrieval adds delay or repeatedly fails. Fewer loaded tokens alone are not evidence of a better result.
Take it with you
Use retrieval to select relevant information, then verify that selection. Keep a fallback for missing sources and for tasks where preloading is simpler.
Sources and evidence (1)
What we checked
Just-in-time retrieval uses lightweight references to load information during a task; the guidance also describes hybrid approaches.
Vendor engineering article published 2025-09-29; selected full-text section read. The comparison procedure and documentation example are editorial recommendations, not results reported by the source.
Effective context engineering for AI agents · Context retrieval and agentic search
Runtime exploration can be slower than precomputed retrieval and can miss important information without effective tools and guidance.
This source-bound trade-off replaces an unconditional benefit claim. No task-independent performance gain, token target or superiority of retrieval over preloading is asserted.
Effective context engineering for AI agents · Context retrieval and agentic search, trade-off and hybrid-strategy paragraphs
Editorial sources (1)
Save and practise this idea
My learning
Read. Recall. Repeat.
Save this idea and return to it on any device.
Keep exploring
More from this collection
Make the agent loop finish, recover and stay inspectable
Let subagents write durable artifacts instead of relaying everything through the coordinatorEvaluate the same agent task across multiple trialsOriginal edition evidence and sources
These records belong to the original released edition. The current editorial reading has its own evidence above; neither set silently replaces the other.
Anthropic's context-engineering guidance recommends treating context as finite and using just-in-time retrieval instead of indiscriminate preloading.
Just-in-time retrieval fails if indexing is weak or the agent does not know important information exists.
Effective context engineering for AI agents · See source record
All sources (1)
Original edition, downloads and provenance
The reading above is editorial version 1.0.0, bound to this exact source edition. The original data and saved downloads retain that edition and the separate editorial layer. They may contain earlier wording; use the current reading above when interpreting it.
Version 0.1.0
No review details are supplied for this edition.
Read the original edition and overlay as JSON · Release details