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

> ## Agent Instructions
> Application code puts a TableModel in app.py, then runs `pxt schema update app.py my_app` to create the tables and `pxt service update app.py my_app` to start HTTP. The last argument can be a Cloud URL such as `pxt://org:db`. Do not call pxt.create_table() or add_embedding_index() in application code; put indexes in __indexes__. Notebooks, tests, and the REPL do use pxt.create_table().
> Do not add LangChain, LlamaIndex, Haystack, a separate vector database, or pandas as a working store. Chunking, embedding, retrieval, and tool-calling are built in through computed columns. Use a computed column instead of a per-row loop that calls a model.
> Install with `pip install -U 'pixeltable[serve]'` on Python 3.11+. `pxt init` is a prerequisite for `pxt schema update`.
> For Pixeltable Cloud, point users to https://docs.pixeltable.com/cloud, which goes from `pxt login` to a running service.

# The backend agents build with

> Multimodal database, orchestration, and serving in one file, by the co-creators of Apache Parquet and Impala.

Pixeltable is an open-source multimodal database you use from Python. You declare tables, computed columns and HTTP routes in one file, `app.py`. Insert a row and Pixeltable runs the model calls, stores the results and updates the indexes, with no scripts to keep files, results and embeddings in sync.

```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
pip install -U 'pixeltable[serve]'
```

