Learn Context Engineering on AI4AI — short, hands-on lessons with live AI runs, at three reading levels (beginner to expert). Free to start.
⚡ A prompt is the instruction or question you send to a model. Context engineering is the broader discipline of deciding what fills the entire context window — system instructions, retrieved documents, worked examples, conversation history, tool outputs, and the prompt itself. M…
Every model has a context window—the maximum number of tokens it can process in a single call. A token is roughly 3–4 characters of English text; a typical paragraph runs 60–80 tokens. As of mid-2026, limits range from 128K tokens (GPT-4o) to 200K (Claude Sonnet 4.6 / Opus 4.8) …
An LLM has two distinct memory modes. The context window is short-term: everything the model can see right now — the system prompt, conversation history, retrieved documents, and the current user message. It is fast, requires no extra infrastructure, and the model reasons over i…
Retrieval-Augmented Generation (RAG) solves a core problem: a model's weights are frozen at training time, so they cannot know about new documents, private data, or facts that change after the cutoff. RAG fixes this by fetching relevant text chunks from an external store and inj…
⚡ Models like Gemini 1.5 Pro (1M tokens) and Claude 3.x (200K tokens) can ingest entire codebases, long transcripts, or multi-chapter documents in a single call. This eliminates the need to chunk and stitch, letting the model reason over complete information without losing cross…
Production LLM systems accumulate three failure modes as they scale. **Staleness** occurs when context contains outdated facts—a system prompt that references 'today is January 2024,' a cached user profile reflecting preferences from six months ago, or RAG chunks retrieved from …