Abstract: Long-form writing agents require flexible integration and interaction across information retrieval, reasoning, and composition. Current approaches rely on predefined workflows and rigid thinking patterns to generate outlines before writing, resulting in constrained adaptability during writing. In this paper we propose WriteHERE, a general agent framework that achieves human-like adaptive writing through recursive task decomposition and dynamic integration of three fundamental task types: retrieval, reasoning, and composition. Our methodology features: 1) a planning mechanism that interleaves recursive task decomposition and execution, eliminating artificial restrictions on writing workflow; and 2) integration of task types that facilitates heterogeneous task decomposition. Evaluations on both fiction writing and technical report generation show that our method consistently outperforms state-of-the-art approaches across all automatic evaluation metrics, demonstrating the effectiveness and broad applicability of our proposed framework. We have publicly released our code and prompts to facilitate further research.
Introduction
Writing a 10,000-word technical report or a complex novel is rarely a linear process. Human writers do not simply create a static outline and fill it in; they research, pivot when they encounter new information, and refine their logic as the prose develops. However, most current AI writing agents are constrained by a rigid "plan-then-write" paradigm. This paper introduces WriteHERE, a framework that moves beyond static outlining by treating long-form writing as a heterogeneous recursive planning problem, allowing AI agents to interleave planning and execution dynamically.
The Challenge of Long-Horizon Writing
Current Large Language Model (LLM) agents struggle with long-horizon consistency. While they excel at generating short passages, maintaining a coherent narrative or a factual argument over dozens of pages is difficult. Existing solutions typically follow a two-stage process: first, generate a comprehensive outline; second, write the sections.
The primary limitation of this approach is rigidity. If an agent discovers critical new information during the writing phase, or if a plot development necessitates a change in structure, a static outline becomes a constraint rather than a guide. Long-form writing requires a framework that can "think" and "re-plan" recursively as the document grows.
The WriteHERE Framework
The core of the WriteHERE system is the HEterogeneous REcursive planning (HRP) mechanism. It breaks the writing process down into three distinct cognitive categories: Retrieval (gathering external information), Reasoning (content planning and logical organization), and Composition (text generation).
Key Innovations
- Recursive Decomposition: Inspired by Hierarchical Task Networks (HTN), WriteHERE takes a high-level goal and breaks it into sub-tasks. If a sub-task is too complex, it is decomposed further until it becomes "atomic"—small enough to be executed in a single step (typically under 500 words).
- State-based Hierarchical Task Scheduling: The system manages tasks using a Directed Acyclic Graph (DAG). Each task node transitions through states: Active (ready for execution), Suspended (waiting for sub-tasks or dependencies), or Silent (completed).
- Dynamic Interleaving: The agent does not finalize the entire plan before starting. It plans a segment, executes an atomic task, updates its internal memory, and then uses that new context to refine the subsequent planning steps.
Experimental Setup and Datasets
The researchers evaluated WriteHERE across two distinct domains to test its versatility:
- TELL ME A STORY: A dataset for complex fiction writing (230 samples).
- WildSeek: A benchmark for real-world, information-seeking report generation (100 samples).
- LongReport: A new benchmark introduced by the authors to test extreme long-form capabilities, containing prompts designed to elicit reports exceeding 10,000 words on rapidly evolving topics like DeFi and Agentic AI.
Results and Discussion
WriteHERE consistently outperformed existing "plan-and-write" baselines across all benchmarks. In fiction writing, using GPT-4o and Claude 3.5 Sonnet, WriteHERE surpassed the previous state-of-the-art (Agent's Room) in plot coherence, creativity, and language use.
In technical report generation on the WildSeek dataset, the framework surpassed STORM and Co-STORM in relevance, breadth, and depth. Notably, in a head-to-head human evaluation against Gemini Deep Research for 10,000+ word reports, WriteHERE achieved a 7:5 win ratio, with evaluators highlighting its superior depth and novelty.
Conclusion
WriteHERE demonstrates that long-form writing is best approached as a tree-like recursive structure rather than a flat list. By explicitly labeling tasks as Retrieval, Reasoning, or Composition, the framework can invoke specialized logic for each need, reducing hallucinations and context window "drift." While recursive planning increases computational cost due to its "chatty" nature, the resulting gains in adaptability and quality represent a significant step forward for autonomous writing agents.
Summary updated