A small, recruiter-ready customer-support demo built with Laravel 13 and Vue 3. A guest can ask about a sample order, get store hours, or open a support ticket. The assistant can call three explicitly defined tools, and the interface exposes every tool call and result in a live trace panel.
The demo uses sample order data only. It has no customer login, payment flow, carrier integration, or real customer information.
The model does not query the database directly. SupportAgent gives an LlmClient the conversation and strict JSON schemas for the allowed tools. It validates and executes each requested tool through SupportToolRegistry, stores the tool result as a chat message, and asks the model to formulate a final response. Tool errors are returned as structured results, and each request is limited to three tool rounds.
flowchart LR
User[Guest user] --> UI[Vue chat UI]
UI -->|message| Agent[SupportAgent]
Agent -->|conversation + JSON tool schemas| LLM[LlmClient]
LLM -->|tool request or final reply| Agent
Agent -->|validated call| Tools[SupportToolRegistry]
Tools --> Orders[(Sample orders)]
Tools --> Tickets[(Support tickets)]
Tools --> Hours[Store hours]
Tools -->|result| Agent
Agent -->|assistant reply + persisted tool trace| DB[(SQLite / configured database)]
DB --> UI
LLM -. no API key .-> Fake[Deterministic FakeLlmClient]
LLM -. GEMINI_API_KEY set .-> Gemini[Gemini API, 12s timeout]
The tool schemas are defined in app/Services/Support/SupportToolRegistry.php. All tools reject arguments outside their documented schema and return JSON-compatible results.
| Tool | Strict JSON arguments | Result |
|---|---|---|
lookup_order |
{"order_ref":"ORD-1001"} |
Order reference, status, estimated delivery date, and item summary. Unknown references return order_not_found instead of throwing. |
create_ticket |
{"subject":"Damaged item","body":"The lamp arrived broken.","order_ref":"ORD-1005"} (order_ref optional) |
Persists an open support ticket and returns its id and status. |
store_hours |
{} |
Monday–Saturday, 08:00–18:00; closed Sunday. |
App\Services\Llm\LlmClient is the provider boundary. GeminiLlmClient uses Gemini function calling when GEMINI_API_KEY is configured. The HTTP request has a 12-second timeout. Without a key, FakeLlmClient provides a deterministic no-network demo for the supported phrases below; if the provider throws or returns an invalid response, the agent gives the guest a friendly fallback rather than an unhandled 500.
Requirements: PHP 8.3+, Composer, Node.js, and npm.
composer install
cp .env.example .env
php artisan key:generate
php -r "file_exists('database/database.sqlite') || touch('database/database.sqlite');"
php artisan migrate --seed
npm install
npm run build
php artisan serveOn Windows PowerShell, replace cp .env.example .env with Copy-Item .env.example .env. Open http://127.0.0.1:8000. The default .env.example uses SQLite, local sessions, and the deterministic fake assistant, so no Gemini account or background service is needed.
For frontend hot reload, run npm run dev in another terminal instead of building assets first. To use Gemini, set GEMINI_API_KEY in .env (optionally set GEMINI_MODEL, which defaults to gemini-2.5-flash) and restart the Laravel server. The key is read server-side and is never sent to the browser.
The database seeder adds six fictional orders, including:
ORD-1001— shipped, estimated delivery October 29, 2026.ORD-1002— delayed, estimated delivery November 2, 2026.
Try these phrases in the guest chat:
- “Where is order ORD-1001?” — calls
lookup_order. - “Hours?” or “What are your store hours?” — calls
store_hours. - “This is broken” — calls
create_ticketand saves an open ticket. - “Where is order ORD-9999?” — demonstrates a graceful unknown-order tool result.
No account or demo credentials are required. Chat history is scoped to the visitor's browser session.
Run php artisan test. The feature suite explicitly binds FakeLlmClient, so tests never depend on network access or API credentials. It verifies that:
lookup_orderreturns seeded-format order details.create_ticketpersists an open ticket.- A guest can send a message and the response includes the tool name and structured result for the UI trace.
- An unknown order is exposed as a handled tool error and still returns HTTP 200.
- The assistant can complete a ticket request through the full agent loop.
composer test also runs Pint and Larastan checks before the test suite.
- Laravel 13, PHP 8.3+
- Vue 3, TypeScript, Inertia, Tailwind CSS
- SQLite by default (other Laravel-supported database connections can be configured)
- Pest/PHPUnit-compatible Laravel tests