Context Engineering Fundamentals
Context window management, prompt compression, and context optimization.
Context Assembly Patterns
Context assembly patterns are software engineering approaches for dynamically constructing the LLM context window at runtime, selecting and arranging information based on the current query, user state, and application logic. Prerequisites: what-is-context-engineering.md, context-budget-allocation.md.
Context Budget Allocation
Context budget allocation divides the context window into purposeful zones — system prompt, conversation history, retrieved knowledge, tool results, and safety buffer — with specific token budgets that adapt to window size and task requirements. Prerequisites: what-is-context-engineering.md.
Context Caching and Prefix Reuse
Context caching stores the computed key-value representations of stable prompt prefixes across requests, reducing latency by 30-50% and costs by up to 90% on cached tokens for applications with repetitive context structures. Prerequisites: what-is-context-engineering.md, context-budget-allocation.md.
Context Compression Techniques
Context compression techniques — including summarization, truncation, structured extraction, deduplication, and perplexity-based pruning — reduce token usage by 50-75% while preserving the information models need to generate accurate responses. Prerequisites: what-is-context-engineering.md, context-budget-allocation.md.
Conversation History Management
Conversation history management applies strategies like sliding windows, summarization, and selective retention to maintain conversational coherence while keeping token costs within the context budget. Prerequisites: what-is-context-engineering.md, context-budget-allocation.md.
Information Priority and Ordering
Information positioning within the context window follows a U-shaped attention curve — models attend most to the beginning and end, losing information in the middle — making strategic ordering a critical factor in output quality. Prerequisites: what-is-context-engineering.md.
Long-Context Design Patterns
Long-context design patterns address the unique challenges of working with 100K+ token context windows, where effective capacity falls below nominal capacity and explicit organization strategies become essential for maintaining model performance. Prerequisites: what-is-context-engineering.md, information-priority-and-ordering.md.
Multi-Modal Context Design
Multi-modal context design integrates images, audio, video, and PDFs alongside text in the context window, managing token costs, placement strategies, and modality-specific formatting to maximize model comprehension across input types. Prerequisites: what-is-context-engineering.md, context-budget-allocation.md.
State and Memory in Context
State and memory patterns — including scratchpads, pinned facts, running tallies, and working memory blocks — enable LLMs to maintain, update, and reference persistent information within and across conversation turns. Prerequisites: what-is-context-engineering.md, conversation-history-management.md.
What Is Context Engineering
Context engineering is the discipline of designing what information enters an LLM’s context window and how it is organized, determining model performance more than the prompt instructions themselves. Prerequisites: None.