AI Build & Implementation

Company X AI Agent

A multi-tool agentic AI system built for an independent restaurant delivery platform — shipping customer support, onboarding, menu writing, and personalization in one interface.

Client: Company X Khoda Consulting LLC React · Node.js · Claude API Vercel April 2026
~65%
// support_tickets_automated
6wk
// concept_to_deploy
5
// tools_in_agent
$0
// headcount_added

A platform scaling faster than its operations

Company X was in active pilot stage with a handful of independent restaurants — but had no support, marketing, or onboarding team to serve them.
Restaurant owners lacked the time or skills to write compelling menus, respond to reviews, or navigate their own setup progress.
"Where is my order?" queries were handled manually — consuming 3+ hours per day the lean team couldn't spare.
Scaling to more restaurant partners without solving these bottlenecks would fracture the platform under its own momentum.

Before & after

Before
3h/day
Manual customer support queries handled by the team
After
~12m
Edge cases only — agent handles everything else
Before
3–4 days
To onboard a new restaurant partner to the platform
After
<4h
Self-serve onboarding with AI guidance at every step
Before
0%
Owners writing their own menu descriptions
After
100%
AI-generated copy, approved in under 60 seconds

How the system is built

The agent runs on a 4-layer architecture — from user input through Claude's reasoning engine, down to tool execution and secure infrastructure. Each layer is independently testable and replaceable as Company X scales.


L1 Interface Layer — React + Vite SPA
Chat UI (React) Message history state Tool call visualization Typing indicators Responsive layout
↓ POST /api/chat → { model, messages, tools }
L2 Reasoning Engine — Claude Sonnet + Tool Use API
claude-sonnet-4 Tool use API Multi-turn context Agentic loop System prompt stop_reason: tool_use
↓ tool_use blocks → tool execution
L3 Tool Layer — 5 Serverless Functions
check_order_status() generate_menu_description() draft_review_response() get_onboarding_checklist() get_recommendations()
↓ tool_result → back to L2 context
L4 Infrastructure — Vercel Edge + Secure Proxy
Vercel serverless API key in env vars Zero client exposure GitHub CI/CD HTTPS everywhere

Five tools, one agent

Each tool is defined with a JSON schema that Claude uses to reason about when and how to call it. The agent selects the right tool — or sequences multiple tools — based on the user's request.


01
Order Tracker
check_order_status({ order_id: string })
Returns status, ETA, driver, and items for any order ID. Eliminates the most common support request without human involvement.
Support
02
Menu Writer
generate_menu_description({ dish_name, ingredients, cuisine_type? })
Generates compelling dish copy from minimal input. Removes the copywriting barrier for time-strapped owners — especially non-native English speakers.
Marketing
03
Review Responder
draft_review_response({ review_text, rating: number, restaurant_name })
Classifies review sentiment (positive / neutral / negative) and drafts a tone-matched response. Protects brand reputation without owner effort.
Marketing
04
Onboarding Status
get_onboarding_checklist({ restaurant_name: string })
Returns completion %, completed and pending steps, and the highest-impact next action. Cuts go-live time from days to hours with zero manual check-ins.
Ops
05
Recommender
get_recommendations({ customer_id, time_of_day, preferences? })
Returns personalized picks based on order history, time of day, and neighborhood trends. Drives repeat orders — the core metric in food delivery economics.
Growth

Multi-turn reasoning in action

The agent handles complex multi-step requests in a single thread — calling multiple tools, feeding results back into Claude's context, and synthesizing a single coherent response.


companyx-agent · agentic loop · stop_reason: tool_use
What's the status of order FH-1042?
▸ tool_use — check_order_status
{ "order_id": "FH-1042" }
✓ tool_result
status: "Out for Delivery" · driver: "Miguel R." · eta: "~8 minutes"
Your order from Casa Verde Kitchen is on its way — driver Miguel R. is about 8 minutes out. Your Carne Asada Plate and Horchata are coming right up.
Draft a response to this 2-star review: "Cold food, arrived 45 minutes late."
▸ tool_use — draft_review_response
{ "rating": 2, "restaurant_name": "Casa Verde Kitchen", "review_text": "..." }
✓ tool_result
tone: "negative" · draft_response: "We're truly sorry..."
"We're truly sorry to hear about your experience at Casa Verde Kitchen. This is not the standard we hold ourselves to — please reach out to support@companyx.com so we can personally make this right."

How the loop works

1
User sends a natural language request
POST /api/chat → { messages, tools, system }
No forms or menus. The agent understands intent from plain language and begins reasoning about which tool — or sequence of tools — is required.
2
Claude selects and calls a tool
stop_reason: "tool_use" → content[].type === "tool_use"
When Claude decides to use a tool, the API returns with stop_reason "tool_use". The frontend reads the tool name and input parameters from the response content blocks.
3
Tool executes server-side
executeTool(name, input) → structured JSON result
The tool function runs — querying data, generating content, or executing logic — and returns a structured JSON result that gets appended to the message history.
4
Result feeds back to Claude
{ role: "user", content: [{ type: "tool_result", ... }] }
The tool result is added to the conversation as a tool_result content block. Claude receives the full context and continues reasoning — calling more tools if needed.
5
Claude synthesizes a final response
stop_reason: "end_turn" → content[].type === "text"
When Claude has all the information it needs, it returns stop_reason "end_turn" with a natural language text response that synthesizes everything from the tool calls.

Technology used

Frontend
React + Vite
AI Model
Claude Sonnet
API Layer
Tool Use API
Backend
Node.js + Python
Data
PostgreSQL + ETL
Hosting
Vercel Edge
Security
Env Var Proxy
CI/CD
GitHub Actions

What this delivered

~65% support automation. The most common customer queries are handled autonomously — freeing the Company X team for growth, not inbox management.
Onboarding from days to hours. New restaurant partners self-serve their entire setup with AI guidance — no manual check-ins required.
Enterprise-grade tools for indie owners. Independent restaurants now have AI-powered menu copy and review management on par with large chains.
Production-ready from day one. Deployed on Vercel with a secure API proxy, polished UI, and zero exposed credentials. CI/CD on every push to main.
Architected to extend. New tools can be added by defining a JSON schema and a serverless function — no changes to the core agentic loop required.
live & interactive

Try the agent yourself

The full working system is deployed. Ask it to track an order, write a menu, or respond to a review.

Launch demo

Want something built like this?

Khoda Consulting designs and ships AI agents, data pipelines, analytics tools, and ML solutions for growing businesses.

Start a conversation →