- Frontend work in `frontend/` must target desktop Web first.
- Do not proactively add mobile-specific adaptations, responsive reflow for small screens, or mobile-first layout compromises unless the user explicitly asks for them.
- When desktop and mobile requirements conflict, preserve the desktop Web layout and interaction model by default.
- Prefer the repo scripts over ad hoc startup commands: `./dev.sh ...` on Unix, `dev.bat ...` on Windows.
- First-time local setup: `./dev.sh setup` or `dev.bat setup`.
- Backend foreground dev server: `./dev.sh start api --foreground` or `dev.bat start api --foreground`.
- Equivalent direct backend run from repo root: `PYTHONPATH=backend uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload`.
- Python tooling must use the repo-root `.venv` environment; do not use the global `python`.
- Prefer `uv`-managed execution from the repo root, for example `uv run --python .venv\\Scripts\\python.exe python ...` or other `uv run ...` forms that resolve within the project environment.
- Frontend dev: `npm --prefix frontend run dev`.
- Frontend verification: `npm --prefix frontend run lint` and `npm --prefix frontend run build`.
- Use `npm`, not `pnpm`; the checked-in scripts run `npm install` even though `frontend/pnpm-lock.yaml` also exists.
- Backend settings must resolve env files from the repo root only. The supported files are root `.env` and optional root `.env.development`; files under `backend/` must not be treated as authoritative env sources.
- The dev scripts read `API_HOST`, `API_PORT`, `FRONTEND_PORT`, and `FRONTEND_MODE` from root `.env` first, then root `.env.development` as an override; all other backend config comes from the repo-root env files via Pydantic settings.
- Docker infra is `docker/docker-compose.yml`; it brings up `milvus`, `minio`, `redis`, and `postgres`.
- All comments and docstrings in `backend/**/*.py` must be written in English.
- Every Python file under `backend` must include a module-level explanation and at least one meaningful `#` code comment.
- Every function and method must include a docstring.
- Files without functions, including `__init__.py`, schemas, enums, dataclasses, and export-only modules, must still include a module docstring, class docstrings when applicable, and at least one meaningful `#` code comment.
- Comments must explain intent, assumptions, invariants, or non-obvious logic; do not add empty, placeholder, or restatement-only comments.