---
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"
---

[Back to Modules](/university)

### Module 1 of 8

0 completed · 8 remaining

0%

BeginnerModule 0·414·By Ethan

# The Data Transformation Pipeline

Master the Mixpeek philosophy: Objects → Documents → Enriched Knowledge. Learn the three-layer architecture, decomposition and recomposition patterns, and configuration-over-code principles.

mental-modelsarchitecturepipelinesfoundationsphilosophy

Mark as Complete

ContentTranscriptResourcesQuiz

Before diving into multimodal AI, you need to understand how Mixpeek thinks about data. This isn't just architecture: it's a philosophy that shapes every decision in the platform.

**The core insight**: Raw files aren't searchable. Intelligence emerges through transformation.

## The Fundamental Transformation

Every piece of content you work with follows the same journey:

`Objects → Documents → Enriched Knowledge`

Let's break this down:

### Objects: The Raw Material

Objects are your source files: videos, images, PDFs, audio files. They're stored in **Buckets**, which are essentially raw storage containers.

**Characteristics of Objects:**

*   Immutable source files
*   Binary blobs (not directly searchable)
*   Complete fidelity to original
*   The ground truth

\# Objects live in Buckets
bucket = mixpeek.buckets.create(
    name="marketing-assets",
    storage\_config={
        "provider": "s3",
        "bucket": "my-company-assets"
    }
)

### Documents: The Searchable Layer

Documents are what Objects become after decomposition. A single video might produce dozens of documents: one per scene, frame, transcript segment, or detected entity.

**Characteristics of Documents:**

*   Structured, indexed data
*   Live in **Collections**
*   Searchable via vector and keyword queries
*   Maintain lineage to source Objects

\# Documents live in Collections
collection = mixpeek.collections.create(
    name="marketing-content",
    pipeline={
        "video": {
            "extract": \["scenes", "transcripts", "faces", "objects"\]
        }
    }
)

### Enriched Knowledge: The Intelligence Layer

Enriched Knowledge emerges when Documents are composed, compared, and augmented. This happens through **Retrievers**: composed search interfaces that span multiple Collections.

**Characteristics of Enriched Knowledge:**

*   Multi-source insights
*   Similarity-based relationships
*   Aggregated intelligence
*   Ready for downstream applications

\# Retrievers compose knowledge
retriever = mixpeek.retrievers.create(
    name="brand-intelligence",
    sources=\[
        {"collection": "marketing-content", "weight": 0.7},
        {"collection": "competitor-content", "weight": 0.3}
    \]
)

## The Three-Layer Architecture

Mixpeek's architecture maps directly to this transformation:

Layer

Component

Purpose

**3**

RETRIEVERS

Composed Search / Enriched Knowledge

**2**

COLLECTIONS

Indexed Documents / Search

**1**

BUCKETS

Raw Objects / Storage

### Layer 1: Buckets (Raw Storage)

Buckets connect to your existing storage:

*   S3, GCS, Azure Blob
*   Local filesystems
*   HTTP/HTTPS endpoints

They're passive: just pointers to where your Objects live.

### Layer 2: Collections (Searchable)

Collections are active. When Objects flow in:

1.  **Decomposition** breaks them into semantic units
2.  **Extraction** pulls features from each unit
3.  **Embedding** creates vector representations
4.  **Indexing** makes everything searchable

### Layer 3: Retrievers (Composed)

Retrievers are the interface layer:

*   Combine multiple Collections
*   Apply business logic and weighting
*   Handle ranking and reranking
*   Deliver unified results

## Decomposition: Breaking Things Apart

The magic happens in decomposition. Complex Objects become many simple Documents.

### Video Decomposition Example

A 60-second video ad might decompose into:

**Original:** `ad_creative.mp4`

*   12 scene documents (scene changes)
*   180 frame documents (3 FPS sampling)
*   24 transcript chunks (by sentence)
*   8 face documents (detected people)
*   15 object documents (products, logos)
*   1 audio embedding document

Each document is independently searchable, but all maintain **lineage** back to the source.

\# Decomposition is configured, not coded
pipeline = {
    "video": {
        "scenes": {
            "method": "content\_aware",
            "min\_duration": 2.0
        },
        "frames": {
            "sample\_rate": 3,  # 3 FPS
            "keyframes\_only": False
        },
        "transcription": {
            "chunk\_by": "sentence",
            "language": "auto"
        },
        "faces": {
            "min\_confidence": 0.9,
            "recognize": True
        },
        "objects": {
            "categories": \["products", "logos", "text"\]
        }
    }
}

