PROJECT STUDY
AI Customer Service
From a grounded answer to a human handoff.
A marketplace and food-delivery support platform connecting cited AI answers, policy-checked tools, human handoff, an agent CRM and a versioned knowledge CMS.
Explore the build
At a glance
- Industry
- Retail and food delivery
- Capabilities
- 6
- Technologies
- 12
- Year
- 2026
The challenge
A support assistant needs more than fluent replies.
It needs the current policy, the relevant order facts, permission to use a tool, and a clear path to a person when judgment or approval is required.
AI Customer Service brings that workflow together for a marketplace and food-delivery business. The customer conversation, the human agent workspace and the knowledge behind every answer live in one system, in Indonesian and English.
What we built
One React app serves the customer super-app and three staff consoles (CRM, knowledge CMS and Ops) over a single FastAPI backend.
Customer super-app
Shopping and food-delivery storefronts with orders, delivery status and complaints give every help conversation a real order record to work from, seeded with synthetic catalogs and customers
Grounded AI answers
The assistant answers from retrieved, approved knowledge and structured order facts with citations, and deterministic templates answer whenever the AI provider is unavailable
Policy-checked actions
A backend executor checks ownership, policy, risk, limits, confirmations and idempotency before it records a refund, cancellation or other action, so the model never changes the database directly
Human handoff and CRM
Staff work a queue, take over a conversation, reply, review suggested answers and route actions that need supervisor approval
Versioned knowledge CMS
Documents move through upload, extraction, chunking, review, approval and publishing, and retrieval uses only the versions in effect for the reader
Operations view
Metrics and audit views show conversation, tool and retrieval activity across the system
Customer super-app
Shopping and food-delivery storefronts with orders, delivery status and complaints give every help conversation a real order record to work from, seeded with synthetic catalogs and customers
Grounded AI answers
The assistant answers from retrieved, approved knowledge and structured order facts with citations, and deterministic templates answer whenever the AI provider is unavailable
Policy-checked actions
A backend executor checks ownership, policy, risk, limits, confirmations and idempotency before it records a refund, cancellation or other action, so the model never changes the database directly
Human handoff and CRM
Staff work a queue, take over a conversation, reply, review suggested answers and route actions that need supervisor approval
Versioned knowledge CMS
Documents move through upload, extraction, chunking, review, approval and publishing, and retrieval uses only the versions in effect for the reader
Operations view
Metrics and audit views show conversation, tool and retrieval activity across the system
How it works
React apps, FastAPI core
React and TypeScript serve the customer and staff interfaces over REST and two WebSocket gateways. A Python FastAPI backend owns the records, permissions, domain rules and the action executor, with SQLAlchemy over SQLite holding the data.
A guarded conversation turn
Each customer turn runs deterministic pre-guards, Gemini structured understanding with a keyword fallback, an explicit workflow per intent over the tools, hybrid retrieval and the policy and risk engines. The reply streams back through a post-guard, and deterministic templates answer whenever Gemini is unavailable.
Knowledge from upload to answer
Uploads are validated by extension and magic bytes, extracted (scanned pages go to Gemini or Tesseract OCR when configured), chunked by structure and embedded with FastEmbed. Retrieval merges a NumPy vector index with in-process BM25, both rebuilt for each knowledge revision.
Realtime handoff to people
WebSocket events keep the customer chat and the staff workspace in step as a conversation moves between the assistant and a human agent. A screen that reconnects replays what it missed from the database.
Engineering insights
The model proposes; deterministic code decides what happens and what the customer is told.
Stack by layer
- Frontend
- React
- TypeScript
- Vite
- React Router
- TanStack Query
- react-markdown
- CSS Modules
- Backend
- Python
- FastAPI
- Uvicorn
- Pydantic
- WebSockets
- PyJWT
- bcrypt
- Data
- SQLAlchemy
- SQLite
- aiosqlite
- NumPy
- pypdfium2
- python-docx
- AI
- Google Gemini
- Google Gen AI SDK
- FastEmbed
- multilingual-e5-base
- BM25
- Infrastructure
- uv
- pnpm
- Prometheus client
- pytest
- Vitest
- Playwright
- axe-core
- Ruff
- ESLint
The model requests, the executor decides
Gemini can only ask for a declared tool by name; the executor checks the actor's permission, validates arguments against the schema, replays an earlier success with the same idempotency key, runs the handler in a database savepoint and audits every write or denial. The refund tool re-runs the policy and risk engines itself and routes anything above the AI limit to a person, returning only a neutral review status to the model
A post-guard can veto the reply
A reply that claims an unconfirmed success, uses internal risk wording or leaks the prompt is discarded, anything already streamed is retracted and a deterministic template answers instead. Citation markers that match no retrieved chunk are stripped, and customer text is PII-masked before it reaches the model
One worker per conversation
A conditional update on the conversation row acts as a lease, so one worker processes a conversation at a time and rapid messages are batched into one ordered turn. A sweeper picks up messages stranded by a crash, and a turn finishes even if the customer disconnects
Gap-free replay after reconnect
Realtime events queued in a transaction are published only after it commits, and every conversation event gets a per-conversation sequence number. A reconnecting client sends its last sequence and the server replays from the database, while the browser deduplicates and orders what arrives
Retrieval sees only effective knowledge
The index loads only published, fully processed versions, and every query is filtered by effective date and audience, so internal documents never reach customers. Vector and BM25 rankings merge through reciprocal rank fusion, and policy, terms and SOP versions need approval from someone other than the uploader
Design system
Warm green and amber tokens: consumer-app warmth for customers that stays efficient and scannable for staff who work a queue all day. One token file styles the customer super-app and the staff consoles in light and dark themes.
Colour palette
- Brand green
#1f5c45Primary actions, active navigation, links and the customer's chat bubble - Amber accent
#e3a23bAttention only: SLA at risk, waiting customers and pending approvals - Warm off-white
#fbf8f2Page background - Ink
#1e2622Body text and text on amber - Muted ink
#5b665fSecondary text, with AA contrast on both surfaces - Brick red
#b3412eDanger and error states, always paired with a text label
Colour
Deep green carries actions, navigation, links and the customer's chat bubble; amber is reserved for what needs a person's attention, such as an SLA at risk or a pending approval; warm off-white surfaces stay calm, and brick red marks errors with a text label
Typography
IBM Plex Sans, self-hosted through Fontsource, sets all interface text, and IBM Plex Mono with tabular numerals is kept for identifiers people copy or compare, such as order IDs, case references and amounts in tables
Components
In-house primitives (Button, Dialog, Drawer, Sheet, Menu, Tabs, DataTable, Toaster, Tooltip and more) styled with CSS Modules over CSS custom properties, with a hand-made inline SVG icon set on a 24 px grid and no third-party component library
Accessibility
Every status has a text label, every text and background token pair is checked for WCAG AA in light and dark, motion is functional only and honours prefers-reduced-motion, and Playwright runs axe checks on desktop and mobile layouts
Where this fits
Support becomes more useful when answers, records, and human decisions connect. We build AI solutions around your knowledge and workflows, and pair them with business systems and web applications that help your team act. Explore retail solutions or discuss your support workflow with Weaveward.
KEEP EXPLORING
Another problem. A different approach.

Logistics Intelligent
A dispatch and supply-planning system for delivery routes, fleet disruptions and retail replenishment across multiple warehouses.

Venue & Decor Visualizer
Bilingual event-design software that connects privacy-aware venue capture, labelled AI previews, client review and proposals priced in code.
Let’s connect the dots
Let's put these ideas to work.
Share a process, product, or problem you want to improve. We will work through the possibilities together.