How Rewritelyapp works

The product isn’t the polish.
The product is the pipeline.

A Custom GPT can approximate our polish prompt. It can’t reproduce the persistent voice fingerprint, the multi-detector validation loop, the citation tooling, or the deadline awareness. This page is the technical companion to Application Bundle and Research Paper. Skip if you don’t care how the sausage is made.

The stack

Two vendors. Six primitives. One product.

Everything runs on Google Cloud (Vertex AI for models, GCP for infrastructure) plus Supabase for data. Single bill, single region, single trust boundary — which matters when an institutional buyer asks for one DPA.

Google Cloud · Vertex AI

Claude + Gemini via Model Garden

Gemini 2.5 Flash + Pro for polish via Vertex AI; Gemini embeddings (768-dim) for voice consistency + RAG retrieval; Vertex AI context caching; pgvector HNSW similarity in Supabase. Multi-signal detector pipeline + journal-style retrieval in development. All in europe-west4.

Google Cloud · Infrastructure

GCP, europe-west1

Cloud Run (app + PDF export), Cloud Tasks (bundle orchestration), Cloud Scheduler (deadline intelligence), Document AI (citation tooling), BigQuery (detector audit log), (server signing in development) (PDF signing).

Supabase

Supabase, EU region

Postgres + pgvector for voice fingerprint storage and HNSW similarity search, Row-Level Security, Auth, Realtime for collaborative review, Storage for encrypted documents.

Why one vendor matters: Vertex AI gives us model-agnostic access (Claude today, Gemini tomorrow if pricing shifts, Llama or Mistral if compliance demands open weights), one regional residency story, one DPA template, and one billing line. The €2,000 GCP credit now covers model spend alongside the infrastructure — extending our paid-free runway from ~12 months to ~18.
Capabilities

Six things the pipeline does that no Skill / Custom GPT can.

01

Persistent voice fingerprint

Every saved document is embedded into a 1,536-dim vector and stored in Supabase pgvector. Polish prompts are constrained to land within the 95th-percentile cosine-distance contour from the user’s voice centroid. The polish on doc #15 reads more like the user than doc #1 did.

Why Skills can’t: stateless across chats, no document memory, no embedding column, no constraint mechanism.

Built on:
Supabase pgvector
Vertex AI text-embedding-005
Gemini embeddings (cross-check)
~$0.13/M tokens
02

Multi-signal AI-likeness validation

Every polish queues a Cloud Task. batch inference (in development) runs the output through the 5-signal in-house detector (in development): stylometric, perplexity, burstiness, semantic novelty, Gemini classifier. Per-document verdicts written to BigQuery. The Disclosure Bundle attaches the actual API responses, not a screenshot.

Why Skills can’t: no infrastructure for outbound paid API calls; no persistent verdict storage; can’t produce a downloadable artifact.

Built on:
Cloud Tasks + Scheduler
Vertex AI (Gemini Pro for paid polish)
5 detector APIs
BigQuery audit log
~$40–80 / week at scale
03

Citation-aware (in development) extraction

Upload .docx, .tex, or .pdf. Google Document AI extracts structure first, sections, citations, equations, tables, with bounding boxes. The polish model only sees prose tokens; protected entities pass through as placeholders. Reassembly is deterministic and bit-perfect.

Why Skills can’t: raw text in, raw text out, no structured extraction step. Citation rewrites happen ~5% of the time at Discussion-section length.

Built on:
Google Document AI
Custom processor (citations)
$0.0015 / page
04

Deadline awareness (in development)

Application Bundle is a Cloud Tasks state machine, not a single document. Per-applicant state in Supabase, deadline schedule built from the school’s known due date, per-document polish passes orchestrated and rate-limited. Cloud Scheduler triggers per-user evaluations daily and Resend sends the nudge email when a document needs attention.

Why Skills can’t: a chat session has no concept of a deadline, no multi-document state, no scheduled actions, and no email delivery.

Built on:
Cloud Tasks
Cloud Scheduler
Supabase state machine
Resend email
~free at our scale
05

Journal style guide RAG

