Playbook: building and shipping a customer-service agent
Six stages — intents, knowledge base, tools, guardrails, evaluation, launch — with ecosystem lock-in, licensing, human fallback, an acceptance list and failure modes.
Prepare: list what it must not answer
This is one design for a customer-service workflow with human fallback, not a product execution record. Question counts, traffic percentages, observation periods and sample sizes are illustrative budgets to adjust to risk and volume. Write approvals are the permission boundary chosen for this example.
- Intents: refunds, address changes, delivery status, product questions and complaints, ordered by frequency.
- Excluded questions: price commitments, legal liability, medical advice and account passwords go to the designated human contact.
- Channels: web, app, messaging and phone have different context and identity requirements.
- Fallback: define triggers, recipient and expected waiting time.
Specify what can be answered, which actions can be executed and who receives handoffs before configuring the workflow.
Knowledge base: approved text only
- Use published FAQs, policies and product documentation; exclude internal drafts.
- Attach versions and effective dates. Implement expiry handling: retain older versions for traceability but exclude them from default retrieval.
- Chunk by meaning and preserve source links.
- Require supporting sentences after retrieval; say “not found” when evidence is absent.
Failure mode: stale policies remain retrievable and produce confident wrong answers.
Tools: read and write separated
| Tool | Type | Permission | Confirmation |
|---|---|---|---|
| Look up order | Read | Read-only, filtered by user identity | Not required |
| Delivery status | Read | Read-only, filtered by identity and order authorisation | Not required |
| Change address | Write | Unshipped orders only | Human confirmation |
| Refund | Write | Policy-eligible cases only | Human confirmation |
Boundary for this example: writes require human confirmation or independent review; the agent does not execute payments directly.
Guardrails: four layers
- Input: personal-data detection, injection checks and handling of overlong inputs.
- Knowledge: source-scoped answers, citations and flagged conflicts.
- Tools: allowlists, parameter validation and write confirmation.
- Output: checks for unsupported sensitive commitments, fallback triggers and logs.
Each layer needs observable signals so failures can be located afterwards.
Evaluate offline first
- Offline set: an illustrative 100 real questions covering frequent intents and exclusions, each with expected answers and acceptable variations.
- Metrics: resolution, handoff, mistaken commitments, average turns and citation accuracy.
- Staged rollout: an illustrative 5% of traffic for one week; roll back when the predefined mistaken-commitment limit is exceeded.
- Regression: rerun the offline set after knowledge-base changes.
Failure mode: testing answerable cases but omitting cases that should be refused or handed off.
Launch: observe and roll back
- Record intents, retrieval, tools, answers and handoff outcomes only to the extent necessary. Redact sensitive fields and define log access and retention.
- Monitor mistaken commitments, abnormal handoff rates and empty retrieval.
- Provide a switch to human service or a previous version.
- An illustrative review schedule is 20 conversations per week; adjust to risk and volume.
Cost formula
Model cost per conversation = sum over calls of
(input tokens × input rate + output tokens × output rate) / 1,000,000
Conversation cost = model cost + actual retrieval cost + actual tool cost
Monthly cost = conversations × average conversation cost
+ seats/review costs + maintenance
Rates are per million tokens. Separate cached input at its applicable rate and include retries in actual call counts. Count retrieval and tools by their actual billing units rather than multiplying them again by model turns. Record assumptions with the cost calculator.
Acceptance checklist
- [ ] Intent and exclusion lists reviewed.
- [ ] Knowledge contains published material with effective dates.
- [ ] Every write has the example's required confirmation.
- [ ] Each of the four control layers has an observable signal.
- [ ] Offline questions cover frequent intents and exclusions; predefined targets met.
- [ ] Staged traffic and rollback are ready.
- [ ] Fallback conditions and accountable owner are recorded.
- [ ] Log retention satisfies applicable requirements.
Common misreads
- Low-code does not remove identity, residency or audit configuration.
- Fair-code and OSI open source differ; n8n's Sustainable Use License has conditions.
- A large knowledge base does not establish answer accuracy; stale and conflicting content still needs handling.
- Handoff is appropriate when the workflow calls for it; failing to hand off is the problem.
Sources
| Source | URL |
|---|---|
| Microsoft: Copilot Studio (enterprise low-code agents and Power Platform / Dataverse; October 2026 snapshot) | https://www.microsoft.com/en-us/microsoft-copilot/microsoft-copilot-studio |
| n8n: official documentation and licence (fair-code / Sustainable Use License; October 2026 snapshot) | https://docs.n8n.io/ |
| Dify: official documentation (visual workflows and knowledge bases; October 2026 snapshot) | https://docs.dify.ai/ |
| LangGraph: official documentation (stateful orchestration and interruptions; October 2026 snapshot) | https://docs.langchain.com/oss/python/langgraph/ |
Source snapshot: 2026-11-03; item-specific rechecks and their scope are recorded in the text or source notes. Features and terms may change; check the original sources before use.