The problem
Most LINE OA chats ask the same five things: price, stock, shipping time, where my order is, and how to pay. Admins answer them one by one until late evening, and the one message that really needs a person, a complaint or a refund, waits in the same queue.
Architecture
- Channel
- LINE OA chat
- Order number from customer
- Agent
- Webhook with signature check
- Claude answers from the KB
- Tools
- Shop knowledge base
- Order status lookup
- Slack staff channel
- Human
- Staff take over the chat
- Weekly knowledge base review
Where the data stays: Chats stay in LINE; you keep only order number, question and outcome, for a set retention period.
Design flow
- Customer message reaches the webhook
- Answer from the shop's knowledge base
- Order number given: status fetched and repliedOnly sometimes
- Not in the KB or upset: staff take over via SlackHuman checkpoint
- Weekly: unanswered questions added to the KB
Setup
Total time: 5 h 5 min our estimate
- 20 min
Done when: You have the channel access token and channel secret, and the webhook URL is set.
- 1 h 30 min
Done when: One document answers the ten questions admins get most: products, prices, stock, shipping time and how to pay.
- 1 h
LINE's Messaging API SDK handles the webhook, signature check and reply. LangBot is a ready made route that connects a LINE OA to a model with a built in knowledge base.
Done when: A test question passes the LINE signature check and gets an answer from the knowledge base through the reply token.
- 1 h
Done when: A real order number in a test chat returns that order's current status, and an unknown number gets a polite ask to check it.
- 45 min
Done when: A question not in the knowledge base, an upset message or a request for a person gets a short acknowledgement, the agent stops replying in that chat, and the conversation appears in the staff channel.
- 30 min
Done when: A staff answer reaches the customer as a push message, and the questions the agent could not answer this week are in the knowledge base by next week.
Ticks are saved on this browser.
Risks and data
Data
Chat text and LINE user IDs are personal data. Store only the order number, question and outcome, set a retention period for chat logs, and say in the OA greeting that an AI assistant answers first. LINE's MCP server can also broadcast to every follower, so do not give this agent the broadcast tools.
How it goes wrong
A confident wrong answer on price, stock or delivery, or a handoff nobody picks up. The agent answers only from the knowledge base and hands off when the answer is not there, staff watch the Slack channel in opening hours, and the weekly review of unanswered questions shows the gaps. LINE's MCP server is marked a preview, so test it before you rely on it.
How the agent works
It starts
Every message to the LINE Official Account arrives at a webhook that checks the LINE signature and reads the text.
The agent works
The agent first looks the question up in a knowledge base the shop maintains (products, prices, shipping and payment rules); if the customer gives an order number it fetches the status from the shop's order system and answers with the LINE reply token. If the answer is not in the knowledge base, or the customer is upset or asks for a person, the agent sends a short acknowledgement, stops replying in that chat and posts the conversation to a staff channel so a human takes over. Staff answers go back to the customer as a Messaging API push message.
The result
Once a week the team reviews the questions the agent could not answer and adds them to the knowledge base.
Worked example
The open source building blocks are already published: LINE's own Messaging API SDK handles the webhook, signature check and reply; LINE's official MCP server exposes push messages, user profiles and rich menus to an AI agent (the README marks it a preview); and LangBot connects a LINE Official Account to Claude with a built in knowledge base. None of these pages reports customer results, so measure your own first response time before and after.
LangBot and the LINE SDK work with other models too, so OpenAI or Gemini can answer from the same knowledge base.
Join the Agent OS Club
Get hours back with a team of AI agents for every department, set up step by step for the tools you use, with a person answering your questions. Founding member price: USD 14.95 a month or USD 150 a year, locked for as long as you stay. Cancel any time.
Founding offer, ends 31 December 2026 or at member 100
Join the Agent OS ClubBuilding this for an organization? Learn more at theagentiv.com
Sources
- https://github.com/line/line-bot-sdk-python
- https://github.com/line/line-bot-mcp-server
- https://github.com/langbot-app/LangBot
- https://github.com/uezo/linedify
Published: 2026-10-16