Engineer the Context, Not the Model

Read Articleadded Sep 23, 2025
Engineer the Context, Not the Model

Manus chose context engineering over end‑to‑end training to iterate fast and stay model‑agnostic. They center on KV‑cache efficiency, stable append‑only contexts, action constraining via logits/prefill, file‑based memory, attention recitation, visible errors, and diversity to avoid few‑shot mimicry. The takeaway: agent success depends on how you shape context—cost, speed, recovery, and scale follow from it.

Key Points

  • Optimize for KV‑cache hit rate: keep prompts stable, use append‑only, deterministically serialized contexts, and mark cache breakpoints; enable prefix caching and consistent session routing.
  • Do not dynamically add/remove tools mid‑iteration; instead, mask logits and use response prefill plus a state machine to constrain action selection without breaking caches.
  • Use the file system as externalized, restorable memory to handle large observations, control costs, and avoid long‑context degradation.
  • Manipulate attention via recitation (e.g., a constantly updated todo list) to keep goals in the model’s recent focus and prevent drift.
  • Keep errors in the context so the model can learn from failures; avoid over-uniform few-shot traces by injecting structured diversity to prevent behavioral lock‑in.

Sentiment

Overwhelmingly positive. The Hacker News discussion largely agrees with the article's core tenets and provides supporting insights and practical examples.

In Agreement

  • Using the file system as external memory for agents is highly effective and simple, negating the need for complex memory backends like RAG or vector stores. This can be implemented with a dedicated directory (e.g., `.agent/`) for task lists, plans, findings, and prompts, using meaningful filenames and status suffixes.
  • Keeping agent plans simple and using straightforward tools like `update_plan` to track progress aligns with best practices, as evidenced by OpenAI Codex's tooling setup.
  • Many context engineering best practices for AI agents, such as stable contexts, keeping failure traces, and injecting diversity, mirror established best practices for managing code repositories (e.g., not bloat/refactor too often, not deleting bad commits, avoiding repetitive code).
  • Caching is critically important for AI agents, especially for cost and performance; providers on fixed-price plans are incentivized to implement it, while users on metered plans must actively consider its availability and importance.
Engineer the Context, Not the Model