A first draft, never the final word
Two drafting endpoints: a letter body in Markdown that uses the template merge fields instead of typed facts, and a three-to-four sentence resume summary built only from the consultant profile. Both are reviewed by a person before anything is sent, and both say so plainly when no model is available.
Instructions in, Markdown with merge fields out
POST /api/ai/draft-letter takes a letter kind, a country or a person, and instructions in plain words. The model is told to write the body of the letter in Markdown, to use merge fields such as {{person.full_name}}, {{person.start_date}} and {{entity.legal_name}} where the facts belong, and never to invent salary, dates, legal terms or policies that are not in the instructions: anything missing becomes a [placeholder].
The result is a title and a body. Create a template from it (POST /api/templates), review it in the template editor, have counsel approve it, and then use it like any other.
curl -X POST https://peoplehq.example.com/api/ai/draft-letter \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"kind": "other", "country": "CA",
"instructions": "A letter confirming a move from part-time to full-time from a given date, same manager, salary to be filled in"}'
Only what the profile says
POST /api/ai/resume-summary/{person} writes a short professional summary from the consultant profile, using only the facts in it: no superlatives and no invented numbers. You save it to the profile if you want it.

Off means off
Drafting uses the Insight platform’s model connection: Claude on Amazon Bedrock by default, or another provider you configure. With PEOPLEHQ_AI=false, no model configured, or a model that cannot be reached, the endpoints answer with a clear “No model is available” message instead of guessing. A model that fails is remembered for five minutes, so a misconfigured server does not wait on every request.
GET /api/ai/status says whether drafting is on, and which provider and model are in use.
| Setting | Effect |
|---|---|
| PEOPLEHQ_AI=true (default) | Drafting on when a model is reachable |
| PEOPLEHQ_AI=false | Drafting off; endpoints say so |
| INSIGHT_LLM_PROVIDER | bedrock, azure_openai, vertex, oci or openai |
| INSIGHT_CHAT_MODEL | The model id for the provider |
A drafted letter goes through the same review as any template
What you can find out
Each answer is on a screen you can open.
What teams do with it
A new kind of letter starts from a structured draft instead of a blank page.
Merge fields carry the names, dates and pay; the model writes the words around them.
Drafts become templates only after review.