> ## 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.

# Manifests

> Declare a namespace's buckets, collections, retrievers and more in one YAML file, then validate, diff, apply and export it, or generate it from a description.

Write a namespace's resources in one YAML file, check it, and create everything in dependency order with one call. A manifest lives in version control, replicates an environment, and is how [templates](https://docs.mixpeek.com/docs/templates/overview.md) ship.

## Prerequisites

* An API key with `write` permission. A manifest that declares storage connections needs `admin`.
* Any secrets the manifest references, created in your organization first.

## Apply a manifest

**1. Write the file**

```yaml mixpeek.yaml theme={null}
version: "1.0"
metadata:
  name: video-search-env

namespaces:
  - name: video_search
    feature_extractors:
      - {name: multimodal_extractor, version: v1}

buckets:
  - name: raw_videos
    namespace: video_search
    schema:
      properties:
        video: {type: video}

collections:
  - name: video_index
    namespace: video_search
    source: {type: bucket, bucket: raw_videos}
    feature_extractor:
      feature_extractor_name: multimodal_extractor
      version: v1

retrievers:
  - name: video_search_tool
    namespace: video_search
    collections: [video_index]
    input_schema:
      query: {type: text, required: true}
    stages:
      - stage_name: search
        stage_type: filter
        config:
          stage_id: feature_search
          parameters:
            searches:
              - feature_uri: "mixpeek://multimodal_extractor@v1/vertex_multimodal_embedding"
                query: {input_mode: text, value: "{{INPUT.query}}"}
                top_k: 10
            final_top_k: 10
```

Resources refer to each other by name. Every collection needs a `source` and a `feature_extractor`; every retriever needs `namespace`, `collections` and `stages`. Copy feature URIs from `GET /v1/discovery/schema` (`extractor_catalog`) rather than typing them.

**2. Validate and dry-run it**

```bash cURL title="Validate, then show the plan" theme={null}
curl -X POST "https://api.mixpeek.com/v1/manifest/validate" \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" \
  -F "manifest_file=@mixpeek.yaml"

curl -X POST "https://api.mixpeek.com/v1/manifest/apply?dry_run=true" \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" \
  -F "manifest_file=@mixpeek.yaml"
```

Validate returns `valid`, `errors`, `warnings`, `missing_secrets` and a count of `resources` per type. It runs every check apply runs, so a manifest it passes is one apply accepts. The dry run lists each resource as `would_create`, `exists` or `drifted` and creates nothing.

**3. Apply it**

```bash cURL theme={null}
curl -X POST "https://api.mixpeek.com/v1/manifest/apply" \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" \
  -F "manifest_file=@mixpeek.yaml"
```

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

with open("mixpeek.yaml", "rb") as f:
    result = requests.post(
        "https://api.mixpeek.com/v1/manifest/apply",
        headers={"Authorization": f"Bearer {os.environ['MIXPEEK_API_KEY']}"},
        files={"manifest_file": f},
    ).json()
print(result["success"], result.get("errors"))
```

```javascript JavaScript theme={null}
import { readFile } from "node:fs/promises";