### Why Decomposition Matters

1.  **Granular Search**: Find the exact moment, not just the video
2.  **Multi-Modal Alignment**: Match text to visuals to audio
3.  **Composability**: Recombine in novel ways
4.  **Efficiency**: Only retrieve what you need

## Recomposition: Putting Things Together

Decomposition creates parts. Recomposition creates intelligence.

### Multi-Stage Pipelines

\# Stage 1: Retrieve relevant scenes
scenes = retriever.search(
    query="product demonstration",
    filters={"type": "scene"},
    limit=50
)

# Stage 2: Enrich with face detection results
enriched = \[\]
for scene in scenes:
    faces = collection.search(
        query={"object\_id": scene.id},
        filters={"type": "face"}
    )
    scene.faces = faces
    enriched.append(scene)

# Stage 3: Aggregate by product
products = aggregate\_by\_product(enriched)

### Retriever Composition

Retrievers can compose across Collections:

retriever = mixpeek.retrievers.create(
    name="competitive-intelligence",
    stages=\[
        {
            "name": "brand\_content",
            "collection": "our-ads",
            "weight": 0.5
        },
        {
            "name": "competitor\_content",
            "collection": "competitor-ads",
            "weight": 0.5
        }
    \],
    merge\_strategy="interleave",
    rerank={
        "model": "cross-encoder",
        "top\_k": 20
    }
)

## Enrichment as Immutable Joins

Here's a principle that separates Mixpeek from traditional databases:

> **Don't mutate. Enrich through similarity.**

### The Problem with Mutation

Traditional approach:

\# BAD: Mutating the original record
video.brand\_safety\_score = 0.85
video.categories = \["automotive", "luxury"\]
video.save()  # Overwrites original

Problems:

*   Loses history
*   Couples analysis to storage
*   Can't run multiple analyses
*   No provenance

### The Enrichment Pattern

Mixpeek approach:

\# GOOD: Enrich through similarity join
enrichment = mixpeek.enrichments.create(
    source\_collection="videos",
    enrichment\_type="brand\_safety",
    config={
        "model": "brand-safety-v2",
        "threshold": 0.7
    }
)

# Results are a separate layer, joined by similarity
results = retriever.search(
    query="safe automotive content",
    enrichments=\["brand\_safety"\],  # Include enrichment data
    filters={"brand\_safety.score": {"$gte": 0.9}}
)

### Benefits of Immutable Enrichment

1.  **Full History**: See how classifications changed over time
2.  **Multiple Perspectives**: Run different models on same content
3.  **A/B Testing**: Compare enrichment strategies
4.  **Debugging**: Trace why a result was classified a certain way

## Configuration Over Code

Mixpeek pipelines are declarative. You describe _what_ you want, not _how_ to do it.

### Declarative Pipeline Definition

\# pipeline.yaml
name: video-intelligence
version: 1.0

sources:
  - bucket: marketing-assets
    patterns: \["\*.mp4", "\*.mov"\]

decomposition:
  video:
    scenes:
      method: content\_aware
      min\_scene\_duration: 2.0
    transcription:
      model: whisper-large
      chunk\_strategy: sentence
    embeddings:
      models:
        - name: clip-vit-large
          apply\_to: frames
        - name: text-embedding-3-large
          apply\_to: transcripts

enrichment:
  - type: classification
    model: brand-safety-v3
    apply\_to: scenes
  - type: entity\_extraction
    model: product-detection
    apply\_to: frames

output:
  collection: video-intelligence
  retriever: brand-content-search

### Why Configuration Over Code

1.  **Version Control**: Track pipeline changes in git
2.  **Reproducibility**: Same config = same results
3.  **Auditability**: See exactly what processing occurred
4.  **Portability**: Move pipelines between environments

## Lineage: Provenance as First-Class

Every Document knows where it came from. This isn't metadata: it's core to the architecture.

### The Lineage Chain

**Object** (source video)

*   **Document** (scene at 0:45)
    *   Embedding (CLIP vector)
    *   Enrichment (brand safety: 0.92)
    *   Enrichment (category: automotive)

### Querying Lineage

\# Get the source of any document
doc = collection.get("doc\_12345")
lineage = doc.lineage

