AMIS — AI Moderation Intelligence System
Inspiration
Online communities are growing faster than human moderation teams can scale. Most moderation tools today are either simplistic keyword filters that fail on nuance or expensive AI systems that send every request through an LLM, making them costly and difficult to scale.
We wanted to explore whether it was possible to build a real-time AI moderation system that was:
- fast,
- cost-efficient,
- explainable,
- and deployable entirely inside Reddit’s constrained Devvit serverless environment.
The challenge became even more interesting because Devvit imposes strict limitations:
- 3-second execution windows,
- KV-only persistence,
- no traditional backend servers,
- limited UI capabilities,
- strict rate limits.
Instead of treating those as blockers, we designed the entire architecture around those constraints.
What it does
AMIS (AI Moderation Intelligence System) is an AI-powered Reddit moderation platform that helps moderators analyze and triage content in real time.
The platform:
- ingests subreddit posts automatically,
- compares them against subreddit policies,
- performs semantic analysis using embeddings + LLMs,
- and surfaces moderation recommendations through a custom live dashboard embedded directly inside Reddit.
Key capabilities include:
- real-time moderation analysis,
- embedding-based semantic policy matching,
- AI-assisted moderation recommendations,
- duplicate content detection,
- moderator consistency analysis,
- persistent moderation history,
- multi-provider AI support,
- cost-aware LLM routing,
- background queue orchestration.
AMIS supports:
- OpenAI,
- Google Gemini,
- Anthropic Claude,
- and local/self-hosted OpenAI-compatible models like Ollama.
How we built it
The system was built entirely on Reddit’s Devvit platform using TypeScript and a serverless architecture.
Core Architecture
We designed a two-tier AI moderation pipeline:
Embedding Similarity → Cheap Decision
Uncertain Cases → LLM Escalation
Every submitted post goes through:
- embedding generation,
- cosine similarity matching against subreddit rules,
- confidence evaluation,
- optional LLM escalation,
- recommendation generation.
Cost-Aware AI Routing
One of the biggest engineering goals was minimizing unnecessary LLM calls.
We implemented threshold-based routing:
similarity < 0.45 → auto approve
similarity > 0.85 → auto flag
0.45–0.85 → LLM classification
This reduced LLM API usage by roughly 60–70%.
Background Processing
Since Devvit UI actions timeout after 3 seconds, we moved long-running tasks into scheduled background jobs using Devvit Scheduler.
We built:
- queue processors,
- retry systems,
- exponential backoff handling,
- async-safe workflows,
- cache layers,
- stale-data filtering.
Dashboard & UX
We also built a fully interactive moderation dashboard directly inside Reddit using Devvit Block Kit.
Features include:
- live moderation queue,
- auto-refreshing views,
- moderation history,
- consistency insights,
- live countdown banners,
- filter chips,
- pagination.
Challenges we ran into
Platform Constraints
The biggest challenge was engineering inside a heavily constrained serverless environment:
- no traditional backend,
- no database,
- KV-only storage,
- hard execution limits,
- fixed-height UI constraints,
- no native scrolling.
Many common architectural approaches simply were not possible.
We had to redesign:
- queue orchestration,
- state synchronization,
- async execution,
- caching,
- and UI rendering specifically for Devvit.
AI Reliability
Moderation is difficult because rules vary dramatically.
Some rules are structural:
- “Titles cannot start with A”
Others are semantic:
- “No misinformation”
We had to engineer prompts and fallback systems capable of handling both categories reliably.
We also built:
- resilient JSON parsing,
- markdown cleanup,
- fallback classification,
- embedding-only recovery flows.
Cost Optimization
Naively calling an LLM for every post would have made the platform extremely expensive.
Designing an intelligent routing system that balanced:
- cost,
- accuracy,
- speed,
- and moderation quality
became one of the hardest and most rewarding engineering problems in the project.
Accomplishments that we're proud of
- Built and deployed a production AI moderation platform entirely inside Reddit’s Devvit ecosystem
- Reduced LLM usage by ~60–70% using embedding-based routing
- Achieved near real-time moderation analysis (<5 seconds)
- Successfully orchestrated distributed AI workflows without dedicated backend servers
- Built a multi-provider AI abstraction layer supporting OpenAI, Gemini, Claude, and local models
- Designed a moderation dashboard with live updates and persistent history
- Implemented moderator consistency analysis and duplicate detection systems
- Engineered reliable background queue processing inside strict serverless constraints
What we learned
This project taught us a huge amount about:
- distributed systems,
- AI infrastructure,
- vector embeddings,
- prompt engineering,
- serverless orchestration,
- async workflows,
- reliability engineering,
- and platform-aware architecture.
More importantly, we learned that production AI systems are far more about:
- orchestration,
- caching,
- retries,
- latency,
- reliability,
- and cost optimization
than simply calling an LLM API.
We also learned how much thoughtful system design matters when operating under hard platform constraints.
What's next for AMIS — AI Moderation Intelligence System
We want to evolve AMIS from a Reddit moderation assistant into a generalized AI moderation and policy intelligence platform.
Future plans include:
- cross-platform moderation support,
- smarter agentic moderation workflows,
- adaptive moderation learning,
- moderator behavior analytics,
- improved explainability,
- real-time policy evolution,
- collaborative moderation intelligence,
- and scalable trust & safety infrastructure.
Long term, we envision AMIS becoming an AI-native moderation layer for communities, marketplaces, forums, and collaborative platforms.
Built With
- async
- claude
- cosine-similarity-search
- devvit-block-kit
- devvit-kv-store
- devvit-scheduler
- gemini
- jest
- ollama
- openai-gpt-4o
- queue
- reddit-devvit
- serverless-architecture
- typescript
- vector-embeddings
Log in or sign up for Devpost to join the conversation.