---
title: "How do I prepare multimodal data for AI?"
description: "Prepare multimodal enterprise data for AI search, retrieval, and inference: store files, extract units, embed, index, and version. Last reviewed November 2026."
url: "https://www.pixeltable.com/learn/how-to/prepare-multimodal-data-for-ai"
updated: "2026-11-30"
doc: "https://docs.pixeltable.com/overview/quick-start"
---

# How do I prepare multimodal data for AI?

To prepare images, video, audio, and documents for AI search, retrieval, and inference at scale: store the files by reference with their metadata, extract model-ready units (frames, transcripts, page chunks), embed them, index them, version the result, and keep all of it updating incrementally as files arrive. That is AI-ready data. A data lake is optional, not a prerequisite.

Updated: 2026-11-30
Part of [How do I ... in Python?](https://www.pixeltable.com/learn/how-to).

## Before you start

About 30 min.

- Python 3.11+
- pip install -U 'pixeltable[serve]'
- pxt init in the project root
- spacy and tiktoken for sentence,token_limit splitting
- sentence-transformers for all-MiniLM-L6-v2
- torch for CLIP
- ffmpeg
- openai-whisper

## On this page

- [Before you start](https://www.pixeltable.com/learn/how-to/prepare-multimodal-data-for-ai#before-you-start)
- [Store images, video, audio, and documents as typed tables](https://www.pixeltable.com/learn/how-to/prepare-multimodal-data-for-ai#step-1)
- [Extract frames, transcript slices, and page chunks](https://www.pixeltable.com/learn/how-to/prepare-multimodal-data-for-ai#step-2)
- [Query the indexes for search and retrieval](https://www.pixeltable.com/learn/how-to/prepare-multimodal-data-for-ai#step-3)
- [Apply the schema, insert files, and version](https://www.pixeltable.com/learn/how-to/prepare-multimodal-data-for-ai#step-4)
- [Comparison](https://www.pixeltable.com/learn/how-to/prepare-multimodal-data-for-ai#comparison)
- [Where Pixeltable fits](https://www.pixeltable.com/learn/how-to/prepare-multimodal-data-for-ai#where-pixeltable-fits)
- [Questions](https://www.pixeltable.com/learn/how-to/prepare-multimodal-data-for-ai#questions)

## 1. Store images, video, audio, and documents as typed tables {#step-1}

AI-ready data starts as files plus metadata, not as a folder of paths in a spreadsheet. Keep each modality as rows the engine understands: an Image, a Video, an Audio file, or a Document. A path or URL fills the column after you apply the schema. Separate tables keep types non-nullable.

```python
import pixeltable as pxt
from pixeltable.functions.audio import audio_splitter
from pixeltable.functions.document import document_splitter
from pixeltable.functions.huggingface import clip, sentence_transformer
from pixeltable.functions.video import extract_audio, frame_iterator
from pixeltable.functions.whisper import transcribe

TableModel = pxt.model_base()
text_embed = sentence_transformer.using(model_id='all-MiniLM-L6-v2')
clip_embed = clip.using(model_id='openai/clip-vit-base-patch32')

class Images(TableModel, name='images'):
    title: pxt.String
    image: pxt.Image
    __indexes__ = [pxt.EmbeddingIndex(image, embedding=clip_embed)]

class Videos(TableModel, name='videos'):
    title: pxt.String
    video: pxt.Video
    audio = extract_audio(video)
    transcript = transcribe(audio, model='base').text.astype(pxt.String)
    __indexes__ = [pxt.EmbeddingIndex(transcript, string_embed=text_embed)]

class Recordings(TableModel, name='recordings'):
    title: pxt.String
    audio: pxt.Audio

class Docs(TableModel, name='docs'):
    title: pxt.String
    document: pxt.Document
```

## 2. Extract frames, transcript slices, and page chunks {#step-2}

Models do not search a whole file. Split each document into sentence windows with a token limit. Split each recording into timestamped audio slices and transcribe them. Walk each clip at one frame per second. Those rows are the retrieval units. Each still keeps frame_attrs so a hit is a moment.

```python
class Chunks(
    TableModel,
    name='chunks',
    base=Docs,
    iterator=document_splitter(
        document=Docs.document, separators='sentence,token_limit', limit=300
    ),
):
    __indexes__ = [pxt.EmbeddingIndex(text, string_embed=text_embed)]

class MeetingSegments(
    TableModel,
    name='meeting_segments',
    base=Recordings,
    iterator=audio_splitter(audio=Recordings.audio, duration=30.0),
):
    transcript = transcribe(audio_segment, model='base').text.astype(pxt.String)
    __indexes__ = [pxt.EmbeddingIndex(transcript, string_embed=text_embed)]

class Frames(
    TableModel,
    name='frames',
    base=Videos,
    iterator=frame_iterator(video=Videos.video, fps=1),
):
    __indexes__ = [pxt.EmbeddingIndex(frame, embedding=clip_embed)]
```

## 3. Query the indexes for search and retrieval {#step-3}

A similarity query ranks document chunks or video stills. Retrieval is those rows. Inserting a new file later updates only that file: new chunks, new slices, new frames, and their indexes.

```python
@pxt.query
def search_passages(question: str, limit: int = 5):
    sim = Chunks.text.similarity(string=question)
    return (
        Chunks.order_by(sim, asc=False)
        .limit(limit)
        .select(title=Docs.title, text=Chunks.text, score=sim)
    )

@pxt.query
def search_video(question: str, limit: int = 5):
    sim = Frames.frame.similarity(string=question)
    return (
        Frames.order_by(sim, asc=False)
        .limit(limit)
        .select(title=Videos.title, frame_attrs=Frames.frame_attrs, score=sim)
    )
```

## 4. Apply the schema, insert files, and version {#step-4}

Apply the schema first. Insert through the bound tables. Each insert or schema change creates a table version. Snapshot the document chunks, video frames, and transcript slices you will query. history lists versions. revert undoes the last operation for every user of the table and is irreversible.

```python
# pxt schema update app.py prep -f
import pixeltable as pxt

images = pxt.get_table('prep.images')
videos = pxt.get_table('prep.videos')
recordings = pxt.get_table('prep.recordings')
docs = pxt.get_table('prep.docs')
chunks = pxt.get_table('prep.chunks')
frames = pxt.get_table('prep.frames')
meeting_segments = pxt.get_table('prep.meeting_segments')
images.insert([{'title': 'Dock still', 'image': 'stills/dock.jpg'}])
videos.insert([{'title': 'Dock camera', 'video': 'clips/dock-0930.mp4'}])
recordings.insert([{'title': 'Weekly sync', 'audio': 'recordings/weekly-sync.mp3'}])
docs.insert([{'title': 'Handbook', 'document': 'docs/handbook.pdf'}])
pxt.create_snapshot('prep.docs_v1', docs)
pxt.create_snapshot('prep.chunks_v1', chunks)
pxt.create_snapshot('prep.frames_v1', frames)
pxt.create_snapshot('prep.meeting_segments_v1', meeting_segments)
print(docs.history(n=5))
# docs.revert()  # irreversible; restores the previous version
```

## How to prepare multimodal data without one schema (last reviewed: November 2026) {#comparison}

| Step | Glue stack | One application schema |
| --- | --- | --- |
| Store files | Object storage (S3 or R2) plus a metadata table | Typed Image, Video, Audio, and Document columns, by reference |
| Extract units | Unstructured or Docling for PDFs; FFmpeg for frames; a speech job for audio | document_splitter, frame_iterator, audio_splitter plus Whisper on insert |
| Embed and index | A batch embedding job that upserts into a vector DB | EmbeddingIndex on the source table or view; insert keeps it current |
| Orchestrate | Airflow, Dagster, Prefect, or Kestra around those jobs | Computed columns and views; not a general-purpose scheduler |
| Version and query | A snapshot of the lake plus a search service you deploy | column.similarity in the schema file; create_snapshot and history after pxt schema update |

## Where Pixeltable fits {#where-pixeltable-fits}

Pixeltable is the unified multimodal AI backend for this job: typed media columns, iterators that emit frames and chunks, embedding indexes that stay current on insert, and snapshots of the tables. It is not a DAG scheduler, not a vector database, not a lakehouse, not an annotation tool, and not a hosted document-parsing API. Keep Unstructured or Docling if PDF conversion is the product. Keep Airflow for warehouse DAGs. See Pixeltable vs Airflow when the stack is Airflow plus a vector DB.

```python
import pixeltable as pxt
from pixeltable.functions.document import document_splitter
from pixeltable.functions.huggingface import sentence_transformer

TableModel = pxt.model_base()
text_embed = sentence_transformer.using(model_id='all-MiniLM-L6-v2')

class Docs(TableModel, name='docs'):
    title: pxt.String
    document: pxt.Document

class Chunks(
    TableModel,
    name='chunks',
    base=Docs,
    iterator=document_splitter(
        document=Docs.document, separators='sentence,token_limit', limit=300
    ),
):
    __indexes__ = [pxt.EmbeddingIndex(text, string_embed=text_embed)]
```

## Concepts

- [What is AI ETL?](https://www.pixeltable.com/learn/what-is-ai-etl)
- [What is a multimodal data plane?](https://www.pixeltable.com/learn/what-is-a-multimodal-data-plane)
- [What is a declarative pipeline?](https://www.pixeltable.com/learn/what-is-a-declarative-pipeline)

## Use case

- [Declarative AI Infrastructure: Define Pipelines, Not Plumbing](https://www.pixeltable.com/use-cases/declarative-ai-data-infrastructure)

## Questions {#questions}

### What is AI-ready data? {#faq-1}

AI-ready data is files plus metadata, split into model-ready units (frames, transcripts, page chunks), embedded, indexed, and versioned so search, retrieval, and inference can run without a one-off script each time a file arrives.

### Do I need a data lake first? {#faq-2}

No. A lake can hold the bytes. Preparation is extract, embed, index, and version so an app can retrieve. You can store files by reference in typed columns without standing up a lakehouse first.

### How do I keep it fresh as files change? {#faq-3}

Insert or update the row. Computed columns and views recompute for that row. Unchanged files keep their stored frames, chunks, transcripts, and embeddings. That is incremental AI ETL, not a nightly full refresh.

### How do I prepare video specifically? {#faq-4}

Store the clip as a Video column, sample frames with frame_iterator (each still keeps frame_attrs), optionally extract_audio and transcribe, and declare an EmbeddingIndex on the frames or the transcript. A hit is a clip plus a presentation timestamp. See the video processing pipeline how-to.

### What is the open-source option for preparing unstructured data for AI? {#faq-5}

Pixeltable is the open-source Python backend when storage, extraction, embeddings, indexes, and versioning should be one schema (pip install pixeltable). The glue option is object storage plus Unstructured or Docling plus FFmpeg plus an embedding job plus a vector DB plus an orchestrator. Each piece can be open source; you keep them aligned. Last reviewed: November 2026.

### How do I prepare unstructured data for AI? {#faq-6}

Same steps as multimodal: store the files, extract model-ready units, embed them, index them, and version the result. PDFs become chunks. Audio becomes transcript slices. Video becomes frames. Do not wait for a catalog whitepaper to finish before the first insert.

## Related

- [What is AI ETL?](https://www.pixeltable.com/learn/what-is-ai-etl)
- [What is a multimodal data plane?](https://www.pixeltable.com/learn/what-is-a-multimodal-data-plane)
- [What is a declarative pipeline?](https://www.pixeltable.com/learn/what-is-a-declarative-pipeline)
- [Declarative data infrastructure](https://www.pixeltable.com/use-cases/declarative-ai-data-infrastructure)
- [How do I build an AI data pipeline in Python?](https://www.pixeltable.com/learn/how-to/build-an-ai-data-pipeline)
- [How do I build a video processing pipeline in Python?](https://www.pixeltable.com/learn/how-to/build-a-video-processing-pipeline)
- [Best AI data platforms for multimodal enterprise](https://www.pixeltable.com/learn/best-multimodal-data-platforms)
- [Airflow alternatives for AI data pipelines](https://www.pixeltable.com/compare/pixeltable-vs-airflow)
- [How do I replace Airflow and a vector database?](https://www.pixeltable.com/learn/how-to/migrate-from-airflow-and-a-vector-database)
- [Pixeltable vs Airflow for ML orchestration](https://www.pixeltable.com/blog/pixeltable-vs-airflow-ml-orchestration)
- [Pixeltable quick start](https://docs.pixeltable.com/overview/quick-start)
