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.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page