Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

ADR-26038: Context Engineering as Core Design Principle


title: Context Engineering as Core Design Principle authors:


ADR-26038: Context Engineering as Core Design Principle

Date

2026-03-08

Status

Accepted

Context

The Agentic OS concept (ADR-26034, A-26002: Agentic OS, Tiered Cognitive Memory, and Package-Driven Infrastructure) positions documentation as a filesystem and skills as composable applications. However, a comprehensive landscape analysis (A-26009: Compass — The Realistic State of Agentic AI Architectures in Early 2026) reveals a consistent pattern across production deployments: context engineering, not architectural sophistication, determines agent success.

Key evidence from A-26009:

  1. Vercel’s text-to-SQL agent: Stripping from 15+ tools to 2 improved success rate from 80% to 100%, reduced tokens by 40%. Their conclusion: “We were doing the model’s thinking for it.”

  2. UC Berkeley MAST taxonomy (NeurIPS 2025): Analysis of 1,600+ traces across 7 frameworks found multi-agent system correctness as low as 25%. Best-effort interventions yielded only +14% improvement.

  3. Cognition (Devin, $73M ARR): Published “Don’t Build Multi-Agents” — multi-agent systems are inherently fragile due to context isolation between sub-agents.

  4. Single-agent with skills study (arXiv:2601.04748, January 2026): Single agents with skill libraries “substantially reduce token usage and latency while maintaining competitive accuracy” compared to multi-agent approaches.

  5. Claude Code ($1B run-rate): Fundamentally a single-agent tool-use loop — LLM + tools in a loop, not elaborate orchestration.

  6. NVIDIA RULER benchmark: Effective context is only 50-65% of advertised window size. Llama 3.1-70B accuracy drops from 96.5% at 4K tokens to 66.6% at 128K.

  7. MIT/Kellogg finding: 80% of work in production agent projects is data engineering, governance, and workflow integration — not the AI itself.

The ecosystem’s Agentic OS design has been evolving toward increasing architectural complexity (VFS layers, Virtual Relational Layers, document type registries). This ADR establishes the constraint that prevents over-engineering: context engineering is the core primitive, and every architectural addition must justify its existence by improving context management.

The Catalyst: Mentor Generator

These patterns emerged from building Mentor Generator, the first application on this OS. Mentor Generator is an AI-powered system that creates personalized learning courses: it interviews a user about their goals and background, researches contemporary sources on the chosen topic, assembles a structured curriculum with a teaching persona (tone, Socratic questioning style, strictness level), and then conducts interactive learning sessions. The project uses litellm for provider-agnostic LLM connectivity (any API, any model).

During the v0.31.0-v0.41.0 evolution (documented in A-26002), three systemic failures became undeniable: Cognitive Overload (monolithic prompt causing Instruction Drift), Context Tax (reference data competing with procedural logic for the finite context window), and Distribution Friction (no versioned, testable unit of expertise). These are not Mentor-specific — they apply to any agent that must combine domain expertise with structured output generation.

The production mentor requires:

This is a context engineering problem, not an orchestration problem.

Decision

We adopt context engineering as the core design principle for the Agentic OS ecosystem. This means:

  1. Single-agent architecture with skill dispatch. The agent is one process that loads skills on demand (progressive disclosure). Skills are injected instructions, not separate agents. The SKILL.md format, structure, and selection mechanism are specified in ADR-26044, grounded in cross-vendor convergence documented in A-26009.

  2. Three-tier memory as the primary abstraction.

    • Working memory: Current context window, managed by token-aware budget tracking

    • Episodic memory: Session history, persisted to disk, paged in on demand

    • Semantic memory: Long-term knowledge in a vector store, retrieved via semantic search

  3. Context budget as a first-class constraint. Every document, skill, and tool output has a token cost. The signal-to-noise ratio of prompt delivery format is itself an architectural decision — see Format as Architecture: Signal-to-Noise in Prompt Delivery for the detailed analysis and empirical measurements. The agent tracks cumulative context usage and acts proactively:

    • (a) Context almost full: summarize and continue (page fault → swap)

    • (b) User stops: graceful save of session state (SIGTERM → checkpoint)

    • (c) Goals complete: persist outcomes and exit cleanly (exit(0) → write result)

  4. Architectural additions require context engineering justification. Any new layer, abstraction, or component must demonstrate that it improves the agent’s ability to manage, retrieve, or budget context. If a feature does not make context management better, it is rejected as over-engineering. This operationalizes ADR-26037 (Smallest Viable Architecture) for the agent runtime.

  5. Tool minimalism. Fewer, well-chosen tools outperform many specialized tools (Vercel evidence). The agent starts with a minimal tool set (RAG retrieval, web search, file I/O) and tools are added only when a concrete use case proves the existing set insufficient.

Consequences

Positive

Negative / Risks

Alternatives

References

Participants

  1. Vadim Rudakov

  2. Claude Opus 4.6