Editorial desk with abstract AI data visualizations and research notes

AI Learning Ramp

Context engineering for analytics agents, durable state, and prompt budgets.

Course 5 is a one-hour systems session on deciding what enters model context, what becomes durable state, what gets compacted, and how cache-aware prompt layout keeps long-running AI workflows usable.

Course 5 of 24 Published June 8, 2026 Focus: context engineering Target: OpenAI / Anthropic interviews

System-Design Frame

Assume your BigQuery-adjacent GenAI analyst needs to answer warehouse questions, draft SQL, inspect prior tool calls, and continue multi-step investigations across sessions. Your job is to design the context assembly layer: a governed pipeline that selects the right instructions, user intent, permissions, schema facts, retrieved evidence, conversation state, and compacted history without turning the prompt into an unbounded transcript dump.

Course 5: Context Engineering

One-hour objective: defend a context architecture for an enterprise analytics agent that balances relevance, state continuity, compression quality, cache efficiency, and long-context failure isolation.

Inventory the context sources.

List what the agent may need: system instructions, user identity, warehouse permissions, semantic layer definitions, schema excerpts, retrieved docs, previous turns, tool outputs, and task state.

Read Anthropic on context engineering.

Focus on the shift from prompt writing to context systems, especially just-in-time context, selection, compression, isolation, and agent memory boundaries.

Study OpenAI compaction.

Anchor on how long-running workflows preserve prior state while reducing context size, and what this implies for quality, latency, and state handoff.

Review Anthropic prompt caching.

Look for cache breakpoints, prompt prefix stability, TTL choices, and cache invalidation rules that should shape how you assemble prompts.

Refresh conversation state only if needed.

Use the optional source if you want a quick reset on durable conversation objects versus manual transcript passing.

Deliver the interview synthesis.

State your context contract, packing order, compaction policy, cache strategy, and one failure mode that your design deliberately prevents.

Course 5 Reading List

Keep this to three required sources. The optional refresher is only for resetting API mechanics before the drill.

Required

Anthropic: Effective Context Engineering for AI Agents

A direct engineering treatment of context engineering as the next step beyond prompt engineering, with practical framing for just-in-time context, memory, selection, compression, and isolation.

Read for: the vocabulary and architecture tradeoffs behind reliable agent context assembly.

Required

OpenAI: Compaction

The current OpenAI guide to reducing context size in long-running interactions while carrying forward the state needed for future turns.

Read for: compression policy, state continuity, context thresholds, and latency control in extended workflows.

Required

Anthropic Claude Docs: Prompt Caching

A detailed source on cacheable prompt prefixes, cache breakpoints, multi-turn caching, TTL choices, invalidation, and how prompt structure affects cost.

Read for: cache-aware prompt layout and the operational cost model of large static context.

Optional refresher

OpenAI: Conversation State

A short reset on persistent conversation state, previous response chaining, and when the platform can carry context instead of your app resending the full transcript.

Use only if: stateful conversation mechanics feel fuzzy before the drill.

Readiness Checklist

You are ready for the interview version of this topic when you can answer these without defaulting to "just use a bigger context window."

Interview Drill: Agentic AI System Design

Prompt: design the context layer for a BigQuery analytics agent that answers questions, writes SQL, calls tools, and resumes investigations across sessions without leaking stale or unauthorized context.

Sources

  1. Anthropic engineering: Effective Context Engineering for AI Agents
  2. OpenAI Compaction Guide
  3. Anthropic Claude Docs: Prompt Caching
  4. OpenAI Conversation State Guide