Per-journal style retrieval indexed in pgvector retrieval. When polishing a Methods section for Bioinformatics, the polish prompt retrieves the relevant 8–12 chunks live and includes them in cached context. Adding a new journal becomes ‘drop a PDF in a bucket’.

Why Skills can’t: static prompt size budget; can’t hold Per-target style retrieval in one chat; can’t retrieve by section.

Built on:
pgvector retrieval
Vertex AI context caching
~$2 / 1K queries
06

The Disclosure Bundle, the artifact we sell

At export, Cloud Run + headless Chrome compiles a 14-page PDF: every polished document, every edit annotated with reasoning, every detector verdict from real API runs, voice fingerprint summary, and a ready-to-paste disclosure sentence. SHA-256 signed and timestamped via (server signing in development). This is the artifact your reviewer can accept, not a chat log.

Why Skills can’t: no PDF generation, no signed artifacts, no reproducible audit trail. See a sample →

Built on:
Cloud Run
Headless Chrome
(server signing in development) signing
~$0.04 / bundle
End-to-end

What happens when you polish a document.

  Upload (.docx/.tex/.pdf)
        │
        ▼
  ┌──────────────────────────────────────────┐
  │ 1. Document AI  ─ structure extraction   │  Google Cloud
  │    citations, equations, tables          │  ($0.0015/page)
  └──────────────────────────────────────────┘
        │
        ▼
  ┌──────────────────────────────────────────┐
  │ 2. Signal detection (14 AI-typical)      │  Gemini 2.5 Pro
  │    + section classifier for papers       │  + Rewritelyapp adapter
  └──────────────────────────────────────────┘
        │
        ▼
  ┌──────────────────────────────────────────┐
  │ 3. pgvector retrieval ─ style-guide RAG    │  Google Cloud
  │    pulls relevant rules for THIS section │  (~$2/1K queries)
  └──────────────────────────────────────────┘
        │
        ▼
  ┌──────────────────────────────────────────┐
  │ 4. pgvector lookup ─ user voice envelope │  Supabase
  │    + 50 nearest admitted-statement refs  │  (HNSW index)
  └──────────────────────────────────────────┘
        │
        ▼
  ┌──────────────────────────────────────────┐
  │ 5. Constrained polish                    │  Gemini 2.5 Pro
  │    voice envelope + protected entities   │  prompt-cached
  └──────────────────────────────────────────┘
        │
        ▼
  ┌──────────────────────────────────────────┐
  │ 6. Validation + revert                   │  ensemble check
  │    rubric, detector, voice constraints   │  any regression → revert
  └──────────────────────────────────────────┘
        │
        ▼
  ┌──────────────────────────────────────────┐
  │ 7. Cloud Tasks ─ enqueue nightly         │  → 5 detector APIs
  │    batch validation                      │    via the multi-signal detector
  └──────────────────────────────────────────┘
        │
        ▼
  ┌──────────────────────────────────────────┐
  │ 8. Disclosure Bundle PDF on demand       │  Cloud Run + Chrome
  │    14 pages, signed, timestamped         │  ($0.04/bundle)
  └──────────────────────────────────────────┘

  Median wall-clock: 2.4s per 500 words polished + overnight detector run
      
Why this is possible at our scale

The €2,000 GCP credit covers ~18 months — including model spend.

ComponentRate12-month spend (est.)
Cloud Tasks + Scheduler (orchestration)Per-call, negligible~€20
Document AI (citation tooling)$0.0015 / page~€150
pgvector retrieval (style-guide RAG)$2 / 1K queries~€240
Cloud Run (app + PDF export)Per-second compute~€180
BigQuery (detector audit log)1TB free / month~€0
5 detector API subscriptionsVariable~€800
Vertex AI · Gemini 2.5 polish (with caching)~$0.0008 / 1K cached tokens~€420
Vertex AI · Gemini embeddings (voice fingerprint)$0.13 / M tokens~€60
Total against GCP credit (incl. model)~€1,870 / €2,000

By the time the credit runs out, the orchestrated Application Bundle business should be paying for itself. If it isn’t, the bet was wrong, and we learn that within a year, not three.

Now try it on something of yours.

The architecture is only impressive when it shows up in your diff. Paste one paragraph, the pipeline runs the same as for a paying user.

Try free →