Home Services Case Studies About How We Work AI Audit Book a free call
← All case studies E-commerce · AI Sales & Support Assistant

AI Sales Assistant —
Consult, Quote, Order, Support

An online retailer selling professional tools and industrial equipment needed more than a search bar. Buyers needed expert consultation before purchasing. We built an AI assistant that consults on product selection, creates orders in real time, and handles post-purchase support — end to end, in one conversational interface.

AI Integration RAG Systems LangChain Agents pgvector OpenAI GPT-4o

The situation

An e-commerce platform selling professional power tools, hand tools, and industrial equipment had a catalog problem: over 15,000 SKUs with deep technical specifications, compatibility matrices, safety requirements, and application-specific recommendations. Buyers — tradespeople, contractors, and procurement managers — routinely needed expert guidance before purchasing. Which drill for masonry? What torque rating for this application? Which accessories are compatible? Standard search and product filters couldn't answer these questions.

The result was a significant conversion gap: sessions that required product consultation had a 2.4× higher drop-off rate than simple search-and-buy sessions. Customers who couldn't quickly confirm they were buying the right tool for their specific job left without purchasing — often to a competitor with phone sales support. Meanwhile, the post-purchase support team was buried in repetitive "where is my order" tickets, consuming capacity that should have been spent on complex warranty and return cases.

The business needed an AI assistant that could do three things that no off-the-shelf chat widget could handle: consult on complex technical purchases using deep product knowledge, actually create orders within the same conversation, and resolve post-purchase questions against real order data — all without a human agent in the loop for the majority of sessions.

What we built

A LangChain agent with seven purpose-built tools, grounded in a RAG knowledge base across the full product catalog, and wired directly into the order management system via authenticated API calls. The assistant runs as a streaming FastAPI service behind an embeddable React widget, deployed on AWS ECS with sub-800ms median response latency.

  • Product consultation via RAG — the assistant queries a hybrid retrieval pipeline (pgvector dense search + PostgreSQL full-text search) over the indexed product catalog, technical spec sheets, installation guides, and compatibility matrices. When a buyer describes their application, the assistant retrieves the relevant products, surfaces key spec differences, and reasons over them to make a confident recommendation with cited sources
  • Real-time order creation — authenticated tool calls to the order management API allow the assistant to check live inventory, add items to a cart, apply discount codes, and submit orders within the conversation — no handoff to a checkout flow required for buyers who are ready to purchase
  • Compatibility and accessory intelligence — a dedicated compatibility tool queries a structured compatibility database, so the assistant can verify whether a drill accepts a specific chuck, whether a battery fits a charger, or which saw blades are appropriate for a given material — with confidence scored answers rather than hallucinated guesses
  • Post-purchase support tools — order lookup by email or order ID, shipment tracking status, return initiation, and warranty registration — all resolved against live PostgreSQL order data without involving a human agent
  • Graceful escalation — when the assistant reaches a case it can't confidently resolve (complex warranty disputes, damaged-in-transit claims, out-of-scope questions), it hands off to a human agent with full conversation context pre-loaded, so the agent doesn't start from scratch
  • Evaluation infrastructure — a RAGAS evaluation pipeline runs on every deploy against a 300-query golden test suite covering product recommendation accuracy, tool call correctness, and answer faithfulness. LangSmith provides trace-level observability for every LLM call in production

Why the architecture choices matter

pgvector over a standalone vector database. For an e-commerce platform, product catalog data and order data already live in PostgreSQL. Putting vector embeddings in the same database eliminates a separate infrastructure component, gives retrieval queries access to PostgreSQL's relational metadata (category, brand, price range, stock status) as hard filters before the vector search runs, and maintains transactional guarantees when the assistant reads inventory and creates an order in the same request. A standalone FAISS index would have required a separate sync pipeline and couldn't enforce stock-level consistency at the moment of order creation.

Hybrid retrieval for a technical product catalog. Professional tools buyers query in two distinct patterns: semantic intent ("drill for concrete walls") and exact technical lookup ("model DCD996B max torque"). Pure vector search handles the first well and consistently misses the second. Pure full-text search handles the second and misses the semantic intent. We run both in parallel and merge ranked results using reciprocal rank fusion — the assistant always gets the right product regardless of how the buyer describes their need.

Agents over a fixed RAG pipeline. A retrieval-augmented generation pipeline alone cannot create orders, check live inventory, or look up a shipment status. These require tool calls to external systems with authentication and transactional side effects. A LangChain agent framework lets the assistant reason about which tool to call based on buyer intent, compose multi-step actions (search → compatibility check → inventory check → create order), and handle the cases where a tool returns an error or unexpected result gracefully — rather than returning a hallucinated answer.

Streaming responses for perceived performance. A tools buyer asking "which drill is best for drilling into brick at 20 feet overhead" will get a multi-paragraph technical answer. Without streaming, they wait in silence for 4–6 seconds. With streaming, the first token appears in under 200ms and the answer builds progressively — the UX feels like talking to an expert, not waiting for a page to load. This alone measurably reduced conversation abandonment rate during the beta period.

Platform metrics · Live

Engagement duration12 weeks
Conversion lift (AI-assisted)+34%
Avg order value increase+28%
Sessions fully automated81%
Support ticket reduction62%
Median response latency<800ms
Products indexed15K+
RAGAS faithfulness score0.91

Tech stack

Python 3.11 FastAPI LangChain OpenAI GPT-4o text-embedding-3-large PostgreSQL pgvector Redis LangSmith RAGAS React AWS ECS Terraform

Agent tools built

→ product_search (hybrid RAG) → product_compare → compatibility_check → inventory_check → create_order → get_order_status → initiate_return → escalate_to_human

Results

+34%
Conversion rate lift on AI-assisted sessions compared to unassisted control group
+28%
Average order value increase — driven by accurate accessory recommendations and upsell
81%
Sessions fully resolved by the AI without any human agent involvement
62%
Reduction in "where is my order" support ticket volume since deployment