const form = new FormData();
form.append("manifest_file", new Blob([await readFile("mixpeek.yaml")]), "mixpeek.yaml");
const result = await (
  await fetch("https://api.mixpeek.com/v1/manifest/apply", {
    method: "POST",
    headers: { Authorization: `Bearer ${process.env.MIXPEEK_API_KEY}` },
    body: form,
  })
).json();
console.log(result.success, result.errors);
```

## Check that it worked

Read `success` and `errors` on every response. Apply can answer HTTP `200` with `success: false` when the plan has errors (nothing is created), when `deadline_seconds` passes before serving apps are running, or when a resource fails partway (`rollback_performed: true`, with `rollback_orphans` listing anything the rollback could not remove).

`task_id` names the apply. `GET /v1/tasks/{task_id}` lists every resource with its states and times: `planned`, `creating`, `created`, `exists`, `updated` or `failed`, and for a collection also `warming` and `ready`. `readiness` in the response says whether each collection's real-time serving app is running; an app scaled to zero answers its first call with `503` and `Retry-After` while it warms. With `wait=false`, apply answers `202` with `pending: true` at once and you poll the task.

## Apply modes

| `mode` | Resource missing | Resource exists and matches | Resource exists and differs |
| - | - | - | - |
| `create_only` (default) | Created | Plan refused | Plan refused |
| `create_missing` | Created | Left alone (`exists`) | Left alone (`exists`) |
| `upsert` | Created | Left alone | Patched through its own update call; fields that call cannot change are listed in `refused` |

Under `create_only` the manifest is a closed world: a reference to a resource it does not declare is an error. `create_missing` resolves references against what already exists, so use it to add collections over buckets created earlier. `upsert` is the only mode that changes existing resources. If a resource fails partway, apply rolls back what it created; an apply interrupted by an API restart is rolled back when the API starts again.

## What a manifest can declare

Resources apply in this order: namespaces, extractors, storage connections and buckets, bucket syncs, collections, retrievers, alerts, clusters and taxonomies, triggers and webhooks. Apply detects circular references and refuses them. `GET /v1/discovery/schema` returns a JSON schema for every section, the dependency graph between types, an example per type, and the extractor and stage catalogs.

The plan refuses, before anything is created:

* an extractor that does not exist or is turned off, or a retriever stage that is not registered
* a feature URI no collection in the manifest writes
* two collections in one namespace writing the same vector at different sizes (set the same `output_dimensionality` on both)
* an alert that does not map an input its retriever requires
* any resource its own create request would refuse, reported as `<type>:<name>: <field>: <reason>`
* a bucket sync whose `sync_mode` is not `initial_only` or `continuous`

> [accordion] parameters: values supplied at apply time
>
> Declare inputs so a template needs no hand edit, and reference them as `${{ params.<name> }}`. A reference that is the whole value takes the parameter's type; one inside a longer string is formatted as text. An `array` parameter must be a whole value.
>
> ```yaml title="parameters" theme={null}
> parameters:
>   - name: camera_url
>     type: string
>     description: Your camera's rtsp:// url
>   - name: polling_seconds
>     type: integer
>     default: 300
> ```
>
> | Field | Default | Notes |
> | - | - | - |
> | `type` | `string` | `string`, `integer`, `number`, `boolean` or `array` (with `items`) |
> | `enum` | None | Allowed values; for an array, every item |
> | `required` | `true` | Ignored when `default` is set |
>
> Pass values as a JSON form field on validate, diff, lint and apply: `-F 'parameters={"camera_url": "rtsp://10.0.0.8/stream"}'`. A missing, mistyped, undeclared or duplicated parameter is refused before anything is created.

> [accordion] secrets: credentials by reference
>
> `${{ secrets.NAME }}` fills in an organization secret in a storage connection's `config`, an alert's `notification_config`, a webhook's `channels` and a bucket sync's `connection`. In a retriever the reference stays a reference (`{{secrets.NAME}}`) and resolves at each run, so the key is never stored. A secret reference anywhere else is refused, because those fields are readable with a read key. Validate lists missing secrets in `missing_secrets`.

> [accordion] extractors: catalog, uploaded and Hugging Face models
>
> An `extractors:` section declares the extractors collections run. Once it exists, every extractor a collection names must be declared in it. `source` is one of:
>
> | Source | Value |
> | - | - |
> | `marketplace` (default) | A registry extractor name, such as `text_extractor` |
> | `model` | `org:<model_id>`, a model your organization uploaded |
> | `huggingface` | `{repo, revision, framework, token_secret}`. `revision` must be a full commit sha or a tag; weights must be safetensors; the snapshot must fit 5 GB; `framework` is `sentence-transformers` |
>
> `compute_profile` stores a batch override (`resource_type`, `batch_size`, `max_concurrency`, memory). A `serve.min_replicas` above 0 is refused with its monthly cost. Your own container images as extractors are covered in [Custom extractors and models](https://docs.mixpeek.com/docs/extract/custom-extractors.md).

> [accordion] budget and spend\_tier on a namespace
>
> ```yaml title="Namespace budget" theme={null}
> namespaces:
>   - name: video_search
>     budget: {daily_usd: 5, monthly_usd: 100}
> ```
>
> A value above the organization's budget is lowered to it and reported in `warnings`. See [Budgets](https://docs.mixpeek.com/docs/manage/namespaces.md#budgets).

> [accordion] seed: sample objects for the first query
>
> After resources exist, apply ingests `seed:` objects into the named bucket in one batch, up to `max_objects` (default 50, at most 500). Re-applying ingests nothing more. Each blob comes from a Mixpeek sample key (`samples/starter/<file>`), a public `https://` URL, or `{connection, path}` for one object in your storage through an `s3`, `tigris`, `gcs`, `azure_blob`, `backblaze` or `supabase` connection. Other schema fields sit beside `blobs`.
>
> ```yaml title="seed" theme={null}
> seed:
>   - bucket: raw_videos
>     max_objects: 2
>     objects:
>       - blobs: {video: samples/starter/videos/norelco-speed.mp4}
> ```
>
> For everything under a prefix, use `bucket_syncs` with `sync_mode: initial_only` instead; see [Object storage and syncs](https://docs.mixpeek.com/docs/ingest/object-storage.md). For an `s3`, `tigris` or `backblaze` connection, `source_path` starts with the bucket name. A seed batch is billed like any batch.

> [accordion] alerts, edges and taxonomy labels
>
> * `alerts:` mirrors the alerts API create request, plus `namespace` and `retriever` by name. See [Alerts, triggers and webhooks](https://docs.mixpeek.com/docs/enrich/alerts-and-triggers.md).
> * `edges:` links two objects, each picked by `bucket` and a `key` of field values that matches exactly one object, with a `type`, optional `inverse_type` and `attributes`. Edges are written after the seed, on both objects, and `traverse_edge` follows them.
> * A `flat` taxonomy can carry inline `labels` with `match_on` (a feature URI) and `target_field`. Apply generates a `<taxonomy>-labels` bucket and collection, a `<taxonomy>-lookup` retriever and a seed. See [Taxonomies](https://docs.mixpeek.com/docs/enrich/taxonomies.md).

> [accordion] acceptance: prove the namespace works
>
> An `acceptance:` block lists steps and what each must return. Apply runs them only with `run_acceptance=true`, which also waits for seed batches and serving apps within `deadline_seconds` (900 by default).
>
> | `kind` | Runs | `expect` |
> | - | - | - |
> | `query` | A declared retriever with `inputs` | `min_results`; `top_field` with `top_equals` or `top_contains` |
> | `documents` | A declared collection's count | `min_documents` |
> | `alert` | A declared alert's triggered executions | `min_fires` |
> | `realtime` | `POST /v1/inference` with `feature_uri` and `inputs` | `dims` |
>
> `max_cost_usd` caps the run from your usage meter. `success` still reports resource creation only; read `acceptance.passed`. To re-run the steps on an existing namespace, apply again with `mode=create_missing&run_acceptance=true`. Steps are billed like the same calls made directly.

## Diff, lint and export

| Call | What it returns |
| - | - |
| `POST /v1/manifest/diff` | `differences` per resource: fields that differ (`differs: ...`) and declared fields it could not compare (`not compared: ...`). Empty means every declared field matched |
| `POST /v1/manifest/lint` | Suggestions with a code, location and `fix_example`, such as `UNUSED_BUCKET`, `TAXONOMY_INPUT_NOT_WRITTEN` and `RETRIEVER_FEATURE_NOT_IN_COLLECTIONS`: wiring that validates but cannot work |
| `GET /v1/manifest/export?namespace_id=ns_...` | The namespace as a manifest that applies as is |

Add `detail=stats` to an export for a read-only `status` section with each collection's document count, field types and common values. Apply ignores `status`.

```bash cURL title="Replicate production into staging" theme={null}
curl "https://api.mixpeek.com/v1/manifest/export?namespace_id=$PROD_NAMESPACE_ID" \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" -o prod.yaml

curl -X POST "https://api.mixpeek.com/v1/manifest/apply" \
  -H "Authorization: Bearer $STAGING_API_KEY" \
  -F "manifest_file=@prod.yaml"
```

In CI, run validate and diff on every pull request and apply with `mode=upsert` on merge.

## Generate a manifest from a description

`POST /v1/manifest/generate` takes a plain-language `description` and returns a manifest. The model writing it reads the live extractor and stage catalogs, then runs the draft through validate and repairs it up to 2 times.

```bash cURL title="Describe it, get a manifest" theme={null}
curl -X POST "https://api.mixpeek.com/v1/manifest/generate" \
  -H "Authorization: Bearer $MIXPEEK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"description": "Search our product videos by what is shown and said, and find every scene with our logo", "manifest_name": "product-video-search"}'
```

| Response field | Meaning |
| - | - |
| `manifest` | The YAML |
| `validation` | `valid`, `errors` and `warnings`. Errors left after the repair rounds stay listed for you to fix |
| `repair_rounds` | 0 to 2 |
| `cost_estimate` | List-price cost per 1,000 items and per month |
| `suggested` | The closest `templates` and `models` |
| `quote` | Present when you send `inventory` (files per bucket) and optionally `queries_per_month`: the indexing charge and monthly price |

> [accordion] Complete example manifest
>
> `GET /v1/discovery/schema` returns this manifest as `example_manifest`, beside a JSON schema for every section, an `extractor_catalog` and a `stage_catalog`. It syncs ad videos from S3 once, seeds sample objects, indexes them in two collections, searches them with a hybrid retriever, tags each scene with a taxonomy, groups scenes with a cluster and states what a working setup returns. It validates once `ads_s3_bucket` is supplied and the secrets `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` exist.
>
> ```yaml theme={null}
> version: "1.0"
> metadata:
>   name: ad-creative-search
>   description: Search video ads by moment, tag each scene with a creative format, group scenes by look
>
> parameters:
>   - name: ads_s3_bucket
>     type: string
>     required: true
>     description: Name of the S3 bucket that holds your ad videos
>   - name: ads_prefix
>     type: string
>     default: ads/
>     description: Folder inside that bucket to sync
>
> namespaces:
>   - name: ad-creative
>     description: Ad creative search
>     feature_extractors:
>       - name: multimodal_extractor
>         version: v2
>     payload_indexes:
>       - {field_name: metadata.brand, type: keyword}
>
> storage_connections:
>   - name: ads-s3
>     provider: s3
>     description: Read access to the bucket that holds the ad videos
>     config:
>       region: us-east-1
>       credentials:
>         type: access_key
>         access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
>         secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
>
> buckets:
>   - name: ads
>     namespace: ad-creative
>     description: Video ads, plus the creative format labels (kind=label)
>     schema:
>       properties:
>         video: {type: video}
>         metadata: {type: object}
>         content: {type: text}
>         label: {type: string}
>         kind: {type: string}
>
> bucket_syncs:
>   - name: ads-from-s3
>     bucket: ads
>     connection: ads-s3
>     source_path: ${{ params.ads_s3_bucket }}/${{ params.ads_prefix }}
>     sync_mode: initial_only
>     file_filters:
>       include_patterns: ["*.mp4", "*.mov"]
>
> seed:
>   - bucket: ads
>     max_objects: 5
>     objects:
>       - blobs: {video: samples/starter/videos/norelco-speed.mp4}
>         kind: ad
>         metadata: {brand: norelco}
>       - texts: {content: "A real customer speaks to camera about the results she saw."}
>         kind: label
>         label: testimonial
>       - texts: {content: "Skin shown before use and after use, side by side."}
>         kind: label
>         label: before-and-after
>
> collections:
>   - name: creative-formats
>     namespace: ad-creative
>     description: Creative format labels, embedded in the same space as the ad scenes
>     source:
>       type: bucket
>       bucket: ads
>       filters: {field: kind, operator: eq, value: label}
>     feature_extractor:
>       feature_extractor_name: multimodal_extractor
>       version: v2
>       input_mappings: {text: content}
>       field_passthrough:
>         - {source_path: label}
>       parameters:
>         run_multimodal_embedding: true
>   - name: ad-scenes
>     namespace: ad-creative
>     description: Every ad split into scenes, with a visual embedding and a transcript embedding
>     source:
>       type: bucket
>       bucket: ads
>       filters: {field: kind, operator: ne, value: label}
>     feature_extractor:
>       feature_extractor_name: multimodal_extractor
>       version: v2
>       input_mappings: {video: video}
>       field_passthrough:
>         - {source_path: metadata.brand}
>       parameters:
>         split_method: scene
>         run_multimodal_embedding: true
>         run_transcription: true
>         run_transcription_embedding: true
>     taxonomy_applications:
>       - {taxonomy: creative-format, execution_mode: materialize}
>
> retrievers:
>   - name: format-lookup
>     namespace: ad-creative
>     description: Finds the closest creative format label for a scene. Used by the creative-format taxonomy.
>     collections: [creative-formats]
>     input_schema:
>       query_embedding: {type: array, required: true}
>     stages:
>       - stage_name: match
>         stage_type: filter
>         config:
>           stage_id: feature_search
>           parameters:
>             searches:
>               - feature_uri: "mixpeek://multimodal_extractor@v2/gemini-embedding-2"
>                 query: {input_mode: vector, vector: "{{INPUT.query_embedding}}"}
>                 top_k: 1
>             final_top_k: 1
>   - name: ad-moment-search
>     namespace: ad-creative
>     description: Describe a moment and get the matching ad scenes
>     collections: [ad-scenes]
>     input_schema:
>       query:
>         type: text
>         required: true
>         description: Describe the moment, the claim or the format
>     stages:
>       - stage_name: recall
>         stage_type: filter
>         config:
>           stage_id: feature_search
>           parameters:
>             searches:
>               - feature_uri: "mixpeek://multimodal_extractor@v2/gemini-embedding-2"
>                 query: {input_mode: text, value: "{{INPUT.query}}"}
>                 top_k: 50
>                 weight: 1.0
>               - feature_uri: "mixpeek://multimodal_extractor@v2/multilingual_e5_large_instruct_v1"
>                 query: {input_mode: text, value: "{{INPUT.query}}"}
>                 top_k: 50
>                 weight: 0.6
>             final_top_k: 20
>
> taxonomies:
>   - name: creative-format
>     namespace: ad-creative
>     description: Tags every scene with its creative format
>     type: flat
>     config:
>       taxonomy_type: flat
>       retriever: format-lookup
>       input_mappings:
>         - {input_key: query_embedding, source_type: vector, path: multimodal_extractor_v2_multimodal_embedding}
>       source_collection:
>         collection: creative-formats
>         enrichment_fields:
>           - {field_path: label, target_field: creative_format, merge_mode: replace}
>
> clusters:
>   - name: visual-styles
>     namespace: ad-creative
>     description: Groups scenes by how they look
>     source_collections: [ad-scenes]
>     cluster_type: vector
>     vector_config:
>       feature_uris: ["mixpeek://multimodal_extractor@v2/gemini-embedding-2"]
>       clustering_method: kmeans
>       algorithm_params: {n_clusters: 6}
>     llm_labeling:
>       provider: google
>       model_name: gemini-2.5-flash
>       labeling_inputs:
>         input_mappings:
>           - {input_key: text, source_type: payload, path: transcription}
>     enrich_source_collection: true
>
> acceptance:
>   max_cost_usd: 5
>   steps:
>     - name: scenes are indexed
>       kind: documents
>       collection: ad-scenes
>       expect: {min_documents: 1}
>     - name: texture query finds a scene
>       kind: query
>       retriever: ad-moment-search
>       inputs: {query: close-up of foundation being blended on skin}
>       expect: {min_results: 1}
> ```

Read the manifest, dry-run it, then apply it. To improve a generated manifest against your own labelled questions, score variants with retriever [evaluations](https://docs.mixpeek.com/docs/retrieve/relevance.md) on a tuning split and compare finalists once on held-out labels. Try retriever changes first (seconds each) before model or extractor changes, which re-process data.

## What goes wrong

| Symptom | Cause |
| - | - |
| Apply refused because a resource exists | Default `create_only`. Use `create_missing` or `upsert` |
| `success: false` with HTTP 200 | Plan errors, a passed deadline, or a rollback. Read `errors` |
| `422` from apply | Every error is in a storage connection's `config` |
| Warning about an unknown top-level key | A typo such as `retreivers:`. The section would otherwise be dropped |
| Retriever returns nothing after apply | The `feature_uri` is not one the collection writes, or the extractor parameter that writes it is off. Run lint |
| Secret refused | The reference is in a field that is stored as written |

## Related

* [Namespaces and branches](https://docs.mixpeek.com/docs/manage/namespaces.md)
* [Templates](https://docs.mixpeek.com/docs/templates/overview.md): deployable manifests for common use cases
* [Apply manifest API](https://docs.mixpeek.com/docs/api-reference/manifest/apply-manifest.md), [Validate](https://docs.mixpeek.com/docs/api-reference/manifest/validate-manifest.md), [Diff](https://docs.mixpeek.com/docs/api-reference/manifest/diff-manifest.md), [Export](https://docs.mixpeek.com/docs/api-reference/manifest/export-manifest.md), [Generate](https://docs.mixpeek.com/docs/api-reference/manifest/generate-manifest.md)


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