agenticoutputs
ARCHITECTURE // BOUNDED CONTEXT

Context Engineering is deciding what actually goes in the box.

A model only sees what is inside its context window. Not what's true, not what's on your hard drive — only what you put in the box before it answers. Everything else might as well not exist.

CONTEXT WINDOW — FIXED CAPACITY Task + System Rules The 3 Files That Actually Matter Last Relevant Exchange Room for Generation EXCLUDED ON PURPOSE Entire codebase, unfiltered Full chat history, every turn Every doc mentioning the keyword Stale tool output from step 01
01 The Paradigm Shift

From String Formatting to Runtime Payload Assembly

Legacy Paradigm // Prompt Engineering Fragile & Unbounded

"How do I word this cleverly?"

Treats the prompt as a static text string. Relies on persona hacks ("Act as a senior dev"), magic tail-instructions ("Think step-by-step"), and phrasing tweaks. Assumes the model's parametric memory already contains the solution.

// Static Prompt String
"You are an expert full-stack developer."
"Refactor the authentication handler cleanly."
// Missing real source code & type definitions!
"Think step-by-step and do not make mistakes."
  • Parametric Hallucination: Invents non-existent functions because no actual source files were injected into context.
  • Attention Dilution: Stuffing raw 50,000-line chat histories dilutes the model's focus on key constraints.
Primary Bottleneck: Phrasing tweaks cannot supply missing runtime evidence.
Modern Standard // Context Engineering Deterministic & Bounded

"What evidence does it need to see?"

Orchestrates exact payload streams: system rule schemas, targeted AST file extractions, active linter output, and pruned conversation state. Treats context space as high-value, expensive RAM.

// Assembled Payload Architecture
[SYSTEM] Rules & schema contracts (120 tokens)
[FILE: auth.ts#L40-85] Target interface (340 tokens)
[TOOL_OUTPUT] Linter error trace (95 tokens)
[TASK] Refactor auth.ts to match schema
  • Ground Truth Evidence: Supplies exact, non-hallucinated source code slices right before inference.
  • Pruned Payload Efficiency: 85% lower context overhead with high execution precision on multi-file edits.
Core Advantage: Deterministic payload assembly turns agent loops from guesswork into precision engineering.
02 Payload Anatomy

Five streams compete for the same context window

System Rules

Persona, output schema, tool policies, and safety constraints. Compact but mandatory.

Retrieved Knowledge

The precise source file or code snippet needed right now — not the entire repository.

BOUNDED
CONTEXT

Tool Execution Output

Observation results from recent actions: terminal stdout, API responses, or linter results.

Conversation State

Key user preferences and recent turns, pruned to avoid bloat.

The User Task

Stated clearly at the center. When buried under irrelevant context, attention splits and reasoning degrades.

03 Capacity & Dilution

Adding context is easy. Pruning is the core engineering task.

CONTEXT CAPACITY GAUGE 92% FULL — ATTENTION DILUTION HIGH

Every extra log line, every unpruned chat turn, and every "just in case" documentation block pushes relevant information to the edges where attention mechanisms perform worst (Needle in a Haystack degradation). A full context window isn't thorough — it is diluted.

04 Core Engineering Axioms

"A model with the right three facts outperforms one with three hundred."

01

Relevance Beats Recency

The newest message isn't automatically the most valuable. Pin core specifications and prune stale tool output.

02

Targeted Retrieval

Retrieve specific lines and declarations rather than dumping whole documentation suites into the context window.

03

Prune First

Treat context window space as expensive memory. Every inclusion must justify its seat in the prompt payload.