Customers type in bursts. The bot answers once.
A three-stage multi-agent assistant on Zalo OA that quotes real prices from the database, routes VAT and warranty, and steps aside the moment a human joins.
- Zalo webhook
- Dedupe
- Lock + JSONB buffer
- Grace wait
- Merge text
- Classify intent
- Agent A · B · C
- Reply or hand off
- Problem
- Webhooks fire per message. Four short texts meant four parallel runs, four LLM bills, and answers that talked over each other.
- Mechanism
- A PostgreSQL row is the distributed lock. Messages that arrive while it is held go into a JSONB buffer, merge after a quiet period, and reach the model once. Agent A finds the need, B quotes from live DB tools, C closes the order. A
[STAGE:x]marker moves the conversation between them. - Outcome
- About 60% fewer tokens, no overlapping replies, 500+ messages a day. Staff replies are detected and mute the bot instantly.