Skip to content

Writer AI Agent

Writer AI Agent is a third‑party agent from Writer.com that uses a defined input schema to handle writing tasks. It specializes in generating, refining, and structuring content based on user input, leveraging integrated tools and customizable guidelines to support content planning, drafting, and iterative editing.

Use the AI Refinery SDK and the WriterAIAgent class to integrate your Writer AI Agent.

Workflow Overview

  1. Initialization
    An agent is created in Writer AI Studio and registered in AI Refinery with the api_key_env_var and application_id (see Usage and Quickstart).
  2. Requesting Input Schema
    AI Refinery requests the input schema from the Writer AI Agent.
  3. Preparing Input Schema
    The Writer AI Agent returns its input schema, and AI Refinery structures the request according to that schema.
  4. Sending a Structured Prompt
    AI Refinery sends a schema‑compliant writing prompt to the Writer AI Agent.
  5. Processing
    The Writer AI Agent uses its language model, built‑in utilities (e.g., grammar checking, summarization), and an optional knowledge base to generate content.
  6. Receiving the Response
    The Writer AI Agent returns a schema‑based output to AI Refinery for further integration.

Usage and Quickstart

To set up an AI Refinery project with a WriterAIAgent, follow these steps:

  1. Obtain your API key and applicaion ID from Writer AI Studio:

    • Log in to the platform at https://dev.writer.com/.
    • Click Build an agent, then choose API to create a new agent.
    • Copy the Application ID once the agent is created, which is a UUID string.
    • Navigate to API Keys, find the Production key, and click Reveal key to display <your-writer-api-key>.
    • Store this value as you environment variable.
      export WRITER_AUTH_TOKEN=<your-writer-api-key>
      
  2. Configure api_key_env_var and application_id in your YAML configuration for AI Refinery:

    orchestrator:
      agent_list:
        - agent_name: <your-agent-name> # Required, the name you choose for your WriterAIAgent  
    
    utility_agents:
      - agent_class: WriterAIAgent  # Required and be "WriterAIAgent" for communication with user-established Writer AI Agent
        agent_name: <your-agent-name> # Required, the name you choose for your WriterAIAgent  
        agent_description: <brief description of functionality>  # Optional yet essential description of the utility agent outlining its functions.
        config:
          api_key_env_var: "WRITER_AUTH_TOKEN" # Required for authentication, the name of the environment variable
          application_id: <real-writer-application-id> # Required to access the unique application, actual ID from Writer.
          wait_time: 300 # Optional timeout in seconds
          contexts:   # Optional additional agent contexts 
            - "date"
            - "chat_history"
    

    • api_key_env_var: Name of the environment variable storing your Writer.com API key.
    • application_id: Unique identifier for your Writer AI Agent provided by Writer.com.
    • wait_time: (Optional) Maximum time in seconds to wait for a response.
    • contexts: (Optional) Context keys (e.g., date, chat history) to help the agent understand the writing assignment and prior interactions.

With this configuration, the WriterAIAgent will receive prompts, generate structured outputs, and return them to AI Refinery for further processing or workflow integration.