Connecting Customer Service with Business Systems: Data Models, Interfaces, and Context
A user asks "why hasn't my order arrived?" and the bot cannot look up the tracking for that order; the user just filed a refund in the app, yet support sees no record. When the customer service system is disconnected from business systems, even the smartest bot can only be an "apologizing parrot".
This post is part of an experience-sharing series on "AI customer service product and engineering practice", drawn from hands-on practice at a global fast-fashion cross-border e-commerce platform. In this post I want to share how to design the data model, interface invocation, and conversation context management for integrating customer service with order, payment, product, inventory, logistics, and after-sales systems, so the bot gets accurate, timely information and cross-system inconsistency stays controlled. It is the engineering hurdle every AI support system must clear to move from "can chat" to "can get things done".

Four Key Points in System Integration
- Model the data once: unified user, order, and conversation models anchor the support context.
- Design interfaces for failure: API gateways, service orchestration, idempotency, and fault tolerance are the baseline.
- Treat consistency as a design input: know where inconsistency comes from in distributed systems and handle each source explicitly.
- Manage context deliberately: storage, propagation, and expiry of conversation state all need explicit design.
The Overall Design
Integration comes down to three pillars: the data model, the interface mechanism, and context management.
Step 1: Design a unified support data model
- Three core entities: user (globally unique ID plus country/market), order (order number, status, line items, payment info, tracking number), and conversation (conversation ID, user ID, channel, language, intent records, context). Use the global user ID and order number as join keys.
- Key principle: the support side stores only indexes and snapshots; authoritative data stays in the business systems. Customer service never maintains a second full copy of business data, avoiding inherently inconsistent dual writes.
- Build a "data map": document which system each field comes from, its refresh cadence, and its freshness, so every piece of information has a clear authoritative source.
Step 2: Interface invocation mechanism
- Unified tool middleware: build a gateway/middleware layer; the bot never calls business systems directly but goes through standardized tool APIs with unified authentication, rate limiting, and auditing.
- Query interfaces: call in real time with a timeout (say 500ms) and retry policy; on timeout, degrade to "we'll reply shortly" or a user notice rather than hanging the conversation.
- Operation interfaces (cancel order, refund): must be idempotent (dedupe by request ID), with permission checks and state pre-checks before execution and result confirmation after—this eliminates duplicate refunds at the root.
- Event subscription: subscribe to order status changes and refund progress via message queues instead of high-frequency polling.
Step 3: Data consistency guarantees
- Read consistency: prefer real-time queries to authoritative systems; use short-TTL caches for latency-sensitive cases and force a refresh at critical moments (for example, right before the user confirms an operation).
- Cross-system conflicts: if the order shows shipped but tracking returns nothing, the bot should recognize the conflict, honestly tell the user "data is syncing", and escalate to a human—never fabricate an answer.
- Reconciliation and monitoring: reconcile core fields periodically and alert on mismatches; log every interface call for traceability.
Step 4: Conversation context management
- Conversation-level context: current order, confirmed intent, collected entities (order number, return reason), stored in a state service with a TTL.
- Cross-conversation context: historical consultations and ticket status, handed over completely when transferring to a human so agents see everything in one screen and users never repeat themselves.
- Multi-turn updates: refresh intent and entities after every turn, supporting topic switches and returns to a suspended task.
My goal
Ensure that every piece of information the bot uses has a clear authoritative source and freshness guarantee, and that no uncertain data is ever presented to users as fact. Accuracy is enforced by architecture, not by hoping the model is smart.
Practice in Bytedesk
The open-source Bytedesk customer service system (GitHub, website https://www.weiyuai.cn ) offers a concrete reference: AI Agents integrate external systems through tool calling with centrally registered interfaces; the conversation module maintains thread-level context and carries full message history on human transfer; the ticket system handles business workflows that span systems; and message and operation logs support interface call auditing.
Key Takeaways
- The support side stores indexes and snapshots only; authority stays with business systems to avoid dual-write inconsistency.
- The bot reaches business systems through standardized tool middleware with unified auth, rate limiting, and auditing.
- Query interfaces need timeout-and-degrade; operation interfaces need idempotency plus state pre-checks to prevent duplicate execution.
- On data conflicts, tell the truth and escalate—better to say nothing than to make things up.
- Conversation context carries a TTL and is handed over completely when transferring, so users never repeat themselves.
