Who it is forA support lead or backend developer whose help desk needs every ticket sorted without sending customer text to a paid LLM API.
The problemTickets arrive unsorted, and manual triage is slow. Sending customer text to a hosted LLM costs per token and leaves your infrastructure.
The outcomeEach ticket gets a typed department, urgency and churn flag, and low-confidence answers are routed to a person.
What you need first
- PHP 8.4+ and Composer
- A PSR-18 HTTP client such as Guzzle or Symfony HttpClient
- Docker, to run laya-serve from the repo's compose.yaml
- Laravel 13+ for the Laravel steps (service provider, artisan commands, validation rule, cast)
Steps
- Run
composer require marcreichel/laya-phpin your PHP project. - Start the local server from a clone of this repo with
docker compose up -d --wait, then check it withphp artisan laya:healthin a Laravel app. - Write a readonly decision class with enum fields for department and urgency and a bool for churn, then try it with
php artisan laya:try "App\Decisions\Triage" "Hi, we were billed twice for March. Refund it today or we cancel.". - In your queued job, call
$laya->decide($ticket->body, Triage::class)and save the department on the ticket. - Compare
answerConfidencewith a threshold you choose and send low-confidence tickets to a human queue.
Prompt for your agent
Using the marcreichel/laya-php repo, add a readonly decision class for <ticket queue> with department, urgency and churn fields, and call Laya::decide on the ticket body. Report the typed result and its answerConfidence for a sample ticket, and verify that `php artisan laya:try` prints a hydrated value for that class.
Caveat. The SDK targets laya-serve running upstream Laya v0.4.6, and the README says it has not been tested against the hosted Jev API.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for marcreichel/laya-php and "Route support tickets by department, urgency and churn risk"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer