Manus's $2B Agent Architecture: Context Engineering Strategies Revealed
The article analyzes the planning-with-files technique — three Markdown files for task planning, knowledge storage, and state tracking — and its alignment with Manus's context engineering strategies (reduce, offload, isolate context), while detailing Manus's tech stack including multi-model routing, E2B sandbox, MCP protocol, and KV cache optimization.
1. Introduction
The GitHub project planning-with-files describes itself as a Claude Code skill implementing "Manus-style persistent markdown planning — the workflow pattern behind the $2B acquisition." The author questions whether a few Markdown files alone can replicate Manus, arguing that Manus proves general AI agents require sound engineering practices, not just compute.
2. planning-with-files: Three Markdown Files as Working Memory
The technique uses three files, mirroring Manus's blog post "Context Engineering for AI Agents: Lessons from Building Manus" which advocates treating the file system as ultimate context — unlimited size, naturally persistent, directly operable by the agent.
task_plan.md — Goal tracking and task decomposition. Macro goals are broken into small tasks; PreToolUse hooks force the model to re-read before each decision to prevent drift.
findings.md — Knowledge storage and deduplication. Expensive search results or code snippets are stored on disk; the context window retains only indexes or summaries, greatly reducing context pressure.
progress.md — Session state and error logging. Records all attempted paths and failure reasons, enabling the model to learn from errors and avoid invalid loops in multi-step reasoning.
The author notes that findings.md alone is thin for unstructured data retrieval. Milvus's website reveals a critical component: retrieval-based memory using vector databases (Milvus or Zilliz Cloud) for fast semantic search. Thus, file-system persistence combined with vector retrieval forms the technical foundation.
3. Manus Technology Stack Overview
Primary source: Lance Martin's workshop summary "Context Engineering in Manus."
3.1 Model Layer: Task-Level Routing
Coding tasks → Claude
Multimodal tasks → Gemini
Math reasoning → OpenAI
Model selection is cost-driven; KV cache efficiency is a key consideration. In the ReAct paradigm, multi-turn reasoning keeps prefixes stable, so KV caching reduces inference cost and time-to-first-token (TTFT). Both self-hosted frameworks like vLLM and API providers like Claude (via cache_control field) support KV caching. Designing around KV cache is a core Manus principle — even tool selection avoids dynamic addition/removal during iteration to prevent cache invalidation, schema violations, or hallucinated actions. Manus builds a context-aware state machine that masks token logits during decoding to enforce or restrict actions per state without altering context content.
3.2 Cloud Sandbox Layer: E2B
Manus uses E2B as the agent's "workshop." E2B is based on AWS Firecracker microVMs, providing lightweight, high-isolation environments for safe execution of risky code (Bash, Python, JS). Key capabilities:
Execution tools: 27 integrated tools (Chromium browser, terminal, file system) run inside E2B.
Persistent sessions: Tasks often run tens of minutes; E2B supports long-running sessions with pause/resume for user interaction.
Multi-step iteration: Agent executes in E2B, observes results, saves context, updates plan, then proceeds — akin to a human researcher working continuously.
3.3 Protocol Layer: MCP and A2A
Manus adopts Model Context Protocol (MCP) to integrate hundreds of third-party tools. It also participates in Agent2Agent (A2A) protocol for seamless task delegation and identity recognition across vendor agents.
4. Manus's Context Engineering: Three Core Strategies
4.1 Reduce Context
Controls long-context window growth via compaction and summarization:
Compressed representation: Old tool-call results no longer needed for current decisions switch from full content to compact references (e.g., file paths), drastically cutting tokens while preserving retrieval paths.
On-demand summarization: When simple compression hits diminishing returns, Manus generates structured summaries of entire trajectories or historical results, further compressing information while keeping important knowledge reconstructible.
Goal: lower current context window token burden so the LLM focuses on decisions without losing critical information.
4.2 Offload Context
Moves large context data out of the model's direct conversation history into the external environment (VM file system), accessed on demand:
Tool result storage: Full tool outputs are saved to the file system; conversation context keeps only references.
Operation offloading to sandbox: Most operations run in the sandbox; the agent needs only ~20 atomic tools, avoiding bloating context with excessive tool definitions and descriptions.
Result: context becomes lightweight and searchable , preventing the model's attention budget from being consumed by massive tool-call histories.
4.3 Isolate Context
Manages different task contexts by delegating complex tasks to independent sub-agents:
Task granularity division: Each independent task gets a sub-agent with its own context window, isolating information across tasks.
Selective sharing: Simple tasks pass only necessary instructions; complex tasks share more complete context for accuracy.
Benefit: avoids context contamination , letting each module focus on its task, improving overall efficiency and clarity.
5. Conclusion
The planning-with-files claim holds, but the key is not the files themselves — it's Claude Code. Manus's core context engineering strategies are all implemented in Claude Code; though technical depth differs, the direction is highly aligned.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
