Spam detection in Decidim with decidim-ai: what it covers and when to set it up
decidim-ai flags likely spam users and content on a Decidim platform so that moderators work from a queue instead of sweeping every new account and post by hand. It relies on a Bayes analyzer to score submissions and a reporting user that files those flags, so flagged items enter the same moderation workflow your team already uses for human reports. Teams usually add it when spam starts arriving in volume, such as after a spam wave on a proposal or comment space, or before a public launch when traffic and registrations are expected to rise. Installing it earlier is cheaper than cleaning up after a flood, because a platform that accepts registrations from the open internet will attract automated sign-ups regardless of how large it is.
Flagging does not remove anything on its own. Flags feed the moderation queue, and a person still decides whether to hide content, block an account or dismiss the flag, so the process needs named moderators, a clear rule for who reviews flags from the reporting user, and a check of false positives from legitimate participants. Because the exact behavior, configuration keys and supported Decidim versions belong to the gem, you should confirm them against the decidim-ai README for the release you plan to run, and check that release against your Decidim line, which is either 0.31 or 0.32 as of the supplied release information. Decidim itself is licensed under AGPL-3.0 and runs on Ruby on Rails and PostgreSQL, so the gem must match the Rails and Ruby versions that your chosen Decidim release requires. Confirm that compatibility in a staging environment before any production install.
What decidim-ai flags and how each part works
decidim-ai adds automated screening to Decidim's existing moderation flow. Each component below affects what gets flagged, how much history the analyzer needs, and what a moderator sees, so confirm each one in the gem's documentation before you rely on it.
Bayes analyzer scoring
The Bayes analyzer assigns a spam score to content and to user profiles based on word patterns learned from labeled examples. It is the decision engine of the gem, so its output is only as good as the examples it was trained on. Confirm in the decidim-ai documentation which content types and user fields it scores, and whether it supports the Decidim version you run.
Reporting user files the flags
decidim-ai acts through a dedicated reporting user that files flags into Decidim's standard moderation queue, so flagged items appear alongside human reports. Moderators should be able to tell that a report came from the automated user rather than a participant. Confirm the account's name, how it is created, and whether it can be disabled or renamed without breaking the integration.
Redis stores analyzer state
The analyzer keeps its learned state in Redis, so Redis availability and persistence decide whether scoring keeps working and whether training survives a restart. Plan the Redis version, memory sizing, persistence settings and network access before installation. Confirm which Redis versions the gem's documentation supports, and check the licensing terms of the Redis build you choose.
Thresholds decide when a flag is raised
Thresholds convert a spam score into a flag decision, and they set the trade-off between missed spam and wrongly flagged legitimate participation. Set them with a test group of known good and known bad content, not from intuition. Confirm the default threshold values, whether they are set per organization or globally, and how a change takes effect.
Training from your own content
The analyzer improves when it learns from the spam and legitimate content your community actually produces, which is why training data is a governance decision. Decide who labels examples, how personal data in training sets is handled, and how often retraining happens. Confirm in the gem's documentation how training is triggered, whether manually or on a schedule, and how existing labels are reset.
What moderators see afterward
Flags land in the moderation queue, where moderators decide whether to hide content, block a user or dismiss the flag. Automated flags should not replace human review, so set a written procedure for each action and keep a record of decisions. Test how flagged items, scores and reporter names appear in the admin panel for your Decidim version before go-live.
How a submission becomes a spam flag for moderators
A participant's profile or content enters the Decidim application server, which passes it to the decidim-ai analyzer. The analyzer reads and writes its state in Redis, which sits on a separate host behind a trust boundary. When the score is above the configured threshold, the reporting user files a flag into the moderation queue, where a moderator makes the decision. Moderator-labeled examples from your own content reach the analyzer through a separate training path. Check that the Redis host is reachable only from the application server and that threshold changes are logged.
Live scoring and training input reach the analyzer by separate paths.
Configuration decisions for the analyzer, Redis and thresholds
This table compares the choices a team makes before installing decidim-ai, from Redis topology and version to threshold strictness, training data and the reporting user. Read each row as a decision with its trade-off, and confirm any threshold or training behavior against the gem's current documentation before you commit.
| Decision | Option | Trade-off | When it fits |
|---|---|---|---|
| Redis topology | Single Redis instance | Simplest to run, but a failed instance stops the analyzer backend until it is restored | Test or small communities where brief loss of spam scoring is acceptable |
| Redis topology | Sentinel-managed replicas | Automatic failover promotes a replica, but you must run at least three Sentinel instances and monitor them | Production platforms where spam scoring must keep working during a node failure |
| Redis version and license | Redis 8.0 or later under AGPLv3, RSALv2 or SSPLv1 | You choose the license, and AGPLv3 matches the Decidim stack, but confirm your obligations if you modify Redis | New installs that want an OSI-approved license option |
| Redis version and license | Redis 7.2.x or earlier (BSD-3-Clause) | Permissive license, but the line is older and will need a planned move | Existing installs that cannot upgrade yet and use unmodified artifacts |
| Threshold strictness | Flag only | Suspicious content is marked for moderators, so legitimate participants are rarely affected, but spam stays visible until someone acts | First weeks after launch, while you learn how the analyzer scores your community |
| Threshold strictness | Stricter settings with automatic action | Faster removal of spam, but higher risk of hiding legitimate contributions, especially in multilingual or technical debates | Mature platforms with a tested appeal path and moderators who review actions |
| Training data | Start from default training | No setup effort, but the classifier does not know your language mix, vocabulary or typical spam | Pilot phases or when you have little labeled content |
| Training data | Train on your own labeled content | Better fit to your community, but needs careful labeling, a review of the training set and periodic retraining | Established platforms with enough reviewed reports and a moderator who owns the labels |
| Reporting user | Dedicated system account that files flags | Flags are traceable to one non-human actor, so moderators can separate automated reports from human ones, but the account needs its own credentials and admin rights | Organizations that want a clear audit trail for automated flags |
| Reporting user | Existing administrator account | Fewer accounts to manage, but automated actions become mixed with a person's own activity in logs | Very small installs where a separate account adds little value |
Choosing a Redis version and license for decidim-ai
The Redis version and license belong in the decision record before installation, because the analyzer's state depends on a Redis backend. Whatever you pick will hold the data that decidim-ai uses to score content, so the choice affects how you upgrade, how you recover, and what your legal team must sign off on. Record the Redis line you intend to run, the license under which you will run it, and the reason for each. Redis Open Source 8.0 and later can be used under the Redis Source Available License v2 (RSALv2), the Server Side Public License v1 (SSPLv1) or the GNU AGPLv3, at your choice. Redis 7.4.x to 7.8.x sit under the dual RSALv2 or SSPLv1 license, and Redis 7.2.x and earlier remain under BSD-3-Clause. Those license terms are different enough that a version choice is also a license choice.
Next, confirm the platform constraints. Redis Open Source runs on Linux and on Windows only through Docker, so a Windows host without a Docker plan is not a supported path. If you need high availability, Redis Sentinel handles failover when you are not using Redis Cluster, and its documentation says a robust deployment needs at least three Sentinel instances. Plan those instances on separate hosts so that a single failure does not remove quorum. Also confirm with the decidim-ai documentation which Redis versions the gem supports, and pin your choice to a version it has been tested against. Do not assume that the newest Redis line is supported by the gem just because it is available.
Ask your counsel to review the license choice before you deploy, especially if you plan to modify Redis or run it as part of a service offered to others. The Redis licenses FAQ states that teams moving from Redis 7.2 or earlier with unmodified artifacts see no impact, while modified code offered as a network service must have its modified source made available to that service's users. Your legal team should confirm which obligations apply to your deployment model and record the decision with its date. Check the Redis licenses page for the current terms before you sign off, since license wording and dates can change.
Implementation sequence for decidim-ai on your Decidim instance
This sequence takes decidim-ai from a compatibility check to live flagging in production, with each stage closing on a written record. The order keeps spam decisions under moderator control from the first day and tightens automation only after flags have been reviewed against real content.
Confirm compatibility with your Decidim release
Before any installation, the platform owner checks which decidim-ai version matches your Decidim release, either 0.31 or 0.32, and confirms that your Ruby, Node and PostgreSQL versions meet the requirements of that release. Decidim 0.32 requires Ruby 3.4.7 and Node 22.14.x, while 0.31 uses Ruby 3.3.4 and Node 22.14.x. Confirm the gem version with the decidim-ai maintainers or its repository, since compatibility is not guaranteed across minor versions. The output is a short version compatibility note that names the Decidim release, the gem version and the runtime versions, and that note is reviewed by whoever maintains your deployment.
Install and configure in staging with Redis
The engineering team installs decidim-ai on a staging copy of your instance and connects it to a dedicated Redis instance used by the analyzer backend. Confirm which Redis license terms apply to the version you deploy, since Redis 8.0 and later can be used under one of several licenses, and record the Redis version and whether it is run in a high-availability setup. Keep the configuration in version control so staging and production can be compared later. The output is a staging configuration record listing the gem version, Redis connection settings (without secrets), analyzer settings and the job processing setup that the deployment depends on.
Decide thresholds and the reporting user
The product owner and the moderation lead agree on the score thresholds that trigger a flag and on the account that files flags on the system's behalf. The reporting user should be a dedicated account with a clear name, limited permissions and an audit trail, so that every automatic flag can be traced in the moderation queue. Write down what happens at each threshold level and who owns the decision to change it. The output is a threshold and reporting user decision record, signed off by the people who will answer for moderation outcomes.
Train on representative content
The team loads or trains the analyzer on samples drawn from your own instance, including past spam removed by moderators and comments, proposals and profiles that were legitimate. Your own content matters because language, topics and typical spam patterns differ between organizations. Remove personal data from training material where your data protection rules require it, and document the source and date of each sample set. The output is a training data record describing the sample sources, counts, labeling method and the person who approved the set.
Test with seeded spam and legitimate samples
The QA team builds a fixed test set that mixes known spam with ordinary contributions, including short, multilingual and off-topic but legitimate posts, and runs it through staging. They record how many items were flagged, how many legitimate items were flagged by mistake, and how many spam items were missed. Repeat the run after each threshold or training change so results can be compared. The output is a test result set that shows flag rates for both groups at each configuration tested, and the team agrees which configuration is acceptable for production.
Run in flag-only mode in production
The operations team deploys the approved configuration to production with flagging enabled but without any automatic hiding or blocking. Flagged content and users appear in the normal moderation queue under the reporting user, so no content is removed on the analyzer's word alone. Confirm that monitoring covers the Redis connection and the background jobs that process flags. The output is a production go-live record with the deployment date, configuration version and the named owner of the queue.
Review flags with moderators and tighten thresholds
Moderators work through flagged items each week and mark each one as correct or incorrect, and the team tracks false positives and missed spam. Use these outcomes to decide whether to retrain the analyzer or adjust thresholds, and change one setting at a time so the effect is measurable. Only move toward automatic action after the error rate has been stable for a period that the moderation lead considers sufficient. The output is a moderator runbook that explains how to triage flags, how to unflag mistakes, and the approval path for any threshold change.
Who runs each part: platform team, moderators and the partner
The platform team owns the Redis service that decidim-ai depends on and the Decidim host that calls it. Its work starts before any flag is raised, with the choice of Redis line, licence, network placement and failover design. Because Decidim only receives security updates for its two most recent minor versions, Redis changes should be scheduled alongside Decidim upgrades so both are tested together.
- Redis edition and licence: Confirm which Redis line you will run and read the Redis licenses page before choosing, since terms differ between 7.2.x and earlier, 7.4.x to 7.8.x, and 8.0 and later.
- High availability: Decide whether a single instance is acceptable for flag data. If you need failover, the Redis Sentinel model requires at least three Sentinel instances for a robust deployment.
- Backups and persistence: Define what Redis data must survive a restart, how long it is kept, and how restores are tested. Align these with the Decidim database backup taken before every upgrade.
- Patching: Track Redis security releases and Decidim security support, and set one patch window that covers both.
Check that the team can restore Redis and the Decidim database to a consistent point in time, and that on-call staff know who to contact when the flag service is unavailable.
The moderation and administration team owns the decisions that flags feed into. The filter can surface suspicious accounts and content, but staff decide what a flag means, at what threshold it matters, and what happens to a participant who was flagged in error. These rules are not settled by the platform team alone, so they should be written down and approved before go-live.
- Threshold review: Own the threshold values, name who may change them, and set a review point after the first batch of decisions so the team can see how many flags were correct.
- Flag handling: Define who works the flag queue, the expected response time, and when flagged content is hidden or restored.
- Appeals: Name the person who reviews a participant's appeal, the evidence they check, and how the outcome is recorded.
- Blocking follow-up: Decide when a confirmed spam account moves to blocking, which block message templates apply, and what the audit record must show.
- Training data sign-off: Approve which content counts as spam and which does not. Mislabeled examples teach the filter the wrong pattern, so a moderator should review the labeled set.
Confirm that every person with moderation rights has a documented role that matches the admin roles set in Decidim.
An implementation partner usually takes the build work: installing the decidim-ai gem into your Decidim codebase, designing tests, preparing training data and writing the runbook. What the partner can deliver depends on what your team owns and approves, so the boundary belongs in the written scope before work begins. Ask for the version of Decidim and Redis the work will target, since both affect compatibility.
- Gem setup and configuration: Installation against your Decidim version, with Redis connection settings and environment variables reviewed against your hosting model.
- Test design: Test cases built from known spam and known legitimate content, run in staging before any flag reaches live moderators.
- Training data preparation: Extraction and labeling of your own content under a data handling rule you agree on in writing, with moderator sign-off on the labels.
- Runbook: Step-by-step procedures for threshold changes, Redis failover, flag queue backlogs and rollback to the previous configuration.
- Handover: Knowledge transfer to platform and moderation staff, plus a written list of tasks that stay with your team after delivery.
Confirm which items are fixed deliverables and which would fall under an ongoing retainer, so no task is left without an owner.
What drives effort and how to keep it down
This table lists the main drivers of effort for a decidim-ai rollout, the effect each has on cost, and how to reduce it. Use it to see which inputs your written scope must state before a quote can be firm.
| Driver | Why it changes cost or effort | How to keep it down |
|---|---|---|
| Number of Decidim organizations and spaces | Each organization that runs the analyzer needs its own configuration, thresholds and review of flagged content, so effort grows with each one added. | Start with one organization and a defined set of spaces, then extend once thresholds are stable. |
| Redis topology and Sentinel | A single Redis instance is simpler to build and run. Sentinel adds at least three Sentinel instances and failover testing, which adds build and operations work. | Decide whether the analyzer can tolerate a short Redis outage before choosing Sentinel. Confirm the requirement in your written scope. |
| Volume and language mix of your own content | Training the Bayes analyzer on your own content needs enough labeled examples in each language you run. Thin or mixed-language data means more labeling and more threshold tuning. | Use a bounded export of existing content, label a representative sample, and limit the first rollout to languages you can review. |
| Moderators who review flags | The number of people working the flag queue sets how much review time the rollout must support, and how much training and documentation is needed. | Agree on one queue owner and a clear escalation path. Confirm reviewer count and hours in the quote inputs. |
| Number of environments | Staging, production and backup copies each need Decidim, Redis and analyzer configuration, and training data must be kept consistent across them. | Keep configuration in version control and use one repeatable setup procedure for every environment. |
| Frequency of Decidim minor-version upgrades | Decidim upgrades one minor version at a time and some change database structures, so each upgrade may require checking the gem's compatibility and retesting flagging. | Pin the gem to a version that matches your Decidim line, and plan retesting into each upgrade window. Check the gem's release notes before every upgrade. |
Questions teams ask before installing decidim-ai
Does decidim-ai delete spam content automatically?
Confirm this in the gem's own documentation before you plan moderation, because the behavior of flagging, hiding, blocking and deleting is what your process depends on. Treat the reporting user as the source of flags, and check whether any flag can change content or account state without a moderator. Whatever the default, decide in advance which flags can act automatically and which need a human decision. Test that split on a staging copy of your Decidim instance with real examples of spam and borderline posts, so the first automated action does not surprise your moderators or a participant with a legitimate post.
What does a decidim-ai installation cost and what drives it?
The cost has four parts: the installation and configuration work, Redis hosting, moderator time and ongoing tuning. Installation and configuration are one-time work, billed by whoever performs it. DeployOpen plans this as a fixed-scope engagement, with scope, deliverables and timelines agreed in writing before work starts, and the quote follows from that scope. Redis hosting may be a one-time setup plus recurring infrastructure cost, or a managed service you pay for monthly. Moderator time recurs, as does retraining and threshold tuning when your content changes. Ask any provider to price each part separately, including what is recurring and what changes with the volume of content and the number of languages.
How long does decidim-ai setup take?
The timeline depends on the state of your environment and the scope you agree, not on the gem alone. The main drivers are whether a Redis deployment already exists and meets your availability needs, which Decidim version you run and whether an upgrade is needed first, how much sample content is available for training, whether a staging instance that matches production is ready, and how many thresholds and roles need tuning. Ask for a written timeline that lists dependencies on your side, such as access approvals, hosting changes and moderator availability for labeling. Teams that cannot yet state these inputs should start with a short scoping step before committing to a schedule.
What must our team provide for a decidim-ai installation?
Your team provides the environment, the content and the people who decide what spam looks like. Plan for:
- Redis hosting, or a decision on how Redis will be deployed and kept highly available, such as with Redis Sentinel for non-cluster setups
- A staging Decidim instance that matches production closely enough to test flagging and thresholds
- Sample content for training, including past comments, proposals and examples of spam you have already removed, with approval to use it for that purpose
- Named moderator time for labeling examples, reviewing flags and approving threshold changes
- Administrator access to the Decidim organization and the Redis instance for the people doing the work
Confirm data handling rules for training samples before anyone copies participant content into a test environment.
Can an in-house team install decidim-ai without a partner?
Yes, if your team has Ruby on Rails and Redis operations experience and can run Decidim installs and upgrades. The trade-off is time and the testing discipline. Decidim 0.32 requires Ruby 3.4.7 and Node 22.14.x, and the manual installation path involves background jobs, file storage, SMTP and social login configuration, so the team needs to be comfortable with the whole stack, not only the gem. An in-house team should test flagging on staging, document thresholds and roles, and keep a record of training decisions. A fixed-scope partner engagement moves those tasks into a written plan with agreed deliverables. Choose based on which skills you already have and how much time your engineers can spare.
Which Redis license applies to our decidim-ai deployment?
The license depends on the Redis version you install, so pin the version before you check the terms. Redis 8.0 and later can be used under the user's choice of RSALv2, SSPLv1 or AGPLv3. Redis 7.4.x through 7.8.x remain under the dual RSALv2 or SSPLv1 license, which is not OSI-approved. Redis 7.2.x and earlier remain under BSD-3-Clause. According to the Redis FAQ, teams moving from Redis 7.2 or earlier with unmodified Redis artifacts see no impact, but teams that offer modified Redis code as a network service must make that modified source available to the service's users. Have your legal team review the chosen option, because this page does not give legal advice. See Redis licenses for the full terms.
What changes when Decidim moves to a new minor version?
Each minor version needs its own upgrade pass, and decidim-ai must be checked against the target version before you move. Decidim's update guide says to upgrade one minor version at a time, for example 0.29 to 0.30 before 0.31, following each release's upgrade instructions because some change database structures. Back up the database first. Then confirm that the decidim-ai version you use supports the target Decidim release, that the required Ruby and Node versions are installed, and that the Redis connection still works. After the upgrade, retest flagging, thresholds and the reporting user on staging before production. Plan this as part of the Decidim upgrade, not as a separate task after it.
How decidim-ai connects to moderation, identity and hosting
A flag from decidim-ai only matters once it reaches a person who can act on it. The cards below show the points where spam detection touches Decidim's moderation queue, verification, login providers, Redis and audit trail, and what to confirm with the decidim-ai documentation at each one.
Moderation queue and report counts
Flags filed by the reporting user are expected to appear alongside human reports, so moderators can see them with the same reasons and counts they already use. Confirm whether flagged content is queued as a report, hidden automatically, or only listed for review, and whether a flag counts toward the automatic hiding threshold. Test this on staging with a known spam post before you rely on it for live content.
Blocking and block message templates
After a moderator confirms a flagged account is spam, blocking and the block message template are the actions that remove its access and explain why. Check whether decidim-ai can trigger blocking directly or only prepares a case for a person to act on. Confirm which template is applied and whether the blocked participant sees the same message as for manual blocks.
Verification and authorization limits
Decidim's authorization workflows can restrict voting, signing and other actions to verified participants. Pairing this with spam flags lets you keep newly created or unverified accounts from posting until they are reviewed. Confirm that decidim-ai's flags can feed or respect these permissions, and test that a flagged, unverified account cannot take restricted actions.
Social and SSO login providers
Facebook, Twitter, Google, Decidim-to-Decidim OAuth 2.0 and custom OmniAuth providers all decide which accounts get created and how easily bots can register. A spam model trained on accounts from one provider may behave differently on another. Confirm which login paths the analyzer sees, whether provider data is stored with flags, and how accounts created through SSO are scored.
Decidim social providersRedis Sentinel and backups
If decidim-ai keeps its Bayes data or thresholds in Redis, that data becomes part of your platform's state. Redis Sentinel provides automatic failover when not using Redis Cluster, and its docs say a robust deployment needs at least three Sentinel instances. Confirm which keys decidim-ai writes, whether losing them means retraining, and include them in your backup and restore tests. Also confirm the Redis version and license your team will run.
- Minimum Sentinel instances
- 3
Flag logging and audit trail
Spam decisions affect real participants, so you will need to explain later why an account was flagged, who reviewed it and what happened next. Check whether decidim-ai writes flag events to logs, how long they are kept, and whether they can be linked to Decidim's moderation records. Route these logs to your central monitoring and confirm their retention matches your privacy policy.
How DeployOpen scopes and delivers a decidim-ai implementation
DeployOpen plans, builds, documents and supports self-hosted open-source platforms inside your own infrastructure, including Decidim. For spam detection with decidim-ai, we start from how your participation platform is hosted and which spam patterns your community actually sees, then deliver the setup in a form your compliance and platform teams can review.
How we scope
- Written scope lists the Decidim version, hosting model and the Redis deployment that decidim-ai will use.
- We agree which spam signals, thresholds and reporting user behavior the moderation team needs before any build starts.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing, and a quote follows from that scope.
How we build
- We install decidim-ai on your Decidim release, configure the Bayes analyzer and Redis backends, and confirm background jobs run.
- We set starting thresholds and train the analyzer on examples from your own content, recording what data was used and why.
- We test flagging with known spam and legitimate contributions, then test the reporting user's flags against the moderation queue.
How we hand over
- You receive configuration documentation covering settings, Redis connection details, threshold values and the training procedure.
- The runbook explains how moderators review flags, how to retrain the analyzer and how to roll back a threshold change.
- We walk your platform and moderation teams through the setup so they can operate and review it without us.
How we support
- Ongoing support and upgrades are available as a retainer, including checks when Decidim or decidim-ai versions change.
- Retraining and threshold reviews can be scheduled as spam patterns shift, with each change documented for audit.
- Retainers can also include periodic security testing of the Decidim deployment, with findings, fixes and a retest.

