All projects
E-commerce / Retail2026·AI product engineer·4 months

Human-in-the-Loop E-Commerce AI Assistant

A mid-market retailer needed conversational shopping support that never invents products or policies. I built a tool-using assistant over their live catalogue with retrieval-backed recommendations, an escalation path to human agents, and a feedback loop that turns every correction into training signal.

310k
Conversations / month
72%
Full automation rate
0.3%
Hallucinated claims
+14%
Assisted conversion lift

The challenge

Generic chat wrappers hallucinated stock, sizing, and returns policy — unacceptable for a retailer with real fulfilment costs. The assistant also had to hand off gracefully instead of stalling when it was unsure.

Approach

  • Exposed catalogue, order, and policy systems as typed MCP tools so the model retrieves facts instead of recalling them, with every answer traced back to a source record.
  • Combined a hybrid Elasticsearch retriever with a learned re-ranker and a collaborative-filtering recommender, so suggestions respect both semantic intent and real purchase behaviour.
  • Modelled conversation, escalation, and feedback state in PostgreSQL through SQLAlchemy with Alembic migrations, keeping the human-review queue transactional.
  • Added confidence-gated escalation: low-margin, high-risk, or low-certainty turns route to an agent console where the human answer becomes a labelled preference pair.
  • Provisioned the whole stack with Terraform across environments, with canary routing so each prompt or retriever change ships to a traffic slice first.

Outcome

72% of conversations resolve without a human while hallucinated claims sit at 0.3% of audited turns. Assisted sessions convert 14% higher than unassisted, and agent handling time dropped by a third thanks to pre-drafted context.

Results in detail

Figures are from the delivered engagement, normalised where data is confidential.

Automation vs. escalation over rollout

Share of conversations fully automated, escalated, or abandoned, by month.

Retrieval quality by query intent

Re-ranked hybrid retrieval vs. keyword baseline, normalised nDCG@10.