OpenScreenplay docs
ENالعربية
docs / rawi / v2

Rawi v2: how one chat message flows

Rawi now plans before it writes. A fast model reads the message and writes a short plan (the Brief). The main model then writes the reply from that plan and only the screenplay parts it needs.

AI models Database, wallet, live updates Writer's screen Server and tools Only in some cases
  • SmarterPlans first, so it works on the right phase, section or scene.
  • Faster and cheaperA small model plans; follow-ups like “yes” skip planning.
  • ReliableIf planning fails, v1 answers. Stuck replies are cleaned up.
  • Writer in controlAccept, Dismiss, Stop, Continue, Discard; see and delete memory.
  • Clear costOne charge per message; cost per screenplay can be shown.
  • EngagementSuggests open contests the screenplay can still enter.
1 / 4

The big picture

Writer's screenchat panelor start pageWeb serverDjangoruns each turn in abackground thread,saves everythingStage 1 · Dramaturgeplans, writes the Brieffast model (Haiku)Toolsread-only lookupsaccess-checkedStage 2 · Narratorwrites the replymain modelv1 fallbackold one-call Rawimain modelLive updatesRedis StreamWalletCredits · MySQLDatabasechat, screenplay,suggestions, turn logmessageturn idmessage + contextthe Briefstreams replycallsreadsif it failsreply, the old wayhold, then settlesaves chat + turn logwrites statuspage polls
The server answers the writer at once with a turn id and runs the AI work in the background. The page polls GET /api/v2/ai/turns/<id>/events/ for progress and the final reply. The message itself arrives at POST /api/v2/ai/chat/. Only writers with Rawi v2 turned on (beta) take this path; everyone else stays on v1.
2 / 4

One message, step by step

1Receivethe writer's message arrives2Build the contextwriter, screenplay, active step, access3Lockone running reply per conversation4Hold Creditsreserve the estimate for both stages5Save the writer's messageit shows on screen right away6Stage 1 · Dramaturge planstools → Brief → server checks it7Choose the Narratorlight reply → faster model8Stage 2 · Narrator writesstreams reply + suggestion cards9Save and settlesave reply · one charge · turn logAfter the replybackground: remember notes, chat titlePreparing…Planning…Writing…Saving…Sent twice?return the earlier answer,don't run it againAnother reply running?this message waitsor is refusedNot enough Credits?stop here andtell the writerPlanning fails?v1 fallback answers theold way, then step 9Writer presses Stopsaves and charges the partwritten; Continue or DiscardAI error in stage 2?no Narrator charge,writer can retryCrash or deploy mid-reply?cleanup closes the turnand releases the holdShort follow-up?“yes”, “the second one”,“shorter”: reuse last Briefshortcutskip planning
Green chips are the status the writer sees. The Brief says the target phase and item, the intent (create, revise, agree, question, navigate), whether to offer suggestions, and which screenplay parts the Narrator needs. The server fixes small mistakes in it and rejects targets the writer may not touch.
3 / 4

Suggestions loop

1 · Rawi suggestscards with Accept buttons2 · Writer decidesAccept · Dismiss · Change pick3 · Note in chat history“Applied…” “Dismissed…” “Changed…”4 · Next messageRawi knows what was keptAccept applies itto the screenplaysame loop in every phase
Every action leaves a short plain note in the chat, so on the next message Rawi knows exactly what was kept and what wasn't.
PhaseWhat Rawi can suggest
Start page / InfoGenre and sub-genre (including an “Other” sub-genre), logline, title
CharactersSeveral versions of character fields
Story outlineContent for an act or section, in every story structure
Scene outlineNew scenes or edits, even inside a closed section
ScriptScript pages for a scene, inserted as a [Rawi] draft
4 / 4

Credits: hold, then settle

Message sentHoldestimate, both stagesStage 1 runsDramaturgeStage 2 runsNarratorSettlecharge real useHoldreserved: estimate for both stagesSettlestage 1stage 2released backthe writer sees one charge
Bar lengths are illustrative. The hold is taken before any AI call; if the wallet can't cover it, the turn stops before anything runs.
Writer presses StopCharged only for what was written.
Stage 2 AI errorNothing charged for the Narrator; the writer can retry.
Crash or deployA cleanup job closes the turn and releases the hold.