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

# Migrate to Pixeltable

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

Hosted catalog: [Cloud](https://docs.pixeltable.com/cloud.md). 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](https://docs.pixeltable.com/overview/quick-start.md)); the snippets assume that already ran.

> [tab] 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](https://docs.pixeltable.com/platform/embedding-indexes.md)

> [tab] Postgres
>
> 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](https://docs.pixeltable.com/howto/deployment/overview.md)).

> [tab] 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](https://docs.pixeltable.com/howto/cookbooks/agents/llm-tool-calling.md)

> [tab] 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](https://docs.pixeltable.com/howto/cookbooks/video/video-extract-frames.md)

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

> [card] [Quickstart](https://docs.pixeltable.com/overview/quick-start.md)
>
> Write `app.py`, run `pxt schema update`, then insert from Python or HTTP.

> [card] [HTTP serving](https://docs.pixeltable.com/howto/deployment/serving.md)
>
> Insert, compute, update, delete, query, uploads, background jobs.


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