Commonplace

Tools

Things this server runs for other software. Nothing here is a page to use directly.

Persona Reader API

API endpoint · no UI checking…

This is a server endpoint, not a tool you click through. It scores every sentence of an article the way a chosen finance persona would read it — salience (how much of that reader's attention the sentence takes) and valence (whether it helps or hurts that reader's mandate) — with one Claude call per request.

Its only client is the FT Persona Reader Safari extension (repo hackathon_ai_personas, folder extensions production/). The extension sends the FT.com article you're reading here and restyles it in place from the reply: bigger and bolder where the persona looks hardest, green where a sentence helps its mandate, red where it hurts it. Nine personas: the seven finance readers, plus a Chief Risk Officer rebuilt from eight conditions that never name the role and a wrong-conditions control.

Base URL

/api/persona_reader

Endpoints

CallBodyReturns
GET /health — {ok, model, personas:[{id,name}], configured:{api_key, password}} — booleans only, no values
POST /auth {password} {ok, token} — a signed token valid 30 days
POST /score {token, persona_id, title, paragraphs:[str]} {paragraphs:[{sentences:[{text, salience, valence}]}]}, grouped on the paragraph boundaries sent

Errors come back as {"error": {"code", "message"}}, like the rest of this site's API.

Access

  • Password-gated. POST /auth with the password from PERSONA_READER_PASSWORD returns a token; /score refuses anything without a valid one.
  • Tokens are signed with a key derived from the password, so changing the password signs every client out. No sessions are stored anywhere.
  • Five wrong passwords lock sign-in for 15 minutes for that client; 60 score calls per hour; requests over 200 KB or 150 sentences are refused. All per worker process.

Configuration

Two lines in /var/www/vocabapp/.env on the VM, then sudo systemctl restart vocabapp:

  • ANTHROPIC_API_KEY — pays for every score call.
  • PERSONA_READER_PASSWORD — letters, digits, _ and - only, unquoted (systemd and python-dotenv disagree about anything fancier).

Each /score is one call to claude-sonnet-5. Nothing is stored: no tables, no migrations, no log of article text. The code is vocabapp/persona_reader.py; the persona prompts are a copy of the ones in the hackathon repo, which remains the source of truth.

Personas

  • Loading…