LINE AI Customer
Service Platform

AI answers from the data first, and hands off to a human when it cannot

Multi-tenant SaaS

LINE AI customer service platform illustrative screen
Scroll
Project TypeMulti-tenant SaaS
AudienceBusinesses running a LINE Official Account
Core TechnologiesLaravel, Astro, OpenAI
StatusLive in production

Overview

Many businesses spend their LINE Official Account answering the same questions every day: opening hours, prices, how to book. This platform lets a business connect its own LINE Official Account and fill in prices, rules and FAQs as a knowledge base. When customers ask on LINE, AI answers from that data — and when it cannot, it hands off to a human, who picks up the conversation in the dashboard inbox.

It is a multi-tenant SaaS: many businesses share one platform, while each one's knowledge, conversations and customer data stay isolated. Beyond AI customer service, the platform offers tickets, customer tags and segments, rich menus and broadcast messages, plus a points wallet and ECPay payments.

The backend is Laravel serving a GraphQL API, the business dashboard is built with Astro + Vue 3, and the platform-wide admin uses Filament. The AI layer calls OpenAI's REST API directly. The platform is live in production.

5closest knowledge chunks retrieved per question
6messages of history max, 500 characters each
0extra vector databases (vectors live in MySQL)

How one message is handled

A customer sends a line on LINE. The system first verifies where it came from and filters out messages not worth paying to process, then looks for an answer in that business's own knowledge base. If nothing matches, or the reply contains figures the data does not have, a human takes over and the question goes onto the unanswered list.

CustomerChecks & guardsAI processingBusiness & staffDashed = handoff / filling answers
CUSTOMERRECEIVEFILTER FIRSTFIND ANSWERGENERATECHECK BEFORE SENDCustomerAsks on LINEReceiveVerify signatureSave, then queuePre-checksHuman takeover · floodingNon-text · handoff wordsGreeting · daily capPoint balanceRetrievalEmbed the questionMatch own knowledgeKeep top 5Call modelBuild the promptAnswer from data onlyReply GuardAmounts · dates · IDsmust exist in dataDashboard · Knowledge basePrices · rules · FAQsFilled answers become knowledgeHuman handoff · Unanswered listStaff take over in the inboxDeduplicated, ask count trackedSend replyAuto-reply, or draft for reviewLog usage · deduct pointsBelow similarity thresholdFigures not in the dataMatch this business's data

Core Features

01

LINE setup wizard

Businesses enter their LINE Official Account details step by step; the system configures the webhook automatically and verifies the connection, so nobody has to dig through LINE's console

02

Knowledge base and AI-assisted import

Businesses fill in prices, rules and FAQs, or import web pages, PDFs, photos or pasted text. AI splits them into knowledge entries, and nothing is saved until the business ticks each one to confirm

03

Auto-reply or draft mode

AI can reply to customers directly, or only draft a reply for staff to review before sending — each business chooses the level it is comfortable with

04

Human handoff and shared inbox

When AI cannot answer, or the customer asks for a person, the conversation moves to the dashboard inbox for staff to take over. Handoff between AI and humans runs on a state machine, so AI stays quiet while a human is handling the chat

05

Unanswered questions list

Questions handed off for lack of data are logged automatically, deduplicated, with a running count of how often each is asked — so the business knows which answer to add first

06

Operations tools and point billing

Tickets, customer tags and segments, rich menus and broadcast messages live in the same dashboard. AI usage is billed in points, with a points wallet connected to ECPay payments and e-invoices

Technical Highlights

Multi-tenant data isolation

Many businesses share one platform, with data isolated per tenant. Retrieval results are cached to speed up replies, but even on a cache hit the account ownership is verified again, so one business's knowledge is never used to answer another business's customers.

Filter before paying: the gates between webhook and AI

Incoming LINE webhooks are signature-verified first; the message is stored and pushed onto a queue (Laravel Queue) for asynchronous processing. It then passes a series of checks: is a human already handling the chat, is it flooding, is it non-text, does it contain a handoff keyword, is it just a greeting, has the organisation hit its daily usage cap, are there enough points. Only then is the paid AI API called.

Single-pass RAG, no separate vector database

The customer's question is turned into a vector with OpenAI's text-embedding model and compared against that account's knowledge chunks; the 5 closest are put into the prompt and the chat model is called once to produce the reply. It is single-pass retrieval-augmented generation (RAG), not an agent loop that calls tools repeatedly. Vectors are stored in MySQL and cosine similarity is computed in code, with no separate vector database. If similarity falls below the threshold, AI does not guess — it hands off to a human.

Keeping AI honest: prompt rules + Reply Guard

The prompt only allows answers based on the data, asks a staff member to help when unsure, never mentions internal terms like "knowledge base" to customers, and ranks answers written by the business itself first. Before sending, a Reply Guard checks the reply: if it contains an amount, date or reference number that is not in the knowledge base, it is not sent and the chat goes to a human.

Cost control

Each organisation has a daily token cap, enforced before any paid API call. Flooding is detected and greetings never reach the AI. Conversation history is limited to 6 messages of up to 500 characters each. Each call's cost is estimated from the model's unit price and billed in points.

AI organises knowledge, humans confirm it

Web pages, PDFs, photos or text imported by the business are split by AI into knowledge entries output as structured JSON, and only saved after the business ticks each one. Web fetching is protected against SSRF so the feature cannot be abused to reach internal networks.

Testing and deployment

Automated tests with PHPUnit, Vitest and Playwright E2E; CI deploys automatically and rolls back automatically if a deployment fails, so a broken release never stays live.

Tech Stack

Backend

  • Laravel 11 / PHP 8.3
  • GraphQL API
  • JWT + Google sign-in
  • Laravel Queue
  • Redis (throttling, cache, locks)

Frontend

  • Astro 5 SSR business dashboard
  • Vue 3
  • Tailwind CSS 4
  • Filament 4 platform admin

AI

  • OpenAI chat model
  • text-embedding model
  • Vectors stored in MySQL
  • Cosine similarity retrieval

Integrations & Quality

  • LINE Messaging API
  • ECPay payments & e-invoices
  • PHPUnit / Vitest / Playwright E2E
  • CI auto-deploy with auto-rollback

FAQ

Will the AI make up answers or quote wrong prices?

Three layers reduce that risk. First, if retrieval similarity is below the threshold, AI does not answer and hands off to a human. Second, the prompt only allows answers based on the business's own data and asks a staff member to help when unsure. Third, Reply Guard checks every reply before sending and blocks any amount, date or reference number not found in the knowledge base. Businesses that want more control can switch to draft mode and have staff review replies first.

Many businesses share the platform — can data get mixed up?

No. The platform is multi-tenant, and knowledge, conversations and customer data are isolated per tenant. Even when a retrieval result comes from the cache, the system verifies again which LINE account it belongs to before using it in a reply.

Can AI usage costs get out of hand?

Each organisation has a daily token cap, enforced before any paid API call. Flooding messages and greetings never reach the AI, and conversation history is limited to the last 6 messages of up to 500 characters each. Costs are estimated from each model's unit price and billed in points, so businesses can see exactly what they use.

Why not use a dedicated vector database?

Each retrieval only compares against that account's own knowledge chunks, so the search space is already narrowed per tenant. Storing vectors in MySQL and computing cosine similarity in code handles it, with one less service to run and pay for.

CONTACT US

Have a similar project? Let's talk

Whether it's LINE Official Account integration, AI customer service, or a multi-tenant SaaS platform, we can tailor a solution for you.

Related services: AI integration & automation, SaaS platform development

Contact Us