# Repository Briefing: principia-ai/WriteHERE
> Source: https://repoforai.com/repo/principia-ai/WriteHERE (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/principia-ai/WriteHERE
- **Official Docs / Website**: https://principia-ai.github.io/WriteHERE/
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: See repository
- **Engineering Health**: C (43/100 · Maintenance 12/35 · Adoption 19/25 · Releases 6/20 · License 6/20)
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Self-Hosted, CLI
- **Momentum**: 979 ★ total (+1 24h / +3 7d) · 144 forks
- **Topics**: `agentic-workflow`, `ai-agents`, `ai-writing`, `creative-writing-ai`, `deep-research`, `planning`
- **When to Use**: Best for: Research teams and developers prototyping long-form workflows in which retrieval and drafting can reshape the task plan, with either JSONL batch output or a live task view. Skip if: You need verified offline inference, fixed per-job budgets, publication-ready source verification, or cleared commercial licensing before deployment.

## Overview
```text
### Architecture & Core Mechanics
WriteHERE is a Python writing agent that alternates between decomposing a task and executing subtasks. Instead of fixing a complete outline before drafting, it can use results from retrieval, reasoning, and composition to decide what to do next. `recursive/engine.py` is the entrypoint, `graph.py` represents the task graph, and `memory.py` and `cache.py` separate memory and caching concerns.

The code layout puts agent logic and prompts in `recursive/agent/`, execution modules in `recursive/executor/`, and model integrations in `recursive/llm/`. The optional React UI runs alongside a Flask backend launched via `backend/server.py`. Dependencies include Flask-SocketIO, DuckDuckGo search, Trafilatura, and LangChain text splitters. These establish available libraries, not a guaranteed transport, retrieval pipeline, or stable plugin API.

### Key Capabilities & Differentiators
The CLI supports `--mode story` for fiction and `--mode report` for technical reports. The sample commands pair `test_data/meta_fiction.jsonl` with `gpt-4o` and `test_data/qa_test.jsonl` with `claude-3-sonnet`. Both specify a JSONL output path and an independent completion marker through `--output-filename` and `--done-flag-file`. Treat the model IDs as example configurations, not guarantees of current provider availability.

The visualization shows task hierarchy, task type, and ready, in-progress, and completed states. That helps operators see where work is happening; it does not expose a model's private reasoning or prove a report's sources are correct. Report search setup lists a SerpAPI key, while the manifest also includes a DuckDuckGo library. The manifest lists Google Generative AI and boto3 as well, but does not establish runnable Gemini or Bedrock configurations.

### Trade-offs & Limitations
Recursive planning is useful when an initial outline would lock in decisions before research or drafting reveals what is missing. In return, the number and order of subtasks are less predictable than in an outline-first pipeline. When subtasks invoke models or search services, that variability affects latency and cost. Test representative story and report jobs before budgeting; no numerical benchmark, per-job cost, or runtime bound is established here.

Use the CLI when batch output is sufficient and add the UI when someone needs to inspect task progress. The visualized task graph is not a substitute for checking factual accuracy or citations. Deployment also needs two independent checks: validate the dependency stack, which pins Flask 2.0.1 and Werkzeug 2.0.3, and resolve the licensing discrepancy. The README names MIT, but the referenced LICENSE is not visible in the root tree and metadata lists the license as unspecified.

### Hardware & Deployment Guide
The CLI setup uses a Python virtual environment, `pip install -v -e .`, and credentials in `recursive/api_key.env`. The optional browser UI adds Node.js and can be launched with `setup_env.sh` followed by `start.sh`, defaulting to backend port 5001 and frontend port 3000. `run_with_anaconda.sh` provides another environment setup path. The stated minimums are Python 3.6+ and Node.js 14+; verify current dependency resolution instead of assuming those minimums still work.

Self-hosting runs the orchestration and UI on your infrastructure; it does not make hosted model or search calls offline. No local inference or GPU/CUDA requirement is established for the documented path. Size the host for concurrent Python jobs and retrieval, plus the web stack if enabled. No container manifest or tagged release is shown, so pin the revision you test and treat the provided launch commands as local setup, not a production deployment specification.
```

## Key Capabilities
```text
- Planning: Recursive decomposition and execution interleave, so intermediate results can alter later tasks.
- Task types: Retrieval, reasoning, and composition appear in a hierarchical task graph.
- Visibility: The React UI shows task hierarchy, type, and ready, in-progress, or completed status.
- Batch interface: The Python CLI examples use JSONL input and output plus a separate completion marker.
- Provider evidence: CLI examples cover GPT-4o and Claude 3 Sonnet; additional SDKs do not establish supported configurations.
- Deployment: The headless engine runs separately from the optional Flask backend and React frontend.
```

## Quick Start / Clone
```bash
python -m venv venv
source venv/bin/activate
pip install -v -e .

# Create api_key.env file based on example
cp recursive/api_key.env.example recursive/api_key.env
# Edit the file to add your keys
nano recursive/api_key.env
```