print(lineage)
# {
#     "object\_id": "obj\_abc",
#     "object\_url": "s3://bucket/video.mp4",
#     "extraction\_timestamp": "2024-01-15T10:30:00Z",
#     "pipeline\_version": "1.2.0",
#     "extraction\_config": {...},
#     "parent\_documents": \["doc\_123", "doc\_456"\]
# }

# Navigate back to source
source = mixpeek.objects.get(lineage\["object\_id"\])

### Why Lineage Matters

1.  **Debugging**: Why did search return this result?
2.  **Compliance**: Prove data processing chain
3.  **Reproducibility**: Recreate any result
4.  **Updates**: Know what to reprocess when pipelines change

## Putting It All Together

Let's trace a complete flow:

from mixpeek import Mixpeek

client = Mixpeek(api\_key="your\_key")

# 1. Connect raw storage (Objects)
bucket = client.buckets.create(
    name="ad-creatives",
    source="s3://my-bucket/ads/"
)

# 2. Define processing (Decomposition)
collection = client.collections.create(
    name="ad-intelligence",
    bucket\_id=bucket.id,
    pipeline={
        "video": {
            "scenes": {"method": "content\_aware"},
            "transcription": {"model": "whisper"},
            "embeddings": {"model": "clip-vit-large"}
        }
    }
)

# 3. Add enrichment layers
client.enrichments.create(
    collection\_id=collection.id,
    type="brand\_safety",
    model="brand-safety-v3"
)

# 4. Create search interface (Retriever)
retriever = client.retrievers.create(
    name="safe-ad-search",
    collection\_id=collection.id,
    filters={
        "brand\_safety.score": {"$gte": 0.9}
    }
)

# 5. Query enriched knowledge
results = retriever.search(
    query="energetic product demonstration",
    limit=10
)

# 6. Trace lineage
for result in results:
    print(f"Scene from: {result.lineage\['object\_url'\]}")
    print(f"Timestamp: {result.metadata\['start\_time'\]}")
    print(f"Safety: {result.enrichments\['brand\_safety'\]\['score'\]}")

## Key Takeaways

1.  **Objects → Documents → Knowledge**: This is the fundamental transformation
2.  **Three Layers**: Buckets (storage) → Collections (search) → Retrievers (composition)
3.  **Decompose to Compose**: Break complex things into searchable parts, then recombine
4.  **Enrich, Don't Mutate**: Add layers of intelligence without modifying source data
5.  **Configure, Don't Code**: Declarative pipelines are reproducible and auditable
6.  **Lineage is Core**: Every result traces back to its source

## What's Next?

Now that you understand the mental model, you're ready to dive into the details:

*   **Module 1**: What Is Multimodal Data?
*   **Module 2**: From Pixels to Vectors
*   **Module 3**: Vector Databases & Why They Matter

* * *

## Resources

*   [Mixpeek Architecture Docs](https://mixpeek.com/docs/relevance/architecture)
*   [Pipeline Configuration Reference](https://mixpeek.com/docs/platform/processing)
*   [Lineage API Reference](https://mixpeek.com/docs/retrieval/lineage-traversal)

## Discussion Questions

*   How does your current system handle provenance tracking?
*   What would change if you stopped mutating and started enriching?
*   Where in your pipeline would decomposition add the most value?

## Frequently Asked Questions

What is the data transformation pipeline in Mixpeek?

What are Buckets, Collections, and Retrievers?

What is decomposition in the context of Mixpeek?

What does configuration-over-code mean in Mixpeek?

K/J

Next

What Are Embeddings?

Ready to build?

## Try it in Mixpeek Studio

Experience the power of multimodal AI firsthand. Build, test, and deploy your application with our intuitive visual interface.

[Launch Studio](https://studio.mixpeek.com/?utm_source=homepage&utm_medium=education_cta&utm_campaign=mvs_onramp)[View Documentation](https://mixpeek.com/docs)

### Quick Start with API

Get started in seconds with a simple API call

[API Reference](https://mixpeek.com/docs/api-reference)

cURL

```bash
1curl -X POST https://api.mixpeek.com/index \
2  -H "Authorization: Bearer YOUR_API_KEY" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "url": "https://example.com/video.mp4",
6    "collection": "my_collection"
7  }'
```

#### Blog & Tutorials

Read our latest articles, guides, and technical deep dives

[Read Blog →](/blog)

#### Community Hub

Connect with developers, share projects, and get help from experts

[Join Community →](/community)

#### Video Library

Watch curated playlists and step-by-step video tutorials

[Watch Videos →](/videos)