Choose the labels your project uses
Our example repository is a note-taking application. Its maintainers have two component labels, editor and export. They automatically route a bug report or feature request when the issue describes a specific problem in either component. A generalist reads questions, missing details, and issues about other parts of the app.
The router proposes labels and a follow-up question. You can run it on a local string without a GitHub account or permission to modify an issue.
Compile three specialists
Download the Python example. It defines a separate natural-language specification for each decision:
- Kind. Is the writer reporting a bug, requesting a feature, or asking a question?
- Component. Does this issue concern editing notes, exporting notes, or something else?
- Detail. Has the writer given a specific symptom, a concrete request, or a clear question?
Install the SDK in a Python environment, sign in to PAW, and compile. The script stores the three private program IDs beside the download.
python -m pip install "programasweights>=0.4.14" --extra-index-url https://pypi.programasweights.com/simple/
paw login
python triage.py --compile
The Standard compiler generates an adapter for each specification. You can use the saved programs for subsequent issues. If your repository uses different component names, edit the component specification and the accepted labels in route(), then compile the new definitions.
Run a report through the router
python triage.py 'Pressing Export PDF saves an empty file.'
All three specialists read the same issue using hosted inference. Python checks the resulting labels against the repository's rules. For this report the actual results were bug, export, and clear. The router returned ["bug", "export"].
Changing the issue to Please add Markdown export alongside PDF.
changes the first result to feature. The other specialists still return export and clear. The router proposes ["feature", "export"].
if kind in {"bug", "feature"} and area in {"editor", "export"} and detail == "clear":
return {"action": "label", "labels": [kind, area], "outputs": outputs}
Hand an incomplete report to a generalist
python triage.py 'It stopped working.'
The three specialists returned bug, other, and unclear for this report. There is no component to assign. The script passes the original issue to the general-purpose Qwen3-0.6B model and asks for a follow-up question. The SDK downloads the base model on first use and runs it locally. You can replace this one call with your team's generalist.
The local generalist returned What specific issue was encountered when the app stopped working?
Replace the sample report with How do I change my account password?
. The specialists returned question, other, and clear. A detailed question still needs the generalist because this repository's automatic rule covers bugs and feature requests in the editor or exporter.
How generated specialists fit inside an AI agent · Local inference with the PAW SDK