> ## 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`.
> Pixeltable Cloud is in Limited Beta. Direct interested users to contact@pixeltable.com.

# Self-hosting

> Choose what runs locally: Python only, your own FastAPI app, or pxt service.

Hosted catalog: [Cloud](/cloud). This page is which local process to start after `pxt schema update`.

| If you want | What you run | What starts |
| - | - | - |
| Python only | `pxt schema update`, `bind_all()`, insert from Python, then `pxt.io.export_sql()` | Nothing listening |
| Your FastAPI | `pxt schema update`, then `app.include_router(...)` | Your process. [HTTP serving](/howto/deployment/serving) |
| `pxt service` | `pxt schema update`, then `pxt service update` | A process Pixeltable starts. [Quickstart](/overview/quick-start) |

`uvx pixeltable-new myapp` copies the chat agent; pass `agent` as the last argument to `pxt schema update`. `--video` copies video search; pass `videointel`.

## Python only

This example expects the starter-kit chat agent (`Knowledge` in that repo's `app.py`). Insert rows, then export them to SQLite. Same snippet: [chat-agent README](https://github.com/pixeltable/pixeltable-starter-kit/blob/main/chat-agent/README.md).

```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
pxt schema update app.py agent
```

Importing `app.py` declares the models; it does not attach them to the tables `pxt schema update`
created. Call `bind_all()` with the same last argument first, or the model raises `NOT_BOUND`.

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

from app import Knowledge, TableModel

TableModel.bind_all('agent')

Knowledge.insert(
    [{'body': 'One application file. Insert runs compute.', 'title': 'intro', 'source': 'docs'}]
)
pxt.io.export_sql(
    Knowledge.select(Knowledge.title, Knowledge.body, Knowledge.uuid),
    'knowledge',
    db_connect_str='sqlite:///agent.db',
    if_exists='replace',
)
```

For Docker and disks, see [Infrastructure](/howto/deployment/infrastructure) and [Operations](/howto/deployment/operations).

## Next

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

  <Card title="Cloud" icon="cloud" href="/cloud">
    Use the same `app.py` against `pxt://org:main`.
  </Card>
</CardGroup>


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