Introduction
Overview
Gova-backend is an automated content detection and community moderation engine designed to maintain the quality of chat environments. It leverages AI-driven agents to evaluate message context against specific server guidelines, assign severity scores, and facilitate automated or manual escalations.
By integrating directly with platforms like Discord, Gova allows community managers to build user behavior profiles, track toxicity trends, and execute moderator actions—such as timeouts, kicks, or automated replies—through a centralized API.
Core Features
- AI-Powered Moderation: Utilizes a
ReviewAgentwith a specialized system prompt to evaluate messages on a severity scale of 0.0 to 1.0. - Automated Escalation: Detects guideline violations and prepares actions (e.g., Kicking or Timing out users) for moderator approval or automated execution.
- Behavioral Scoring: Tracks historical user behavior over time to identify repeat offenders within a community.
- Multi-Platform Extensibility: Built with a modular architecture to support various messaging platforms, starting with deep Discord integration.
- Proactive Insights: Generates trend data and statistics via dedicated stats endpoints to visualize community health.
System Architecture
The system operates on a loop of Detection, Evaluation, and Action:
- Ingestion: Messages are received from connected platforms (e.g., Discord).
- Evaluation: The
ReviewAgentcompares the message against the definedModeratorconfiguration and server-specific guidelines. - Escalation: If a message exceeds a severity threshold, an
ActionEventis created. - Execution: Based on the moderator's status and configuration, the action is either executed automatically or held for manual approval via the
/actionsAPI.
Key Components
Moderators
A Moderator is a virtual entity representing a specific configuration of the Gova engine for a server. You can create and manage moderators via the /moderators endpoints.
// Example Moderator Configuration
{
"name": "General Chat Sentry",
"platform": "discord",
"platform_server_id": "123456789012345678",
"conf": {
"guidelines": "No hate speech, no spamming links, and maintain professional tone.",
"auto_approve_threshold": 0.8,
"actions_enabled": ["timeout", "reply"]
}
}
Action Events
When the engine detects a violation, it generates an ActionEvent. These events track the lifecycle of a moderation decision, from the initial AI reasoning to the final execution on the platform.
User Connections
Gova uses OAuth2 to securely connect your moderation dashboard to your messaging platforms. This allows the backend to fetch guild lists, channel metadata, and perform administrative actions on your behalf.
Getting Started
Prerequisites
To run the backend, you must have the following installed:
- Docker
- PostgreSQL with the PgVector extension for vector-based context searching.
Basic Workflow
- Authentication: Register and login via
/auth/registerand/auth/login. - Connect Platform: Use the
/auth/discord/oauthflow to link your Discord account. - Deploy Moderator: Create a moderator instance using
/moderators/and provide your specific community guidelines. - Monitor Actions: Use the
/actions/{action_id}/approveendpoint to manually verify AI-suggested escalations.
API Summary
| Category | Endpoint Prefix | Purpose |
| :--- | :--- | :--- |
| Auth | /auth | User registration, login, and OAuth connection management. |
| Moderators | /moderators | Create, update, and fetch stats for your virtual moderation agents. |
| Actions | /actions | Review, approve, or reject pending moderation escalations. |
| Connections | /connections | Manage platform-specific metadata like guild and channel lists. |
| Payments | /payments | Handle subscription tiers (Free/Pro) via Stripe integration. |