Beginner · 15 min
Build an incremental AI pipeline that only reprocesses new or changed files
An incremental pipeline tracks each file as a row, stores model outputs as computed columns, and recomputes only new or changed rows and their dependents. A new file, a changed file, or a changed prompt reruns that work; unchanged rows keep their stored results. Pixeltable is the unified multimodal AI backend for apps and agents that need this cache.
The Challenge
The usual answer to "only reprocess new or changed files" is a stitch: cron or Airflow/Prefect to list a folder, hash each file, skip known hashes, call a model, write vectors into pgvector or another store, then hope the skip list matches the table. Ray or Spark will scan a lake; skip logic is yours. Databricks jobs on Delta can MERGE, if you write that job. cocoindex-style frameworks track source files and rebuild derived index entries for what changed; you still own serving. A Python loop that restarts from file zero pays the model again.
The Solution
Declare a Document (or other media) column, a computed column that calls a model, and an optional embedding index. Insert a new file and only that row runs. Update the file or its source text and only that row and its dependents recompute. After you edit a prompt or a model expression, pxt recompute reruns that column. The catalog, not a hash file you maintain, is the cache. Keep Ray, Spark, Daft, or Databricks for a lake backfill and load the result.
Implementation Guide
Step-by-step walkthrough with code examples
Track each file as a row
Store the file as a typed Document column. Apply the file with pxt schema update; do not call create_table at import.
1import pixeltable as pxt2from pixeltable.functions.document import document_splitter3from pixeltable.functions.openai import chat_completions, embeddings45TableModel = pxt.model_base()6embed = embeddings.using(model='text-embedding-3-small')78class Docs(TableModel, name='docs'):9 title: pxt.String10 document: pxt.Document
What reruns when a file, a prompt, or a model changes
| Cron + Airflow/Prefect + hashes + vector DB | Ray / Spark batch | Databricks (Delta + jobs) | cocoindex-style framework | Pixeltable computed columns | |
|---|---|---|---|---|---|
| New file | Your skip list must miss it, then you write the vector | The job you launch; skip logic is yours | Auto Loader can ingest new files; you still write the pipeline that embeds | Recomputes derived entries for that source | Insert the row; only that row runs |
| Changed file | Hash must change, then you overwrite the vector | Rerun the scan unless you key the sink | A Delta Sync index re-embeds changed rows; MERGE or a job still owns the table | Rebuilds derived entries for that source | Update the Document column; the splitter view and dependents of that file recompute |
| Changed prompt or model | You invalidate caches and replay the DAG | Relaunch the job | Relaunch the job | Rebuild the derived index | pxt recompute on that column; unrelated columns stay cached |
| Where state lives | Hash file, object store, orchestrator, vector DB | The sink you write | Delta tables, Auto Loader, jobs, and an optional Delta Sync index | The framework store plus the store you serve from | The catalog: source columns, computed columns, indexes |
Key Benefits
Real Applications
Prerequisites
How-to guides
Learn More
Recompute only the rows a change affects
A stored column computed from other columns on insert and update
Cache per row; a lake scan is a batch engine, not a Python loop
Assign chat_completions on the class so each new or changed row runs
Chunk, embed, retrieve, and generate on the same incremental table
Docs: expressions, stored results, and recompute
Always-fresh indexes without rebuilds
Deep dive into incremental computation
Related Guides
- Production RAG: From Documents to Answers in One System
Modality: Document
Computed column: Chunk view plus an embedding index, then an LLM column for the answer
Docs - AI Agents & MCP: Give Your Agents Persistent Multimodal Memory
Modality: Agent state
Computed column: Tool results stored as computed columns on the row
Docs - Store call audio, transcripts and embeddings so a voice agent can retrieve them
Modality: Audio
Computed column: One table: Audio column, Whisper or hosted STT, audio_splitter segments, EmbeddingIndex on text
Docs
Frequently asked questions
What happens when I change the model or prompt?
How does it detect changed files?
Can I keep Airflow or Prefect?
Do I still need Ray, Spark, or Databricks?
Does a new insert reprocess the whole table?
Do I still need a separate vector database?
Ready to get started?
Install Pixeltable and start building in minutes. One Python file for tables, indexes, and HTTP.