# Postgres init scripts (optional)

Files here are mounted into the Postgres container at `/docker-entrypoint-initdb.d/` and run **only on first startup** (when the data volume is empty), in alphabetical order.

- `01-schema.sql` — creates pgvector extension and RAG tables (stories, documents, chunks).
- To add more users or other setup, add scripts with names like `00-create-user.sql` (they run before `01-schema.sql`).
- To disable init: in `docker-compose.yml`, comment out the postgres volume that mounts this folder, or remove/rename the `.sql` files.

After the first run, these scripts are not executed again. To re-run them, remove the volume: `docker compose down -v` (this deletes DB data), then `docker compose up -d`.
