# Lazy Loading
Lazy loading is a design pattern that defers the initialization or loading of a resource until it is actually needed. Instead of loading everything upfront, the system loads components on demand, reducing initial load time, memory usage, and unnecessary computation.
The pattern originates in software engineering (database query optimization, UI rendering, module loading) but the principle is universal: don't pay for what you don't use yet. It is a form of [[Progressive Disclosure]] applied to system resources rather than user interfaces.
In web development, lazy loading is used for images, JavaScript modules, and entire application routes (e.g., route-based code splitting). In AI, the same principle appears as [[Prompt Lazy Loading AI Design Pattern (PLL)]]: deferring the loading of prompts, context, rules, and data until a specific task requires them. Combined with the [[Receptionist AI Design Pattern]], this creates AI systems where each agent loads only the context it needs, keeping the [[Token Budget]] lean and the signal-to-noise ratio high.
The trade-off is latency at the moment of loading versus wasted resources upfront. In most cases, the deferred cost is negligible compared to the upfront waste.
## References
-
## Related
- [[Progressive Disclosure]]
- [[Prompt Lazy Loading AI Design Pattern (PLL)]]
- [[Receptionist AI Design Pattern]]
- [[Token Budget]]
- [[Context Engineering]]
- [[Separation of Concerns]]