Skip to main content

AIWriter: AI-Powered Essay Writing and Improvement Tool

AIWriter is an intelligent writing assistant that leverages AI to write, evaluate, and iteratively improve essays and articles. Using an agent-based approach, it takes a prompt and relevant context, then refines drafts until they meet quality criteria.

Features

  • Autonomous Essay Improvement: Writes and refines drafts until they meet quality standards
  • Context Builder: Fetches and parses content from URLs to use as reference material
  • Multi-criteria Evaluation: Scores essays on clarity, conciseness, relevance, engagement, and accuracy
  • Insight Generator: Analyzes drafts and suggests specific improvements
  • Customizable Output: Control essay length, style, and target audience

Installation

pip install aiwriter

Quick Start

# Set your API key
export ANTHROPIC_API_KEY="sk-ant-..." # the default model is anthropic's
# if using an openai model, use OPENAI_API_KEY, if using another provider, use "<PROVIDER_NAME>_API_KEY"

# Run the agent loop to write and iteratively improve an essay
aiwriter editor "Write an article about climate change solutions"

Core Commands

# Full agent loop - writes and iteratively improves essay
aiwriter editor "Write an article about renewable energy" --length 1500

# Single essay generation without iteration
aiwriter write "Write a poem about the ocean" --style poetic --audience "children"

# Score an existing essay
aiwriter rank "$(cat my_essay.txt)"

# Extract insights from an essay
aiwriter think "$(cat my_essay.txt)"

# Build context from a list of URLs
aiwriter build < urls.txt > context.md

# Show detailed help
aiwriter help

Using Context from URLs

You can provide a list of URLs to be used as source material for your essay:

# Create a file with URLs (one per line)
echo "
https://example.com/article1
https://example.com/article2
https://example.com/article3
" > context.txt

# Run with this context
aiwriter editor "Summarize the key points from these articles"

Customizing the Criteria

By default, essays are scored on clarity, conciseness, relevance, engagement, and accuracy. You can customize this:

# Create a custom criteria file
echo "clarity,innovation,technical_depth,practical_application" > criteria.txt

# Set the environment variable
export AIWRITER_CRITERIA="criteria.txt"

# Run with custom criteria
aiwriter editor "Write a technical deep-dive on machine learning"

Configuration

Environment Variables

Variable Description Default
ANTHROPIC_API_KEY API key for Anthropic (required)
AIWRITER_MODEL AI model to use anthropic/claude-sonnet-4-20250514
AIWRITER_CONTEXT_FILE Input file with URLs context.txt
AIWRITER_CONTEXT_FULL_FILE Output file for parsed context full_context.txt
AIWRITER_CRITERIA Criteria file path criteria.txt
AIWRITER_DRAFTS_DIR Directory for draft outputs drafts/

How It Works

AIWriter uses a multi-agent system to progressively improve essays:

  1. Context Builder: Parses URLs and builds initial context
  2. Writer: Generates an essay based on the prompt and context
  3. Ranker: Evaluates the essay against multiple criteria
  4. Thinker: Analyzes the essay and provides insights for improvement
  5. Editor: Orchestrates the entire process, managing iterations

Architecture

flowchart TD
    A([URLs]) --> B(Context Builder)
    AA([Topic]) --> B(Context Builder)
    B --> C([Prompt])
    B --> J(Thinker)
    C --> D(Writer)
    D --> E([Draft])
    E --> F(Ranker)
    F --> FF([Scored Draft])
    H([Criteria]) --> F
    FF --> G{Editor}
    I([Past Runs]) --> G
    G --> B
    G --> J
    J --> G

    style B fill:#fd0795,color:black,font-weight:bold
    style D fill:#00b5d7,color:black,font-weight:bold
    style F fill:#ff9000,color:black,font-weight:bold
    style G fill:#ffb901,color:black,font-weight:bold
    style J fill:#2a9d8f,color:black,font-weight:bold

License

GPL 3.0

Metadata

Release files for aiwriter 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiwriter 0.1.3
File Size Uploaded Provenance Actions
aiwriter-0.1.3.tar.gz 21.5 kB Without provenance Details for aiwriter-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aiwriter 0.1.3
File Interpreter ABI Platform Actions
aiwriter-0.1.3-py3-none-any.whl Python 3 none any Details for aiwriter-0.1.3-py3-none-any.whl

Total release size: 44.2 kB

Release files / aiwriter-0.1.3.tar.gz

Download URL aiwriter-0.1.3.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a8c51f91d3629a4812c5b76e95b926b517d6ef25df95e666986815e92aa239b0
BLAKE2b-256 checksum
How to use checksums
da689a9059c54a6eb85f78e4f507183d753252a83e429bebd43ec97cbc9ae170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.9

Release files / aiwriter-0.1.3-py3-none-any.whl

Download URL aiwriter-0.1.3-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bf91dd40f42505d0f75bf5144c5a727fd5fffb06935a4f6a04b54503fc08f60
BLAKE2b-256 checksum
How to use checksums
b3f187721a76277e07fe4d570f9f1a97502523a5ff75f722e29e3d3e51ec5bbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.9

Security for aiwriter 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page