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

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.
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.
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
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
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
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
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
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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