> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixpeek.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Search every scene of your ads

> Search every scene of every ad you have run by what is in it, and find the ones that keep earning spend.

![Search every scene of your ads](https://mixpeek.com/templates/creative-dna/creator.webp)

Search every scene of every ad you have run by what is in it, and find the ones that keep earning spend.

> [card] [Deploy in Studio](https://studio.mixpeek.com/manifests/apply?url=https%3A%2F%2Fmixpeek.com%2Ftemplates%2Fcreative-dna.namespace.yaml\&manifest_url=https%3A%2F%2Fmixpeek.com%2Ftemplates%2Fcreative-dna.namespace.yaml\&src=template-creative-dna\&template=creative-dna\&template_name=Search+every+scene+of+your+ads\&sync=1\&utm_source=docs\&utm_medium=template_deploy\&utm_campaign=mvs_onramp)
>
> Creates every resource below in your organization, with sample data.

> [card] [Download the manifest](https://mixpeek.com/templates/creative-dna.namespace.yaml)
>
> `creative-dna.namespace.yaml`, the file Studio and the API apply.

> [card] [Template page](https://mixpeek.com/templates/creative-dna)
>
> The demo and the use case on mixpeek.com.

## At a glance

| | |
| - | - |
| **Creates** | 1 namespace, 1 bucket, 2 collections, 3 retrievers, 1 taxonomy, 1 cluster, 1 alert, 1 trigger |
| **Extractors** | [`multimodal_extractor`](https://docs.mixpeek.com/docs/extract/extractors#multimodal) v1, [`text_extractor`](https://docs.mixpeek.com/docs/extract/extractors#text) v1 |
| **Models** | [Gemini 2.5 Flash](https://mixpeek.com/models/gemini-2-5-flash), [Multilingual E5 Large Instruct](https://mixpeek.com/models/multilingual-e5-large-instruct), [Vertex AI multimodalembedding@001](https://mixpeek.com/models/multimodalembedding) |
| **Daily spend budget** | 2 USD, set on the namespace. Queries are not capped. |
| **Sample data** | 8 objects, uploaded to `ad-creatives` when you apply |
| **Version** | 1.1, updated 2026-12-04 |

## How the pieces connect

Buckets hold what you upload, collections turn it into searchable documents, and retrievers answer queries over the collections.

```mermaid theme={null}
flowchart LR
  b0[("ad-creatives")]
  c1["ads-scenes<br/>multimodal_extractor v1"]
  c2["ads-text<br/>text_extractor v1"]
  r3{{"brand-scenes"}}
  r4{{"copy-search"}}
  r5{{"competitor-product-monitor"}}
  b0 --> c1
  b0 --> c2
  c1 --> r3
  c2 --> r4
  c1 --> r5
```

## Deploy it

> [tab] API
>
> **1. Get the manifest**
>
> ```bash theme={null}
> curl -sO https://mixpeek.com/templates/creative-dna.namespace.yaml
> ```
>
> **2. Validate it**
>
> Validate runs every check apply runs and creates nothing. Fix each entry in `errors`, then run it again.
>
> ```bash theme={null}
> curl -X POST https://api.mixpeek.com/v1/manifest/validate \
>   -H "Authorization: Bearer $MIXPEEK_API_KEY" \
>   -F "manifest_file=@creative-dna.namespace.yaml"
> ```
>
> **3. Apply it**
>
> Apply creates every resource in one call. `wait_for_seed=true` also waits until the sample objects are processed, so the first query below has documents to return.
>
> ```bash theme={null}
> curl -X POST "https://api.mixpeek.com/v1/manifest/apply?wait_for_seed=true" \
>   -H "Authorization: Bearer $MIXPEEK_API_KEY" \
>   -F "manifest_file=@creative-dna.namespace.yaml"
> ```
>
> The response lists each resource with its outcome in `resources`. Apply refuses a resource that already exists and rolls the whole apply back, so to apply the file again over this namespace add `?mode=create_missing`, which creates only what is missing.

> [tab] Studio
>
> Open [Deploy in Studio](https://studio.mixpeek.com/manifests/apply?url=https%3A%2F%2Fmixpeek.com%2Ftemplates%2Fcreative-dna.namespace.yaml\&manifest_url=https%3A%2F%2Fmixpeek.com%2Ftemplates%2Fcreative-dna.namespace.yaml\&src=template-creative-dna\&template=creative-dna\&template_name=Search+every+scene+of+your+ads\&sync=1\&utm_source=docs\&utm_medium=template_deploy\&utm_campaign=mvs_onramp), sign in, choose where to deploy, and select **Apply to my workspace**. Studio shows each resource as it is created.

## Run the first query

Look up the namespace id by name, then run `brand-scenes`. Check `status` and `warnings` along with `documents`: a run that times out still answers 200, with `status` `degraded`.

```bash cURL theme={null}
NAMESPACE_ID=$(curl -s https://api.mixpeek.com/v1/namespaces/creative-dna \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" | jq -r .namespace_id)

curl -X POST https://api.mixpeek.com/v1/retrievers/brand-scenes/execute \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" \
  -H "X-Namespace: $NAMESPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{"inputs": {"query": "ads holding the product up to camera"}}' \
  | jq '{status, warnings, documents: [.documents[] | {document_id, score}]}'
```

```python Python theme={null}
import os, requests

AUTH = {"Authorization": f"Bearer {os.environ['MIXPEEK_API_KEY']}"}
ns = requests.get("https://api.mixpeek.com/v1/namespaces/creative-dna", headers=AUTH).json()

run = requests.post(
    "https://api.mixpeek.com/v1/retrievers/brand-scenes/execute",
    headers={**AUTH, "X-Namespace": ns["namespace_id"]},
    json={"inputs": {"query": "ads holding the product up to camera"}},
).json()

print(run["status"], run["warnings"])  # "completed" on a clean run
for doc in run["documents"]:
    print(doc["document_id"], doc["score"])
```

```javascript JavaScript theme={null}
const auth = { Authorization: `Bearer ${process.env.MIXPEEK_API_KEY}` };
const ns = await fetch("https://api.mixpeek.com/v1/namespaces/creative-dna", { headers: auth }).then((r) => r.json());

const run = await fetch("https://api.mixpeek.com/v1/retrievers/brand-scenes/execute", {
  method: "POST",
  headers: { ...auth, "X-Namespace": ns.namespace_id, "Content-Type": "application/json" },
  body: JSON.stringify({"inputs": {"query": "ads holding the product up to camera"}}),
}).then((r) => r.json());

console.log(run.status, run.warnings); // "completed" on a clean run
for (const doc of run.documents) console.log(doc.document_id, doc.score);
```

## Add your own data

Each object you add to a bucket is processed by every collection that reads it. This adds one object to `ad-creatives`. `NAMESPACE_ID` is the id from the namespace lookup above.

```bash cURL theme={null}
curl -X POST "https://api.mixpeek.com/v1/buckets/ad-creatives/objects?auto_process=true" \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" \
  -H "X-Namespace: $NAMESPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{"ad_id": "example", "brand_slug": "example", "brand_name": "example", "source": "example", "source_url": "example", "headline": "example", "primary_text": "example", "ad_type": "example", "published_at": "example", "blobs": [{"property": "creative_asset_url", "type": "video", "data": "https://example.com/clip.mp4"}]}'
```

```python Python theme={null}
import os, requests

HEADERS = {"Authorization": f"Bearer {os.environ['MIXPEEK_API_KEY']}", "X-Namespace": os.environ["NAMESPACE_ID"]}

obj = requests.post(
    "https://api.mixpeek.com/v1/buckets/ad-creatives/objects",
    params={"auto_process": "true"},
    headers=HEADERS,
    json={
        "ad_id": "example",
        "brand_slug": "example",
        "brand_name": "example",
        "source": "example",
        "source_url": "example",
        "headline": "example",
        "primary_text": "example",
        "ad_type": "example",
        "published_at": "example",
        "blobs": [
            {
                "property": "creative_asset_url",
                "type": "video",
                "data": "https://example.com/clip.mp4"
            }
        ]
    },
).json()
print(obj["object_id"], obj["status"])  # PENDING until processing finishes
```

```javascript JavaScript theme={null}
const headers = {
  Authorization: `Bearer ${process.env.MIXPEEK_API_KEY}`,
  "X-Namespace": process.env.NAMESPACE_ID,
  "Content-Type": "application/json",
};

const obj = await fetch("https://api.mixpeek.com/v1/buckets/ad-creatives/objects?auto_process=true", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "ad_id": "example",
    "brand_slug": "example",
    "brand_name": "example",
    "source": "example",
    "source_url": "example",
    "headline": "example",
    "primary_text": "example",
    "ad_type": "example",
    "published_at": "example",
    "blobs": [
      {
        "property": "creative_asset_url",
        "type": "video",
        "data": "https://example.com/clip.mp4"
      }
    ]
  }),
}).then((r) => r.json());
console.log(obj.object_id, obj.status); // PENDING until processing finishes
```

The object is `PENDING` until processing finishes, then `COMPLETED` or `FAILED`. [Buckets and objects](https://docs.mixpeek.com/docs/ingest/buckets.md) covers object states, retries and duplicates.

## Retrievers

### `brand-scenes`

Searches ads-scenes across 1 feature index.

**Stages:** [`feature_search`](https://docs.mixpeek.com/docs/retrieve/stages#feature-search)

**Searches:** `ads-scenes`

| Input | Type | Required | Description |
| - | - | - | - |
| `query` | text | yes | What to look for; searched across every index below |

### `copy-search`

Searches ads-text across 1 feature index.

**Stages:** [`feature_search`](https://docs.mixpeek.com/docs/retrieve/stages#feature-search)

**Searches:** `ads-text`

| Input | Type | Required | Description |
| - | - | - | - |
| `query` | text | yes | What to look for; searched across every index below |

### `competitor-product-monitor`

The alert's check: does the ad scene just written show a product from a brand other than the advertiser's. The search is scoped to that one scene, and an llm\_filter watches it and keeps it only when it does. Materialises into competitor-product-shown.

**Stages:** [`feature_search`](https://docs.mixpeek.com/docs/retrieve/stages#feature-search) → [`llm_filter`](https://docs.mixpeek.com/docs/retrieve/stages#llm-filter)

**Searches:** `ads-scenes`

| Input | Type | Required | Description |
| - | - | - | - |
| `query` | text | yes | What to look for; searched across every index below |
| `document_id` | text | yes | The written document this run is scoped to, supplied by the alert attachment |

## Collections

Each collection runs one extractor over a bucket, or over another collection's documents.

> [accordion] ads-scenes
>
> multimodal\_extractor\@v1 over bucket ad-creatives. Feeds competitor-product-monitor, competitor-product-shown, brand-scenes, creative-patterns, product-category.
>
> **Reads** bucket `ad-creatives` with [`multimodal_extractor`](https://docs.mixpeek.com/docs/extract/extractors#multimodal) v1.
>
> **Inputs:** `video` ← `creative_asset_url`
>
> **Copied onto each document:** `ad_id`, `brand_slug`, `brand_name`, `ad_type`, `source`, `source_url`, `headline`, `primary_text`, `published_at`
>
> | Document field | Type |
> | - | - |
> | `ad_id` | string |
> | `brand_slug` | string |
> | `brand_name` | string |
> | `ad_type` | string |
> | `source` | string |
> | `source_url` | string |
> | `headline` | string |
> | `primary_text` | string |
> | `published_at` | string |
> | `start_time` | number |
> | `end_time` | number |
> | `start_frame` | integer |
> | `end_frame` | integer |
> | `fps` | number |
> | `source_fps` | number |
> | `analysis_fps` | number |
> | `width` | integer |
> | `height` | integer |
> | `aspect_ratio` | number |
> | `duration` | number |
> | `transcription` | string |
> | `description` | string |
> | `ocr_text` | string |
> | `json_output` | object |
> | `thumbnail_url` | string |
> | `source_video_url` | string |
> | `video_segment_url` | string |
> | `multimodal_extractor_v1_multimodal_embedding` | array\<number> |
> | `multimodal_extractor_v1_transcription_embedding` | array\<number> |
> | `internal_metadata` | object |

> [accordion] ads-text
>
> text\_extractor\@v1 over bucket ad-creatives. Feeds copy-search.
>
> **Reads** bucket `ad-creatives` with [`text_extractor`](https://docs.mixpeek.com/docs/extract/extractors#text) v1.
>
> **Inputs:** `text` ← `primary_text`
>
> **Copied onto each document:** `ad_id`, `brand_slug`, `brand_name`, `ad_type`, `source`, `source_url`, `headline`, `primary_text`, `published_at`
>
> | Document field | Type |
> | - | - |
> | `ad_id` | string |
> | `brand_slug` | string |
> | `brand_name` | string |
> | `ad_type` | string |
> | `source` | string |
> | `source_url` | string |
> | `headline` | string |
> | `primary_text` | string |
> | `published_at` | string |
> | `text` | string |
> | `text_extractor_v1_embedding` | array\<number> |
> | `video_id` | string |
> | `title` | string |
> | `channel` | string |
> | `video_url` | string |
> | `duration_seconds` | integer |
> | `publish_date` | string |
> | `start_ms` | integer |
> | `end_ms` | integer |
> | `segment_index` | integer |
> | `heading_path` | string |
> | `chunk_kind` | string |
> | `code_language` | string |
> | `total_segments` | integer |

## Also created

**[Taxonomies](https://docs.mixpeek.com/docs/enrich/taxonomies.md)**

* `product-category`: Tags every ad scene with the product category it shows, so scenes can be filtered and compared by category across brands.

**[Clusters](https://docs.mixpeek.com/docs/enrich/clusters.md)**

* `creative-patterns`: Groups ad scenes across brands by what they show, so recurring visual patterns can be browsed and named.

**[Alerts](https://docs.mixpeek.com/docs/enrich/alerts-and-triggers.md)**

* `competitor-product-shown`: Emails the org notifications address (Settings -> Notifications; unset means opted out) when a newly indexed ad scene shows a competitor's product.

**[Triggers](https://docs.mixpeek.com/docs/enrich/alerts-and-triggers.md)**

* `creative-patterns-after-ingest`: Re-runs creative-patterns each time a batch of new ad scenes finishes indexing.

> [accordion] Cost estimate at list price
>
> At 10,000 items a month (2 minutes or 10 pages each) and 100,000 queries, this template costs about **7,300.90 USD a month** (730.07 USD per 1,000 items). The namespace's daily spend budget pauses new batches before you pass it.
>
> | Part | USD a month |
> | - | - |
> | Processing | 7,300.50 |
> | Storage | 0.20 |
> | Queries | 0.20 |
> | Processing in `ads-scenes` | 7,300.50 |

## The manifest

Every resource above comes from this file. Change it and apply it again with `?mode=upsert` to update what exists. [Manifests](https://docs.mixpeek.com/docs/manage/manifests.md) documents each field.

```yaml creative-dna.namespace.yaml expandable theme={null}
# creative-dna: one manifest spins up the namespace.
# Platform manifest schema (GET /v1/discovery/schema). Validate with POST /v1/manifest/validate,
# apply with POST /v1/manifest/apply or the Deploy button. Wiring comes from the flow diagram:
# edges are bucket -> collection sources, collection -> retriever scope, retriever -> view.
# Applying a SECOND time, over a namespace this template already created: use
# POST /v1/manifest/apply?mode=create_missing, which creates what is missing and leaves
# what exists alone. The default, create_only, fails the WHOLE apply and rolls it back if
# any resource already exists, so an upgrade looks like a dead end without this. Use
# mode=upsert to also patch resources that exist but have drifted from this file.
version: '1.0'
metadata:
  name: creative-dna
  description: "Namespace template creative-dna. Generated from the flow diagram on mixpeek.com/templates/creative-dna."
namespaces:
  - name: creative-dna
    description: "Everything below lives in this namespace."
    feature_extractors:
      - name: multimodal_extractor
        version: v1
      - name: text_extractor
        version: v1
    # Daily spend budget, in dollars of what you are charged (1,000 credits a dollar).
    # New batches pause once the namespace has spent this much today; queries are not capped.
    # Raise it later on the namespace: PATCH /v1/namespaces/<id> {"spend_budget": {"daily_usd": N}}.
    budget:
      daily_usd: 2

# Data sources. A storage connection carries credentials, so it is created in Studio
# (or POST /v1/organizations/connections) and synced into the bucket named here.
#   ad-drive: google_drive, continuous, your ad creatives, one folder per brand -> bucket ad-creatives
buckets:
  - name: ad-creatives
    namespace: creative-dna
    description: "Meant to be fed by ad-drive (google_drive, continuous). No source is connected yet: applying this manifest creates the bucket only. Connect the source to this bucket in Studio (Syncs) to start the feed."
    schema:
      properties:
        ad_id:
          type: string
        brand_slug:
          type: string
        brand_name:
          type: string
        source:
          type: string
        source_url:
          type: string
        headline:
          type: string
        primary_text:
          type: string
        ad_type:
          type: string
        creative_asset_url:
          type: video
          required: true
        published_at:
          type: string

# Connect your own storage. Create the secrets named below, uncomment, and apply again;
# apply live-tests the connection, so it must have real credentials to succeed.
# Until then the buckets above accept direct uploads.
# storage_connections:
#   - name: ad-drive-connection
#     provider: google_drive
#     description: "Read-only access to the google_drive location holding your ad creatives, one folder per brand."
#     config:
#       credentials:
#         type: oauth
#         client_id: ${{ secrets.GDRIVE_CLIENT_ID }}
#         client_secret: ${{ secrets.GDRIVE_CLIENT_SECRET }}
#         refresh_token: ${{ secrets.GDRIVE_REFRESH_TOKEN }}

# bucket_syncs:
#   - name: ad-drive-sync
#     bucket: ad-creatives
#     connection: ad-drive-connection
#     source_path: "/Creative DNA"
#     sync_mode: continuous
#     polling_interval_seconds: 300
#     skip_duplicates: true
#     batch_collection_ids:
#       - ads-scenes
#       - ads-text
#     file_filters:
#       include_patterns: ["*.mp4", "*.mov", "*.webm", "*.m4v"]
#     schema_mapping:
#       mappings:
#         creative_asset_url:
#           target_type: blob
#           source: {type: file}
#           blob_type: video
#         ad_id:
#           target_type: field
#           source:
#             type: "drive_property"
#             key: "name"
#         brand_slug:
#           target_type: field
#           source:
#             type: "folder_path"
#             segment: -1
#         brand_name:
#           target_type: field
#           source:
#             type: "folder_path"
#             segment: -1
#         primary_text:
#           target_type: field
#           source:
#             type: "drive_property"
#             key: "description"
#         source_url:
#           target_type: field
#           source:
#             type: "drive_property"
#             key: "webViewLink"
#         published_at:
#           target_type: field
#           source:
#             type: "drive_property"
#             key: "createdTime"
#         source:
#           target_type: field
#           source:
#             type: "constant"
#             value: "google_drive"

collections:
  - name: ads-scenes
    namespace: creative-dna
    description: "multimodal_extractor@v1 over bucket ad-creatives. Feeds competitor-product-monitor, competitor-product-shown, brand-scenes, creative-patterns, product-category."
    source:
      type: bucket
      bucket: ad-creatives
    feature_extractor:
      name: multimodal_extractor
      version: v1
      parameters:
        split_method: "scene"
        scene_detection_threshold: 0.5
        run_transcription: true
        run_video_description: true
        run_ocr: true
        description_prompt: "This is one scene from a video ad. In two or three sentences, describe it as a creative director would: the shot type and framing, who is on screen and what they do, how the product appears, and the role the scene plays in the ad (hook, demonstration, testimonial, offer or call to action). Name the brand or product only when it is shown or said."
      input_mappings:
        video: creative_asset_url
      field_passthrough:
        - source_path: ad_id
        - source_path: brand_slug
        - source_path: brand_name
        - source_path: ad_type
        - source_path: source
        - source_path: source_url
        - source_path: headline
        - source_path: primary_text
        - source_path: published_at
    alert_applications:
      - alert: competitor-product-shown
        input_mappings:
          - input_key: query
            source: {source_type: constant, value: "competitor product shown"}
          - input_key: document_id
            source: {source_type: document_field, path: _internal.document_id}
    taxonomy_applications:
      - taxonomy: product-category
    enabled: true
  - name: ads-text
    namespace: creative-dna
    description: "text_extractor@v1 over bucket ad-creatives. Feeds copy-search."
    source:
      type: bucket
      bucket: ad-creatives
    feature_extractor:
      name: text_extractor
      version: v1
      input_mappings:
        text: primary_text
      field_passthrough:
        - source_path: ad_id
        - source_path: brand_slug
        - source_path: brand_name
        - source_path: ad_type
        - source_path: source
        - source_path: source_url
        - source_path: headline
        - source_path: primary_text
        - source_path: published_at
    enabled: true

# NOT APPLIED. Face recognition is turned off on Mixpeek Cloud, so this face step does not deploy. It runs on a dedicated or customer-hosted deployment, where face_identity_extractor is served.
# The block below is correct and is emitted commented out so the rest of this
# manifest applies; an apply is all-or-nothing and would otherwise roll back.
#   - name: ads-faces
#     namespace: creative-dna
#     description: "face_identity_extractor@v1 over bucket ad-creatives. Feeds cast-identification."
#     source:
#       type: bucket
#       bucket: ad-creatives
#     feature_extractor:
#       name: face_identity_extractor
#       version: v1
#       input_mappings:
#         video: creative_asset_url
#       field_passthrough:
#         - source_path: ad_id
#         - source_path: brand_slug
#         - source_path: brand_name
#         - source_path: ad_type
#         - source_path: source
#         - source_path: source_url
#         - source_path: headline
#         - source_path: primary_text
#         - source_path: published_at
#     enabled: true
retrievers:
  - name: brand-scenes
    namespace: creative-dna
    description: "Searches ads-scenes across 1 feature index."
    collections:
      - ads-scenes
    input_schema:
      query:
        type: text
        required: true
        description: "What to look for; searched across every index below"
    stages:
      - stage_name: search
        stage_id: feature_search
        parameters:
          searches:
            - feature_uri: "mixpeek://multimodal_extractor@v1/vertex_multimodal_embedding"
              query:
                input_mode: text
                value: "{{INPUT.query}}"
              top_k: 100
          fusion: rrf
          final_top_k: 100
    tags:
      - template:creative-dna
  # NOT APPLIED. Face recognition is turned off on Mixpeek Cloud, so this face step does not deploy. It runs on a dedicated or customer-hosted deployment, where face_identity_extractor is served.
  # - name: cast-identification
  #   namespace: creative-dna
  #   description: "Searches ads-faces across 1 feature index."
  #   collections:
  #     - ads-faces
  #   input_schema:
  #     query:
  #       type: text
  #       required: true
  #       description: "URL of the image or frame to match; encoded by the index below and compared against it"
  #   stages:
  #     - stage_name: search
  #       stage_id: feature_search
  #       parameters:
  #         searches:
  #           - feature_uri: "mixpeek://face_identity_extractor@v1/insightface__arcface"
  #             query:
  #               input_mode: content
  #               value: "{{INPUT.query}}"
  #             top_k: 50
  #         fusion: rrf
  #         final_top_k: 50
  #   tags:
  #     - template:creative-dna
  - name: copy-search
    namespace: creative-dna
    description: "Searches ads-text across 1 feature index."
    collections:
      - ads-text
    input_schema:
      query:
        type: text
        required: true
        description: "What to look for; searched across every index below"
    stages:
      - stage_name: search
        stage_id: feature_search
        parameters:
          searches:
            - feature_uri: "mixpeek://text_extractor@v1"
              query:
                input_mode: text
                value: "{{INPUT.query}}"
              top_k: 50
          fusion: rrf
          final_top_k: 50
    tags:
      - template:creative-dna
  - name: competitor-product-monitor
    namespace: creative-dna
    description: "The alert's check: does the ad scene just written show a product from a brand other than the advertiser's. The search is scoped to that one scene, and an llm_filter watches it and keeps it only when it does. Materialises into competitor-product-shown."
    collections:
      - ads-scenes
    input_schema:
      query:
        type: text
        required: true
        description: "What to look for; searched across every index below"
      document_id:
        type: text
        required: true
        description: "The written document this run is scoped to, supplied by the alert attachment"
    stages:
      - stage_name: search
        stage_id: feature_search
        pre_filters:
          AND:
            - field: _internal.document_id
              operator: eq
              value: "{{INPUT.document_id}}"
        parameters:
          searches:
            - feature_uri: "mixpeek://multimodal_extractor@v1/vertex_multimodal_embedding"
              query:
                input_mode: text
                value: "{{INPUT.query}}"
              top_k: 5
          fusion: rrf
          final_top_k: 5
      - stage_name: judge
        stage_id: llm_filter
        parameters:
          criteria: "Keep this ad scene only if it clearly shows a product or its packaging from a brand other than {{DOC.brand_name}}, the advertiser. Discard scenes that show no product, or only {{DOC.brand_name}} products."
          include_media: true
    tags:
      - template:creative-dna
clusters:
  - name: creative-patterns
    namespace: creative-dna
    description: "Groups ad scenes across brands by what they show, so recurring visual patterns can be browsed and named."
    source_collections:
      - ads-scenes
    cluster_type: vector
    vector_config:
      feature_uris:
        - mixpeek://multimodal_extractor@v1/vertex_multimodal_embedding
      clustering_method: kmeans
      algorithm_params:
        n_clusters: 6
    llm_labeling:
      enabled: true
      provider: google
      model_name: gemini-2.5-flash
      labeling_inputs:
        input_mappings:
          - {input_key: text, source_type: payload, path: description}
          - {input_key: image_url, source_type: payload, path: thumbnail_url}
taxonomies:
  - name: product-category
    namespace: creative-dna
    description: "Tags every ad scene with the product category it shows, so scenes can be filtered and compared by category across brands."
    type: flat
    match_on: "mixpeek://multimodal_extractor@v1/vertex_multimodal_embedding"
    target_field: product_category
    labels:
      - {label: coffee-and-tea, description: "Coffee, tea or another hot drink: a cup being poured, a jar or can of coffee, people drinking at a table."}
      - {label: breakfast-cereal, description: "Breakfast cereal: a bowl of flakes with milk, a cereal box, a family eating breakfast."}
      - {label: household-cleaning, description: "Laundry detergent and cleaning products: washing clothes or dishes, a box of soap powder, a clean kitchen."}
      - {label: personal-care, description: "Shaving, bathing, skincare and hair care: a razor, a bar of soap, a person grooming at a mirror."}
      - {label: automotive, description: "Cars, trucks and other vehicles: a vehicle driving on a road or off road."}
      - {label: food-and-snacks, description: "Packaged food, snacks and soft drinks other than cereal."}
      - {label: apparel-and-beauty, description: "Clothing, shoes, makeup and fragrance."}
      - {label: electronics-and-services, description: "Phones, computers, apps, banking, insurance and other services."}
alerts:
  - name: competitor-product-shown
    namespace: creative-dna
    description: "Emails the org notifications address (Settings -> Notifications; unset means opted out) when a newly indexed ad scene shows a competitor's product."
    source: retriever
    retriever: competitor-product-monitor
    trigger_on: results
    notification_config:
      channels:
        - channel_type: email
      include_matches: true
      include_scores: true
    enabled: false
triggers:
  - name: creative-patterns-after-ingest
    namespace: creative-dna
    description: "Re-runs creative-patterns each time a batch of new ad scenes finishes indexing."
    action_type: cluster
    trigger_type: event
    schedule_config:
      event_type: batch_completed
      collection: ads-scenes
      cooldown_seconds: 0
    action_config:
      cluster: creative-patterns
    status: active

# Eight public-domain television commercials from the Prelinger Archives on
# archive.org, held in the starter sample set (source_url names each one's
# archive.org page) and ingested by one bounded batch after apply, so a first deploy
# can search real ads. Each seed object carries the bucket's required fields
# beside its video. Two brands share a product in three pairs (coffee, cereal,
# soap and detergent), which is what the competitor and copy searches compare.
seed:
  - bucket: ad-creatives
    max_objects: 8
    objects:
      - blobs: {creative_asset_url: samples/starter/videos/norelco-speed.mp4}
        ad_id: sample-norelco-speedshaver
        brand_slug: norelco
        brand_name: "Norelco"
        source: archive.org
        source_url: "https://archive.org/details/NorelcoSpeed"
        headline: "Norelco Speedshaver"
        primary_text: "A vintage television commercial for the Norelco Speedshaver electric shaver."
        ad_type: video
      - blobs: {creative_asset_url: samples/starter/videos/folgers-coffee.mp4}
        ad_id: sample-folgers-coffee
        brand_slug: folgers
        brand_name: "Folgers"
        source: archive.org
        source_url: "https://archive.org/details/folgers_10"
        headline: "Folgers Coffee"
        primary_text: "A vintage television commercial for Folgers Coffee."
        ad_type: video
      - blobs: {creative_asset_url: samples/starter/videos/sanka-coffee.mp4}
        ad_id: sample-sanka-coffee
        brand_slug: sanka
        brand_name: "Sanka"
        source: archive.org
        source_url: "https://archive.org/details/sanka_coffee"
        headline: "Sanka Coffee"
        primary_text: "A vintage television commercial for Sanka, a decaffeinated coffee."
        ad_type: video
      - blobs: {creative_asset_url: samples/starter/videos/tide-detergent.mp4}
        ad_id: sample-tide-detergent
        brand_slug: tide
        brand_name: "Tide"
        source: archive.org
        source_url: "https://archive.org/details/tide"
        headline: "Tide"
        primary_text: "A vintage television commercial for Tide laundry detergent."
        ad_type: video
      - blobs: {creative_asset_url: samples/starter/videos/ivory-soap.mp4}
        ad_id: sample-ivory-soap
        brand_slug: ivory
        brand_name: "Ivory"
        source: archive.org
        source_url: "https://archive.org/details/ivory_soap"
        headline: "Ivory Soap"
        primary_text: "A vintage television commercial for Ivory bar soap."
        ad_type: video
      - blobs: {creative_asset_url: samples/starter/videos/kelloggs-variety-pak.mp4}
        ad_id: sample-kelloggs-variety-pak
        brand_slug: kelloggs
        brand_name: "Kellogg's"
        source: archive.org
        source_url: "https://archive.org/details/kelloggs_variety_pak"
        headline: "Kellogg's Variety Pak"
        primary_text: "A vintage television commercial for the Kellogg's Variety Pak of breakfast cereals."
        ad_type: video
      - blobs: {creative_asset_url: samples/starter/videos/post-grape-nuts-flakes.mp4}
        ad_id: sample-post-grape-nuts-flakes
        brand_slug: post
        brand_name: "Post"
        source: archive.org
        source_url: "https://archive.org/details/post_grape-nuts_flakes"
        headline: "Post Grape-Nuts Flakes"
        primary_text: "A vintage television commercial for Post Grape-Nuts Flakes breakfast cereal."
        ad_type: video
      - blobs: {creative_asset_url: samples/starter/videos/amc-jeep.mp4}
        ad_id: sample-amc-jeep
        brand_slug: jeep
        brand_name: "Jeep"
        source: archive.org
        source_url: "https://archive.org/details/amc_jeep"
        headline: "AMC Jeep"
        primary_text: "A vintage television commercial for the AMC Jeep."
        ad_type: video
acceptance:
  max_cost_usd: 1
  steps:
    - name: ad-scenes-indexed
      kind: documents
      collection: ads-scenes
      expect: {min_documents: 8}
    - name: ad-copy-indexed
      kind: documents
      collection: ads-text
      expect: {min_documents: 8}
    - name: brand-scenes-answers
      kind: query
      retriever: brand-scenes
      inputs: {query: a cup of coffee}
      expect: {min_results: 1}
    - name: scenes-tagged-by-category
      kind: query
      retriever: brand-scenes
      inputs: {query: a cup of coffee}
      expect: {top_field: product_category, top_equals: coffee-and-tea}
    - name: copy-search-answers
      kind: query
      retriever: copy-search
      inputs: {query: breakfast cereal}
      expect: {min_results: 1}
```

## Hand it to an agent

Paste this prompt into Claude Code, Cursor or another coding agent. To give the agent this whole page instead, use **Copy page** in the menu at the top of the page, or point it at the page's Markdown at `https://mixpeek.com/docs/templates/creative-dna.md`.

```text Prompt theme={null}
Set up the Mixpeek "Search every scene of your ads" template in my organization. My API key is in MIXPEEK_API_KEY.
1. Download https://mixpeek.com/templates/creative-dna.namespace.yaml to creative-dna.namespace.yaml.
2. POST it to https://api.mixpeek.com/v1/manifest/validate as the multipart field manifest_file, with the header Authorization: Bearer $MIXPEEK_API_KEY. Fix every entry in errors and validate again.
3. POST the same file to https://api.mixpeek.com/v1/manifest/apply?wait_for_seed=true. Every entry in resources should be created.
4. GET https://api.mixpeek.com/v1/namespaces/creative-dna and keep namespace_id. Send it as the X-Namespace header on every call below.
5. POST {"inputs": {"query": "ads holding the product up to camera"}} to https://api.mixpeek.com/v1/retrievers/brand-scenes/execute. Read documents, check that status is completed, and print warnings.
Reference for this template: https://mixpeek.com/docs/templates/creative-dna.md
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.