AI chatbot agents with a multi-layered content safety filter. Create conversations with different agent personalities, each powered by Google Gemini.
- Direct - Conversational AI assistant
- Thinker - Shows reasoning step by step (chain of thought)
- Critic - Analyzes and critiques responses
Four-layer filtering system that catches toxic content, profanity, and evasion attempts:
- Text normalization - Strips character substitutions, Unicode tricks, leetspeak, and spacing evasion before checking
- Keyword blocklist - Curated list of blocked terms checked against the normalized text
- TF.js toxicity model - ML-based context-aware toxicity detection that understands intent, not just keywords
- Expanded text check - Reassembles spaced-out letters and re-runs through the toxicity model to catch creative evasion
Blocked messages show what was detected and are visually marked in the conversation.
- React 19, TypeScript, Vite, Tailwind CSS
- Google Gemini API (free tier)
- TensorFlow.js toxicity model (client-side)
npm install
echo "VITE_GEMINI_API_KEY=your-key" > .env
npm run devGet a free Gemini API key at https://aistudio.google.com/apikey
- Create React App, plain JavaScript
- Peer-to-peer chat with Firebase Auth and Firestore
- Single TF.js toxicity check on outgoing messages
- moment.js for timestamps
- One 420-line CSS file
- Monolithic Home.js component handling everything
- Vite + TypeScript + Tailwind CSS
- AI chatbot agents powered by Gemini (Direct, Thinker, Critic)
- Four-layer content filter (normalization, blocklist, TF.js, expanded text)
- No auth required, all state is local
- Model fallback chain (tries multiple Gemini models on rate limit)
- Streaming responses with typing indicator
- Mobile-responsive sidebar with agent management (create, rename, delete)
- Chain-of-thought reasoning steps displayed inline
- Critic annotations with severity levels
