LINE AI Customer-Service Bot
Overview
A customer-service assistant that lives in a LINE Official Account. It combines a large language model (LLM) with a company knowledge base to answer common questions and look up information, and hands off to a human agent when needed.
Key Features
- Answers grounded in the company's own documents (FAQs, product guides, terms), with sources cited
- Rich menus and quick-reply buttons that guide users through common tasks
- Automatic handoff to a human agent, with on-duty staff notified, for unclear or sensitive requests
- Conversation logs and knowledge-base content managed centrally in an admin console
- PII masking: phone numbers, emails, and similar details are de-identified before logging
Architecture
- Channel: LINE Messaging API (webhooks, reply/push messages, rich menus)
- Service layer: Cloudflare Workers (TypeScript) for webhook signature verification and message routing
- AI layer: LLM API + RAG (retrieval-augmented generation): vector search finds relevant passages, then the model drafts a grounded answer
- Data layer: PostgreSQL for conversation history, user state, and knowledge-base metadata
- Protection: Cloudflare WAF and rate limiting; admin access gated by Cloudflare Zero Trust
How It's Built
- Collect common questions and existing documents into a searchable knowledge base
- Set up the LINE Official Account and Messaging API channel; configure the webhook
- Implement message intake, signature verification, and routing on Workers
- Build the RAG pipeline: chunking, embedding, retrieval, and prompt design
- Define human-handoff rules and build the admin console
- Test answer quality and edge cases; keep refining the knowledge base after launch