AI agents & API integration
Rebuilding a live AI customer agent that was quietly failing
Days after launch, a retailer’s AI customer service agent was surfacing the wrong products and telling customers to contact a team it never handed them to. I traced the failures to how the agent’s instructions were structured, then re-engineered the escalation logic and the Shopify order pipeline behind it.
By Manan AsimUpdated
Key figures
Scope and diagnostic figures from the engagement
- 4customer-facing failure modes traced to their cause
- 5.6%of the catalogue was actually indexed: 2,216 of 39,236 URLs
- 46,464products in the portal the agent had to answer about
- Nonecustomer-facing downtime during the rebuild
Engagement
- Client
- Luxury jewellery retailer
- Sector
- Luxury retail, online and showroom
- Engagement
- Post-launch remediation
- My role
- Diagnostic, rebuild and handover
- Delivered
- At Growlyze Technologies
Tech stack
- HubSpot Service Hub
- Breeze Customer Agent
- Shopify Admin API
- Make.com
- GraphQL
Architecture
How the pieces connect
- 01 Customer
- Customer question
- 02 Agent
- Breeze Customer Agent
- 03 Paths
- Order status
- Product facts
- Cannot resolve
- 04 Systems
- Shopify Admin API
- Help desk routing
- 05 Result
- Structured reply
- Human handover
- Source
- Step
- Logic
- Output
01 · Challenge
Days after launch, a retailer’s AI service agent was returning the wrong products, asking customers for links, quoting the wrong currency, and telling people to contact a team it never handed them to.
02 · Strategy
Audit the whole system before touching it. The product problem was a platform ceiling, not a setting, so the fix was to engineer a reliable refusal and a real handover, and to rebuild the order pipeline behind the agent.
03 · Impact
Escalation, order tracking and currency fixed and verified in a single cycle with no customer-facing downtime. A live product lookup was built, documented and deliberately held back.
01Context
The retailer sells pre-owned and one-of-a-kind pieces through an online store and a showroom. Its AI agent had been delivered against a ten-hour scope. My part of that original build was one component: a custom action that lets the agent answer live order-status questions by calling the Shopify Admin API through a Make.com webhook. Knowledge sources, tone, guardrails, escalation triggers and routing were configured by other contributors.
Days after launch the client’s customer service manager sent two detailed complaints with chat transcripts. The agent could not answer product questions: it refused, repeatedly asked customers for links, and surfaced the wrong item. And escalation to a human never happened. No handover occurred and no ticket was created. I was brought in to audit the full system, find the cause and fix it.
02Four failures, four causes
| What customers saw | What was actually happening |
|---|---|
| The wrong product returned | Knowledge retrieval is semantic, not exact. It cannot do an exact-key lookup on an item. |
| Repeated requests for a link | Emergent behaviour. Nobody had configured it. |
| “Contact our team”, with no handover | An instruction literally told the agent to say this. Producing the sentence and performing a handover are separate mechanisms, and only one was wired. |
| Prices in the wrong currency | Portal currency had been left at the platform default. |
03Approach
Audit the knowledge layer
47 knowledge sources, and a crawl covering 2,216 URLs against a catalogue of 39,236. Three platform constraints explained the gap: a website knowledge source is capped at 1,000 pages, crawled sources refresh weekly with up to a seven-day lag, and semantic search cannot perform an exact-key lookup. The product problem was never a configuration defect. It was an architectural ceiling that had been mistaken for one.
Engineer the refusal, not the answer
I rewrote the agent’s instructions: dual-clause escalation on a phrase match or an inability to resolve, six product-question categories added as triggers, the redirect instruction removed entirely, an explicit rule never to request a link, and an exact-match-only rule on product facts. All of it compressed to fit the platform’s field limits and validated against its pre-flight checker.
Rebuild the order pipeline
Webhook, token exchange, Admin API order query, structured reply. Credentials rotated and moved to shared platform variables, an error path that returns a structured response, an explicit result flag with the order name echoed back, a current supported API version, and carrier, tracking number, link and ship date now surfaced. Field names and the webhook identifier were preserved, so the swap needed no downtime.
Guarantee an owner after handover
Ticket assignment was reconfigured so a handed-over conversation always produces an owned ticket, regardless of availability or time of day.
Test one variable at a time
A controlled test of the escalation trigger keywords showed identical behaviour with and without them, which proved the platform interprets those lists semantically rather than literally. No fix was reported as complete on the strength of having been configured.
Know what not to ship
A live product-lookup integration against the Shopify catalogue was fully designed and built as a deployable artefact, then deliberately not deployed. It was handed over with one documented dependency: a single additional API permission.
04Outcome
| Area | Status |
|---|---|
| Human escalation | Fixed and verified |
| Product and price accuracy | Resolved by design |
| Order tracking | Upgraded and verified |
| Currency | Fixed |
| Integration resilience | Hardened |
| Credential handling | Remediated |
| Implementation time | Single cycle |
| Customer-facing downtime | None |
The highest-value decision here was choosing not to build.