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

# Migrate to Pixeltable

> Pick the stack you already run. Inserting a row replaces the extra store or orchestrator.

Hosted catalog: [Cloud](/howto/deployment/cloud). This page maps the stack you already run onto Pixeltable.

Defining the class does not create the table. Run `pxt schema update app.py my_app` first ([Quickstart](/overview/quick-start)); the snippets assume that already ran.

<Tabs>
  <Tab title="Pinecone and Milvus" icon="magnifying-glass">
    <div id="pinecone-and-milvus" />

    You do not need a separate vector database. The embedding index sits on the column. Insert keeps it current.

    ```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
    import pixeltable as pxt
    import pixeltable.functions as pxtf

    TableModel = pxt.model_base()


    class Items(TableModel, name='items'):
        body: pxt.String
        __indexes__ = [
            pxt.EmbeddingIndex(
                body,
                embedding=pxtf.huggingface.sentence_transformer.using(
                    model_id='sentence-transformers/all-MiniLM-L6-v2'
                ),
                name='body_idx',
            )
        ]
    ```

    ```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
    items = pxt.get_table('my_app.items')
    sim = items.body.similarity(string='application file')
    items.order_by(sim, asc=False).limit(5).select(items.body)
    ```

    [Embedding indexes](/platform/embedding-indexes)
  </Tab>

  <Tab title="Postgres" icon="database">
    You do not need a separate RDBMS for application rows. Typed columns, insert, and select live in the catalog.

    ```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
    import pixeltable as pxt

    TableModel = pxt.model_base()


    class Orders(TableModel, name='orders'):
        sku: pxt.String
        qty: pxt.Int
        note: pxt.String | None
        __indexes__ = [pxt.BtreeIndex(sku)]
    ```

    ```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
    orders = pxt.get_table('my_app.orders')
    orders.insert([{'sku': 'a1', 'qty': 2, 'note': None}])
    orders.where(orders.qty > 1).select(orders.sku, orders.qty).collect()
    ```

    If another system must keep a SQL copy, export with `export_sql` (example on [Self-hosting](/howto/deployment/overview)).
  </Tab>

  <Tab title="LangGraph" icon="robot">
    <div id="langgraph" />

    You do not need StateGraph, ToolNode, or a checkpointer. After `pxt schema update`, insert `{'message': '...'}` and read `response` and `tool_output`.

    ```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
    import pixeltable as pxt
    import pixeltable.functions as pxtf

    TableModel = pxt.model_base()


    @pxt.udf
    def get_weather(city: str) -> str:
        return f'Weather in {city}: 72°F, sunny'


    tools = pxt.tools(get_weather)


    class Assistant(TableModel, name='assistant'):
        message: pxt.String
        response = pxtf.openai.chat_completions(
            messages=[{'role': 'user', 'content': message}],
            model='gpt-4o-mini',
            tools=tools,
        )
        tool_output = pxtf.openai.invoke_tools(tools, response)
    ```

    [Tool calling cookbook](/howto/cookbooks/agents/llm-tool-calling)
  </Tab>

  <Tab title="Scripts and Airflow" icon="gears">
    <div id="scripts-and-airflow" />

    You do not need a frame loop, cron, or a full re-run. Insert a video. The iterator adds a `frame` column on `Frames`; `thumb` is a computed column from that `frame`.

    ```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
    import pixeltable as pxt
    import pixeltable.functions as pxtf

    TableModel = pxt.model_base()


    class Videos(TableModel, name='videos'):
        video: pxt.Video


    class Frames(
        TableModel,
        name='frames',
        base=Videos,
        iterator=pxtf.video.frame_iterator(Videos.video, fps=1),
    ):
        # iterator output
        thumb = frame.resize((256, 256))  # type: ignore[name-defined]
    ```

    [Extract video frames](/howto/cookbooks/video/video-extract-frames)
  </Tab>
</Tabs>

After `pxt schema update`, insert with `table.insert([...])` as in the snippets above, or POST after `pxt service update` ([Quickstart](/overview/quick-start)).

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/overview/quick-start">
    Write `app.py`, run `pxt schema update`, then insert from Python or HTTP.
  </Card>

  <Card title="HTTP serving" icon="globe" href="/howto/deployment/serving">
    Insert, compute, update, delete, query, uploads, background jobs.
  </Card>
</CardGroup>
