---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

1.  [](/)
2.  [Code examples](/recipes)
3.  AI Content Moderation Pipeline

Back to code examples

Compliance

# AI Content Moderation Pipeline

Automatically detect unsafe content across images, videos, and text. Flag NSFW material, violence, hate speech, and custom policy violations.

image

video

text

Multi-Tier

[Run in Builder](/build?recipe=content-moderation-pipeline)

Python

cURL

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="moderation")

\# 1. A bucket for user uploads, and a collection whose Gemini step answers your

\#    policy questions as JSON. There is no dedicated NSFW or violence model; the

\#    judgment comes from this structured description.

bucket \= client.buckets.create(

    bucket\_name\="user-uploads",

    bucket\_schema\={"properties": {"upload": {"type": "image"}}},

)

collection \= client.collections.create(

    collection\_name\="user-uploads",

    source\={"type": "bucket", "bucket\_ids": \[bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "multimodal\_extractor",

        "version": "v1",

        "parameters": {

            "run\_video\_description": True,

            "description\_prompt": "Review this image against a content policy.",

            "response\_shape": {

                "type": "object",

                "properties": {

                    "adult": {"type": "boolean"},

                    "violence": {"type": "boolean"},

                    "hate\_symbols": {"type": "boolean"},

                    "reason": {"type": "string"},

                },

            },

        },

    },

)

\# 2. Upload and process

client.buckets.upload(

    bucket\["bucket\_id"\],

    blobs\=\[{"property": "upload", "type": "image", "data": "https://example.com/user-upload.jpg"}\],

)

client.collections.trigger(collection\["collection\_id"\])

\# 3. Flag anything the policy check marked

docs \= client.documents.list(collection\["collection\_id"\], page\_size\=100)

for doc in docs\["results"\]:

    verdict \= doc.get("json\_output") or {}

    if verdict.get("adult") or verdict.get("violence") or verdict.get("hate\_symbols"):

        print("flagged", doc\["document\_id"\], verdict.get("reason"))

### Feature Extractors

Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

### Retriever Stages

## Frequently asked questions

### What safety categories are detected?

NSFW, violence, hate speech, self-harm, weapons, drugs, and custom categories you define via taxonomies.

### Can I customize the sensitivity threshold?

Yes. Each category has an adjustable confidence threshold. You can also create custom moderation rules using Mixpeek taxonomies.

### How fast is moderation?

Image moderation takes <1 second. Video moderation depends on length but processes at roughly 10x real-time speed.

## Use Cases Using This Recipe

Intermediate

### AI Content Moderation for User-Generated Content

Automatically detect and flag policy-violating content across text, images, and video

95%+ of violations flagged before going live

Pre-publication violation catch rate

media

Who It's For

UGC platforms, social media companies, marketplace operators, and community platforms processing 100K+ daily uploads requiring trust and safety review

[View Details](/use-cases/ai-content-moderation-ugc)

Advanced

### Video Compliance Monitoring

Automatically verify regulatory and policy compliance across video content at scale

10x faster than manual review

Compliance review speed

[

security

](/solutions/security)

Who It's For

Compliance teams, broadcast standards departments, advertising regulators, and enterprise communications teams reviewing video content for regulatory adherence

[View Details](/use-cases/video-compliance-monitoring)

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

Extractor

### Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

Learn more





](/extractors/multimodal)[

Recipe

### Brand Safety & Ad Verification Pipeline

Brand safety pipeline for ad networks. Scores video and image creatives against the GARM brand safety floor and suitability categories, which vendors still use after GARM wound down in 2024, before an ad is served.

Learn more





](/recipes/brand-safety-pipeline)[

Recipe

### E-commerce Catalog Enrichment

Automatically enrich product listings with visual attributes, descriptions, and tags extracted from product images. Fill in missing catalog data at scale.

Learn more





](/recipes/ecommerce-catalog-enrichment)[

Recipe

### Face Search Pipeline

Detect, align, and embed faces across your image and video library, then search by face identity. Uses SCRFD for detection and ArcFace for 512-dimensional identity embeddings, enabling large-scale face recognition and matching.

Learn more





](/recipes/face-search-pipeline)[

Recipe

### Visual Product Search

Enable camera-based product discovery for e-commerce. Customers snap a photo of a product they like, and the pipeline returns visually similar items from your catalog along with pricing, availability, and product metadata.

Learn more





](/recipes/visual-product-search)[

Recipe

### Visual Similarity Search

Unified visual similarity search across both images and video frames. Query with a photo, screenshot, or frame to discover visually related content regardless of format, with MMR diversification to ensure variety in results.

Learn more





](/recipes/visual-similarity-search)