AI Features Overview
PMFriend uses Anthropic's Claude Haiku via direct JDK HttpClient
(no SDK). Eleven surfaces are AI-augmented today. Every integration has a
deterministic heuristic fallback so the product never hard-fails on an
LLM outage.
What Claude touches
| # | Feature | Endpoint | Prompt version | Fallback |
|---|---|---|---|---|
| 1 | Triage classifier | POST /maintenance-requests/{id}/suggest-triage | prompt-v2 | Keyword rules |
| 2 | Work-order scope drafter | POST /work-orders/draft-scope | prompt-v1 | Raw tenant text |
| 3 | Duplicate detector | POST /maintenance-requests/{id}/detect-duplicate | prompt-v1 | Jaccard overlap |
| 4 | Property suggestions | GET /properties/{id}/ai-suggestions | prompt-v1 | Rule cascade |
| 5 | Owner digest drafter | POST /owners/{id}/digests/draft | prompt-v1 | Static template |
| 6 | Contractor matching (roadmap) | GET /work-orders/{id}/suggested-contractors | — (rules today) | Rules only |
| 7 | One-click action chain | POST /properties/{id}/ai-actions/create-work-order | Composite | Uses #1–#3 |
| 8 | Arrears-notice drafter | POST /notices/draft-arrears | prompt-v1 | State-specific templates |
| 9 | Entry-notice drafter | POST /notices/draft-entry-notice | prompt-v1 | State-specific templates + reason → notice-period lookup |
| 10 | Tribunal/VCAT case pack assembler | POST /case-packs/draft | prompt-v1 | Chronological recital + per-case-type relief template |
| 11 | Inspection report writer | POST /inspections/draft | prompt-v1 | Per-room recital + safety-keyword extraction |
Prompt versioning
Every Claude response includes a modelVersion field like
claude-haiku-4-5@prompt-v2. The version tag is stored on the resulting
record (triage_suggestions, digest_drafts, etc.) so we can:
- Evaluate prompt changes against stored outputs.
- A/B test prompt revisions without breaking older data.
- Audit-log "this request was triaged by prompt-v1, before we fixed the gas-heater false-positive".
Bumping a prompt = new version number + deploy. We never silently mutate an in-use prompt.
Circuit breaker
Each Claude integration has an independent circuit breaker:
- 3 consecutive failures → circuit opens
- All subsequent calls fall back to heuristic for 5 minutes
- First call after the cooldown probes Claude; success closes the breaker
This stops a transient Anthropic outage from cascading into user-visible errors, while also capping cost (a broken deploy that keeps retrying Claude can't exceed 3 reqs / 5 min / surface).
Privacy at a glance
| Sent to Claude | Not sent to Claude |
|---|---|
| Tenant report text (triage, duplicate) | Tenant name, email, mobile |
| Aggregated WO metadata for digest | Owner email, financial figures beyond WO cost |
| Property address (for scope drafts only) | Full property database IDs |
| Compliance rule friendly names | Internal UUIDs |
Full detail: AI Fallbacks & Privacy.
Cost control
Claude Haiku pricing as of 2026-04: ~$0.80 / million input tokens, ~$4 / million output. A typical triage call is ~800 input + 200 output tokens = under $0.001 per request. An agency running 300 maintenance requests / month pays well under $1 / month in LLM cost.
Over-budget guardrails live in AnthropicClient:
- Max tokens per request: 600 (output)
- Timeout: 8 seconds
- Circuit breaker as above