Architecture · open by design

How TweetX actually writes like you

No black box. Every reply + post goes through a multi-agent pipeline with Humanizer §1..§33 enforcement and XDS behavioral context. Below: the architecture in full.

33-pattern Humanizer skill

Ported from github.com/blader/humanizer (MIT). Wired as system-prompt + auto-fix + verifier veto. Em-dashes have 3 layers of defense.

XDS (X Discipline Score)

FDS-mirrored: CC 30% · OF 20% · GA 20% · EP 15% · CR 15% × Recency Bias × Trending Behaviour. Identity layer like AMY but for X voice.

Multi-agent verifier loop

Agent 1 generates with persona + selfTweets + Humanizer rules. Agents 2 + 3 judge for AI-tells and voice match. Humanizer Lint runs 25 regex patterns. Up to 3 retries with explicit feedback.

Viral monitor

Every 4h, scans your inspiration handles for tweets spiking ≥ 3× their baseline. Telegram-pings paid users. One-click "draft yours" with the viral hook shape.

Figure 1

Reply & Post Generation Pipeline

The current architecture: 3 agents + cleanAiOutput + Humanizer Lint, with retry feedback loop. Same pipeline for replies and posts.

Reply & Post Generation Pipeline
Click to view SVG (zoomable) →
Figure 2

With Behavioral Intelligence (XDS) added

XDS — a 1:1 port of the SAVED AI FDS pattern — runs as a separate layer on top. Closed-loop analytics feed back into the generation system prompt.

With Behavioral Intelligence (XDS) added
Click to view SVG (zoomable) →
Figure 3

XDS → Generation feedback loop

Where each of the 4 XDS payloads (persona augment, format bias, viral template, avoid-list) plugs into the existing pipeline.

XDS → Generation feedback loop
Click to view SVG (zoomable) →

Technical specs (read the source)

The stack

Frontend (web app)Next.js 15 App Router · TypeScript · Tailwind · @supabase/ssr
Frontend (extension)Vite · React · TypeScript · MV3 service worker · @supabase/supabase-js
BackendSupabase (Postgres + Auth + Edge Functions on Deno) · pg_cron · pg_net
LLM routingOpenRouter — Gemini 2.5 Flash (free), GPT-4o-mini (Pro), GPT-4o (Growth), with automatic fallback to gpt-4o-mini on 404/5xx
X APIOAuth 2.0 PKCE per user · App-only Bearer for read-only · Pay-per-Use credits
Telegram bot@TweetXAI_bot · webhook-driven · NL intent classifier (Gemini 2.5 Flash Lite)
HostingVercel (web) · Supabase Edge Functions (compute) · Chrome Web Store (extension)
Sourcegithub.com/aariz51

Ready to use it?

Open the web app, install the Chrome extension, or chat with the Telegram bot. Same backend, same humanizer, same pipeline.