Robots Atlas>ROBOTS ATLAS
Retrieval

JIT Retrieval

2025ActivePublished: 10 September 2026Updated: 10 September 2026Published
Key innovation
Instead of pre-loading all potentially relevant context, the agent keeps lightweight identifiers (file paths, queries, links) and loads data only when it is actually needed, using tools at runtime.
Category
Retrieval
Abstraction level
Pattern
Operation level
RetrievalAgent runtimeOrchestration
Use cases
Coding agents (e.g. Claude Code) navigating repositories via glob/grepExploring large datasets without loading whole files (head/tail, queries)Long-horizon agents with external memory (notes files, to-do lists)Hybrid systems combining pre-retrieval with on-demand fetchingNavigating file systems and external sources through lightweight identifiers

How it works

1) The agent stores lightweight references (file paths, stored queries, links) instead of full data. 2) At runtime it determines what information is needed for the current decision. 3) It uses tools (e.g. grep, glob, Bash head/tail, page fetching) to dynamically retrieve data without loading full objects into context. 4) It leverages environment metadata (file sizes suggest complexity, names hint at purpose, timestamps proxy for relevance) as navigation signals. 5) Through progressive disclosure, each interaction yields context that informs the next step, keeping only what is necessary in working memory. This requires opinionated, thoughtful engineering โ€” the right tools and heuristics โ€” because without it the agent wastes context by misusing tools or chasing dead-ends.

Problem solved

Pre-loading all context fills the model's window, raises costs and degrades answer quality due to "context rot" โ€” as the number of tokens grows, the model's ability to accurately recall relevant information decreases. Classic embedding-based pre-retrieval also suffers from stale indexes and rigid pipelines. Just-in-Time Retrieval mitigates these issues by keeping only the data actually needed at a given step in context.

Components

Lightweight identifiersAddressing data without materializing it in context

File paths, stored queries and web links kept instead of full data; they point to where content can be fetched on demand.

Official

Retrieval toolsDynamically loading data into context at the moment of need

Runtime-executed tools that dynamically retrieve data โ€” e.g. grep, glob, Bash head/tail, page fetching โ€” without loading whole objects.

Official

Metadata signalsGuiding exploration and data prioritization

Folder hierarchy, naming conventions, file sizes and timestamps as cues about complexity, purpose and relevance of data.

Progressive disclosureIncrementally discovering relevant context

An iterative mechanism where each interaction yields context that informs the next decision; the agent builds understanding layer by layer.

Implementation

Implementation pitfalls
Wasting context by misusing toolsHigh

Without the right heuristics the agent chases dead-ends, misuses tools, or fails to identify key information.

Fix:Provide opinionated, thoughtful tools and heuristics for navigating the information landscape.
Higher runtime exploration latencyMedium

On-demand exploration is slower than retrieving pre-computed data due to multiple round-trips.

Fix:Use a hybrid approach โ€” load stable data upfront and fetch the rest just-in-time.
Poor environment metadataMedium

Inconsistent naming and folder structure deprive the agent of navigation signals and degrade retrieval accuracy.

Fix:Maintain clear naming conventions, hierarchy and up-to-date timestamps.

Evolution

Original paper ยท 2025 ยท Anthropic Engineering Blog ยท Prithvi Rajasekaran
Effective context engineering for AI agents
Prithvi Rajasekaran, Ethan Dixon, Carly Ryan, Jeremy Hadfield
2020
RAG establishes the embedding-based pre-retrieval paradigm

Retrieval-Augmented Generation popularizes pre-fetching and injecting data into context โ€” the baseline against which the just-in-time strategy is positioned.

2025
Anthropic formalizes just-in-time context for agents
Inflection point

The article "Effective context engineering for AI agents" (Sep 29, 2025) defines the just-in-time strategy and describes its hybrid use in Claude Code.

Hyperparameters (configurable axes)

Exploration budget (tool-call count)High

Cap on tool round-trips per task; balances thoroughness against latency and cost.

Retrieval granularityHigh

How much data is loaded per step (e.g. whole file vs. a fragment via head/tail/grep).

Pre-load vs. just-in-time ratioMedium

What share of context is loaded upfront (e.g. CLAUDE.md) versus fetched on demand.

Metadata heuristics qualityMedium

How well naming, folder structure and timestamps guide the agent to the right data.

Computational complexity

Compute bottleneck

Latency of sequential tool calls

Multiple runtime tool round-trips and I/O operations introduce latency; this is the main cost traded for lower context usage.

Execution paradigm

Primary mode
Conditional

Data loading happens conditionally โ€” only when the agent deems it necessary.

Activation pattern
Input dependent
Routing mechanism

At runtime the agent decides which data to fetch based on the current need and metadata signals.

Parallelism

Parallelism level
Sequential

Progressive disclosure is inherently sequential โ€” each step depends on the previous result. Independent fetches can be partially parallelized.

Scope
Inference

Hardware requirements

Primary

It is a software/agent-level orchestration pattern, independent of any specific accelerator.