# Load and deploy Particles

Load a Particle module at startup or deploy it durably, and verify its lifecycle before relying on it in application queries.

Source: https://particledb.ai/particles/loading/

Both methods need Python 3.11 or newer with the [`particledb`](https://pypi.org/project/particledb/) package, as `python3` on the `PATH` or named by `PDB_PARTICLES_PYTHON`. See [requirements](/particles/overview/#availability-and-requirements).

## Load at startup

Add `--python-functions` to the start command. It accepts a module file, a package directory or a dotted module name, and can be repeated:

```bash
particledb start --data-dir ./pdb-particles --python-functions ./tools.py
```

Use `tools.py` from [your first Particle](/particles/overview/), and bind the listeners as in the [quickstart](/getting-started/quickstart/). Startup loading registers the functions for that server process only: start the server with the same flags every time. A restart without `--python-functions` does not have the functions.

## Check registration

```sql
SELECT priority(0.9, 0.8) AS score;
```

If the server did not start, read its startup error: a missing interpreter, a missing `particledb` package, a failed import in the module and a [name collision](/particles/collisions/) are each reported with the module path.

## Verify a module

Check a module without a server. This prints each function's SQL signature:

```bash
particledb particles verify ./tools.py
```

## Deploy durably

`particledb particles deploy` registers the functions on a running server through its SQL client address. A deployed function survives a restart without `--python-functions`:

```bash
particledb particles deploy ./tools.py --target 127.0.0.1:5432 --yes
```

Run `particledb particles deploy --help` for the other options.

## Update a function

Test a change on a disposable server first. Validate its inputs, outputs, dependencies and any stored results that depend on its old behavior. Keep a previous version of the module available for rollback.

## Persistence

Restart a test server with your production start command and call the function again before depending on it in application queries.

## Related

[Documentation home](/docs/) · [Troubleshooting](/guides/troubleshooting/)
