Noureddine RAMDI / WriteHERE: dynamic recursive planning for AI-assisted long-form writing with real-time visualization

Created Mon, 04 May 2026 10:23:02 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

principia-ai/WriteHERE

Writing long-form AI content often means juggling multiple subtasks like research, reasoning, and composition. WriteHERE takes an uncommon approach by dynamically decomposing these complex writing goals into smaller, heterogeneous subtasks that it plans and executes recursively. What sets it apart is the real-time visualization of this planning and execution process, giving users a window into the AI’s “thinking” as it structures and produces content. This framework supports both fiction and technical report writing, and its evaluations claim to outperform existing state-of-the-art methods.

What WriteHERE does and its architecture

WriteHERE is an open-source AI writing framework designed to handle long-form writing tasks by recursively breaking them down into subtasks such as information retrieval, reasoning, and composition. Unlike linear or rigid workflow-based systems, it dynamically plans and adapts its workflow as it executes, allowing more flexible and context-aware generation.

Under the hood, WriteHERE runs a Flask backend server that orchestrates the AI agent’s task planning and execution. It supports integration with major large language models like OpenAI’s GPT series and Anthropic’s Claude models, as well as SerpAPI for web search functionality during report generation.

The frontend is built with React, providing a real-time visualization of the agent’s recursive planning process. This frontend interface lets users observe how the agent decomposes the overall writing task into subtasks, executes them, and composes the final output. This transparency is not just a UI gimmick but a core feature that helps users understand AI behavior and debug or guide its workflow.

The project is MIT-licensed and non-commercial, with an oral presentation accepted at EMNLP 2025, signaling a research-grade maturity.

Technical strengths: recursive heterogeneous planning and real-time visualization

The defining technical strength of WriteHERE lies in its recursive task decomposition engine. The system does not follow a fixed workflow. Instead, it interleaves planning and execution dynamically, breaking down writing tasks into subtasks that can be of different types — retrieval (finding relevant info), reasoning (synthesizing and analyzing), and composition (writing prose).

This heterogeneous planning model allows WriteHERE to handle complex, multi-faceted writing assignments more flexibly than monolithic generation or pipeline-based approaches. The agent can revisit previous subtasks or spawn new ones recursively based on intermediate results, which mirrors human writing strategies more closely.

The real-time visualization frontend is another standout feature. It shows the evolving tree of tasks and subtasks, along with intermediate outputs and decisions. This “thinking process” exposure is valuable for practitioners and researchers who want to debug AI agents or understand how LLMs might organize complex tasks.

Tradeoffs and limitations include:

  • Increased complexity: Recursive heterogeneous planning is inherently more complex to implement and maintain than linear pipelines.
  • Dependency on external LLM and search APIs: The system requires API keys and depends on third-party services like OpenAI, Anthropic, and SerpAPI.
  • Performance and scalability: Real-time visualization and recursive planning add runtime overhead, which might limit throughput in production settings.

The codebase is primarily Python for the backend, with React/JavaScript for the frontend. The backend uses standard Flask patterns, and the frontend uses React hooks and state management to update the visualization in real time.

Quickstart with WriteHERE

Getting started with WriteHERE requires Python 3.6+ and Node.js 14+ for the frontend. You also need API keys for OpenAI, Anthropic, and SerpAPI to enable model access and search functionalities.

You can run WriteHERE with or without the visualization interface. Running without visualization is simpler and suitable for batch processing or backend integration.

Here are the commands to get started without visualization:

python -m venv venv
source venv/bin/activate
pip install -v -e .

For manual setup with both backend and frontend:

Backend:

python -m venv venv
source venv/bin/activate
pip install -v -e .
pip install -r backend/requirements.txt
cd backend
python server.py

To specify a custom backend port:

python server.py --port 8080

Frontend:

cd frontend
npm install
npm start

To specify a custom frontend port:

PORT=8000 npm start

This setup launches the backend server and the React frontend, letting you observe the recursive planning process live in your browser.

Verdict: who WriteHERE is for and what to expect

WriteHERE offers an insightful, research-grade framework for AI-assisted long-form writing that goes beyond typical linear pipelines by dynamically planning heterogeneous subtasks recursively. Its real-time visualization of the AI agent’s thought process is a rare and useful feature for debugging and understanding AI behavior.

It is well suited for researchers, AI developers, or advanced practitioners interested in building or experimenting with agentic AI writing systems, especially those focused on recursive task planning and multi-step reasoning.

The tradeoff is complexity and dependency on external APIs, which means it’s not a drop-in solution for simple writing automation or high-throughput production use cases. The system’s overhead and recursive nature may also add latency.

Still, the code is surprisingly clean, and the modular architecture lets you extend or adapt the recursive planning engine to other domains if desired. Worth understanding even if you don’t adopt it fully.

If you want to explore how an AI agent can think through writing by recursively breaking down tasks while you watch, WriteHERE is a practical open-source project to try.


→ GitHub Repo: principia-ai/WriteHERE ⭐ 905 · Python