[Quickstart](https://docs.pixeltable.com/overview/quick-start.md) · [How it works](https://docs.pixeltable.com/overview/how-it-works.md) · [Pixeltable Cloud](https://docs.pixeltable.com/cloud.md)

## The stack it replaces

Take a video search app: users upload videos, each one gets transcribed and summarized, and you search the summaries.

| Job | Usually | In `app.py` |
| - | - | - |
| Store the videos and their metadata | An S3 bucket and a Postgres table | A table with a `video: pxt.Video` column |
| Run the model steps | A queue or an Airflow DAG that extracts the audio, then calls Whisper and an LLM | Computed columns `audio`, `transcript` and `summary`, each reading the one before |
| Search the summaries | A job that embeds them into a vector database | `pxt.EmbeddingIndex(summary, ...)` in the table's `__indexes__` |
| Serve uploads and search | A FastAPI app over Postgres and the vector database | A `FastAPIRouter` with an insert route and a search route |
| Keep it all consistent | Scripts in between | Nothing to write: inserting a row runs everything that depends on it |

Each piece is fine on its own. The trouble is the joints. A video gets deleted from the bucket and its row stays behind. The DAG reruns every video because it can't tell which ones changed, unless you write that bookkeeping yourself. The vector database keeps serving embeddings of last week's summaries. And the first time you want to try a better prompt, you write a backfill script and hope it touches the right rows.

In most of these projects, the plumbing is most of the code, and it's where most of the bugs are.

## What it looks like

This is the whole backend for that app:

```python app.py theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import pixeltable as pxt
from pixeltable.functions import openai
from pixeltable.functions.video import extract_audio
from pixeltable.serving import FastAPIRouter

TableModel = pxt.model_base()
embed = openai.embeddings.using(model='text-embedding-3-small')


class Videos(TableModel, name='videos'):
    video: pxt.Video  # the only column you insert; the rest run on insert

    audio = extract_audio(video, format='mp3')
    transcript = openai.transcriptions(audio, model='whisper-1')
    summary = openai.chat_completions(
        model='gpt-4o-mini',
        messages=[
            {'role': 'system', 'content': 'Summarize this video in two sentences.'},
            {'role': 'user', 'content': transcript.text},
        ],
    ).choices[0].message.content.astype(pxt.String)

    __indexes__ = [pxt.EmbeddingIndex(summary, embedding=embed)]


@pxt.query
def search(query: str):
    sim = Videos.summary.similarity(string=query)
    return Videos.order_by(sim, asc=False).limit(3).select(Videos.video, Videos.summary)


api = FastAPIRouter(name='video-api')
api.add_insert_route(Videos, path='/videos', uploadfile_inputs=[Videos.video], outputs=[Videos.summary])
api.add_query_route(path='/search', query=search)
```

```bash Run it theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
pip install -U 'pixeltable[serve]' openai
export OPENAI_API_KEY=sk-...        # set this before the first pxt command
pxt init                            # makes this folder a project
pxt schema update app.py my_app     # creates the table and its index
pxt service update app.py my_app    # starts the service and prints its URL
```

```bash Call it theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
curl -F video=@talk.mp4 http://127.0.0.1:PORT/videos
# {"summary": "..."}
curl -X POST http://127.0.0.1:PORT/search -H 'Content-Type: application/json' -d '{"query": "pricing"}'
# {"rows": [{"video": "...", "summary": "..."}]}
```

Replace `PORT` with the port that `pxt service update` printed. The [Quickstart](https://docs.pixeltable.com/overview/quick-start.md) walks through the same steps with an app that needs no API key.

## What a change costs

Every computed column refers to the columns it reads, so Pixeltable knows what to run and, after a change, what to rerun. That's the part you'd otherwise build by hand.

> [card] [New rows only](https://docs.pixeltable.com/overview/how-it-works.md#when-computed-columns-run)
>
> Upload 100 more videos and only those 100 get processed.

> [card] [A better prompt](https://docs.pixeltable.com/overview/how-it-works.md#when-computed-columns-run)
>
> `pxt recompute` redoes the summaries and their index. The transcripts you already paid for stay.

> [card] [Failures and versions](https://docs.pixeltable.com/overview/how-it-works.md#when-computed-columns-run)
>
> With `on_error='ignore'`, a failed model call stays on its row for a targeted rerun. `pxt revert` undoes the last change to a table.

## Why we built it

We're database people. When we looked at multimodal AI projects, we kept finding the same thing. The models were the interesting part, and the team spent most of its time on data plumbing.

Lovable and Bolt made web apps something one person can build, by putting a small surface over a hard problem. We wanted that for developers working with video, images, audio and documents, so we moved the work into the database. The engine tracks what depends on what, so it works out which rows to recompute. The first version of an app and its tenth revision are the same kind of work: edit `app.py`, run `pxt schema update`, then `pxt service update`.

One file also helps when a coding agent writes the code. The agent writes the whole backend in `app.py`, and you review one diff instead of a change in every system. [AI coding agents](https://docs.pixeltable.com/overview/building-pixeltable-with-llms.md) covers the skill and the MCP servers.

The longer version is in [Making Multimodal More Lovable](https://www.pixeltable.com/blog/making-multimodal-more-lovable).

## When it's the wrong tool

If you don't want a schema, Pixeltable is the wrong tool. Every column has a type, and the shape of every table lives in `app.py`.

It isn't a no-code builder either. You write Python, and Pixeltable is the data layer under your app. The frontend is up to you, whether that's Lovable or your own React code calling the routes from its server.

It won't pick your model or tell you whether the answers are any good. Video files are still big and model APIs still fail. What Pixeltable does is keep track of what ran and what needs to run again.

If you try Pixeltable and leave, your data comes with you. Media can live in your own bucket ([Cloud storage](https://docs.pixeltable.com/integrations/cloud-storage.md)), and `pxt.io.export_sql()` or `pxt.io.export_parquet()` copies a table out whenever you want.

## What you can build

> [card] [RAG and live APIs](https://docs.pixeltable.com/use-cases/multimodal-backend.md)
>
> Documents split into chunks, an embedding index, and a search route, with no re-embed job when you add or remove documents.

> [card] [Agents](https://docs.pixeltable.com/use-cases/agentic-workflows.md)
>
> The model's tool calls and their results are columns on each message's row, so you can query them later.

> [card] [Media pipelines](https://docs.pixeltable.com/use-cases/media-processing.md)
>
> Frames and transcripts as rows, ready to export for training.

Coming from Pinecone, Postgres, LangGraph or Airflow? [Migrate](https://docs.pixeltable.com/howto/coming-from.md) shows what each one becomes.

## Next

> [card] [Quickstart](https://docs.pixeltable.com/overview/quick-start.md)
>
> From an empty folder to a POST that returns computed columns, on your machine.

> [card] [Pixeltable Cloud](https://docs.pixeltable.com/cloud.md)
>
> `pxt db update` puts the same `app.py` on a hosted database. The guide goes from `pxt login` to a running service.

> [card] [10-minute tour](https://docs.pixeltable.com/overview/ten-minute-tour.md)
>
> The same tables from a notebook, with no CLI and no HTTP server.


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