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

# Security and backup

> pg_dump the catalog, restore, keep secrets out of app.py.

Hosted databases are backed up by Pixeltable Cloud. For a local database, back up `~/.pixeltable/pgdata` and `~/.pixeltable/media`.

| Setup | Backup | Restore |
| - | - | - |
| No HTTP | If you exported with `export_sql`, keep that SQL copy and `app.py` in git | Run `pxt schema update` again, then insert the data again |
| Long-running service | `pg_dump` of `~/.pixeltable/pgdata` plus `~/.pixeltable/media/` (or bucket versioning) | Restore `pgdata` and media, restart |

```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
pg_dump -h ~/.pixeltable/pgdata -U postgres pixeltable > backup.sql
tar -czf media_backup.tar.gz ~/.pixeltable/media/
```

Stop Pixeltable, restore Postgres from the dump, copy `media` back, then start Pixeltable again.

Pixeltable does not manage end-user accounts. Put auth on your HTTP layer. Do not expose PostgreSQL port 5432. Do not put long-lived cloud keys in `config.toml` if the host can use its own IAM role.

```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import os

OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
```

On Cloud, store secrets with `pxt secret set` ([CLI](/platform/cli#pxt-secret)). Table history: [Version control](/platform/version-control).


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