Context stuffing, also called context-augmented generation, supplies external knowledge by placing a complete source document directly in an LLM’s context window. It avoids document chunking, indexing, and retrieval, allowing the model to reason across the supplied text. section 3.10.8 section 3.8
The application cleans and bounds the source text, then inserts it into a prompt—preferably system instructions when the text should provide authoritative context. Unlike cache-augmented generation (CAG), context stuffing resends the complete document on every call rather than preserving it as cached state. section 3.10.8 section 3.8
Figure 3.6 Context stuffing workflow: external knowledge is injected directly into the prompt without retrieval indexing
The workflow shows external knowledge entering the prompt directly, without retrieval indexing. section 3.8
Choose context stuffing with its operational trade-offs in mind:
- It removes retrieval misses and chunking errors, but resending large documents raises per-request token costs and inference latency. section 3.8
- Very long inputs can dilute attention or cause position bias, making details near the middle easier to overlook; clean formats such as Markdown help preserve structure. section 3.8
- It best fits bounded documents, low-frequency workflows, and rapid prototypes where retrieval infrastructure is not yet justified. section 3.8
Prompt placement
For the same external text document, inject it into the user prompt as user-level context or into the system prompt as trusted context that directs the model to act as an expert on that text. section 3.10.8
