Moderator Agent is a multi-tenant, real-time AI moderation system for YouTube live chat. It watches a live stream's chat as messages come in, classifies each one with an LLM, and automatically deletes or times out anything that breaks the rules, hate speech, harassment, toxicity, or spam, within milliseconds, with no human moderator on standby. It's currently running in production for live streamers and their moderation teams, handling real chat traffic at scale.
- Real-time classification of every chat message via an LLM (Gemini/OpenAI), returning a structured decision: violation type, suggested action, confidence score, and reasoning.
- Automatic enforcement actions, message deletion for spam/toxicity/ harassment, and timeouts for repeated or severe hate speech, applied directly through the YouTube Live Chat API.
- Multi-tenant by design, each streamer/channel is isolated and processed independently, with chat events partitioned and ordered per tenant.
- Every decision is persisted to a full audit log (message, author, action taken, violation type, confidence, and reasoning) for transparency and dispute review.
- A local deterministic heuristic fallback keeps the pipeline running even if the LLM call fails or times out, so moderation never goes silent.
- StatusLive in production, in daily use by real YouTube streaming channels and their moderation teams
- RoleBackend & AI Engineer (end-to-end)
- PlatformBackend service (YouTube Live Chat integration)
- StackJava 21, Spring Boot, Apache Kafka (KRaft), PostgreSQL, Docker, Gemini / OpenAI, YouTube Live Chat API
- Source CodePrivate repository
Branding

Moderator Agent Logo & Wordmark
Architecture
Moderator Agent is built as an event-driven pipeline on Apache Kafka so that chat ingestion, moderation, and enforcement are fully decoupled and can scale independently. Every chat message is produced onto a raw-chat-events topic, keyed by tenant ID, so a single channel's messages stay strictly ordered on one partition while different channels are processed in parallel and isolated from each other.
A moderation consumer picks up each raw event and calls an LLM (Gemini or OpenAI, configurable) with a strict system prompt and a JSON schema response, asking it to classify the message as a violation type (toxicity, harassment, hate speech, spam, or none) with a suggested action, a confidence score, and a short reasoning string. If a violation is found, the decision is republished onto a mod-actions topic, again keyed by tenant. A second consumer picks up that action, executes it against the YouTube Live Chat API (deleting the message, and issuing a timeout for repeated or severe hate speech/harassment), and writes a full audit record to PostgreSQL, capturing the message, author, action taken, violation type, confidence score, and reasoning for later review.
- Ingestion — chat events land on a tenant-keyed Kafka topic, keeping per-channel ordering while scaling horizontally across channels.
- Moderation — an LLM client enforces a structured JSON schema on every response, with a deterministic keyword-based heuristic as an automatic fallback if the LLM call fails or times out.
- Enforcement — a second Kafka consumer executes the decision against the YouTube Live Chat API and writes an immutable audit log to PostgreSQL for every action taken.
- Deployment — packaged as a Spring Boot service with Kafka and PostgreSQL running alongside it in Docker, so the whole pipeline ships as a single reproducible unit.
Moderator Agent runs in production today, actively used by several successful Myanmar streamers and YouTubers with hundreds of thousands of subscribers, including caster ZyZy, BZTV, Bo Kyar Channel, and The United Show, moderating their live chat in real time during active streams.
Trusted By

caster ZyZy
834K subs

BZTV
459K subs

Bo Kyar Channel
557K subs

The United Show
421K subs