Phuriwaj

Context Engineering vs Prompt Engineering

Core Idea

The dominant failure mode in production AI systems is not a bad prompt — it is bad context assembly. “Context engineering” is the discipline of managing what information enters the model’s context window, and it matters more than prompt wording in agentic workflows.

Why This Matters

Most teams focus on refining their prompts when things go wrong. In agentic and RAG systems the real failures are upstream: wrong documents retrieved, too much stale history stuffed into the window, missing or poorly described tool definitions. Fixing the prompt doesn’t fix these.

Key Points

  • The four context strategies (LangChain framing): write, select, compress, isolate
    • Write — pre-populate context with the right documents before the model sees the task
    • Select — retrieve only the most relevant chunks, not everything
    • Compress — summarise or truncate history to stay within the window without losing signal
    • Isolate — keep tool definitions, system instructions, and user content in separate logical blocks
  • Tool descriptions are context — vague tool names and descriptions directly degrade decision quality in tool-use agents; treat them like code
  • Give the model permission to express uncertainty — explicitly saying “if data is insufficient, say so” in the system prompt reduces hallucinations significantly in production agentic workflows (Anthropic finding)
  • Context window ≠ context quality — a 1M token window doesn’t help if the wrong 100K tokens are in it

Connections

Source

Conversation: “LLM-powered news search and summarization sites” — 2026-05-23 AI Dev Brief section; LangChain and Anthropic sources