Context Engineering

Context engineering is the practice of shaping the information provided to a large language model (LLM) to improve the quality, relevance, and accuracy of its outputs. It encompasses user-facing techniques for managing the context window, such as retrieval-augmented generation (RAG), structuring inputs, and managing conversation history ("session hygiene"). This is distinct from agent-context-mgmt, which focuses on how an autonomous agent manages its own working memory.

Structuring and Refining Prompts

Subtle Cues and Triggers

Example Selection for In-Context Learning

Input Ordering and Positional Bias

Leveraging External Context (RAG)

Retrieval Quality and Metrics

Context Security and Privacy

RAG Vulnerabilities

Query Rewriting for Privacy

Robustness to Injection Attacks

Key References