RAG · AI Agent · E-commerce · Production

Web Sales Assistant — AI RAG Agent

Production AI Sales Assistant for a Polish wallpaper and décor e-commerce store. A LangGraph ReAct agent with Hybrid RAG architecture — SQL for hard facts, pgvector for semantic knowledge. Zero hallucinated prices, 1,200+ SKU catalog, ~90% API cost reduction. Built and deployed in production — not a demo.

~90% API cost reduction vs. hot-cache approach through architectural design
1,200+ SKU Zero hallucinated prices — hard facts in SQL, not vector search
5 tools LangGraph ReAct agent: search, filter, detail, recommend, FAQ
98% Data optimisation through ETL pipeline and knowledge-base contract tests

How it works

  • Hybrid RAG: SQL for deterministic facts (price, SKU, dimensions), pgvector for semantic knowledge (style, mood, recommendations).
  • LangGraph ReAct agent — tool-calling loop with fallback handling and observability via LangSmith.
  • FastAPI backend + web chat widget (/chat endpoint). Telegram used for internal debugging only.
  • ETL pipeline with deduplication and knowledge-base contract tests to prevent data drift.
  • Production-deployed on Google Cloud Run — auto-scaling, zero-downtime containerized microservice.

What it replaced

  • Handles product search, filtering, detail queries, recommendations, and FAQ without human intervention.
  • Buyer-scenario integration tests ensure the agent behaves correctly under edge cases.
  • ~90% reduction in API costs compared to naive LLM-for-every-query approach.
  • Sales team gets a working AI assistant that answers complex product questions instantly.
  • Scales to any catalogue size — not limited by context window.

Why this approach

  • Split SQL vs. vector intentionally — price hallucinations are a business risk, not a technical inconvenience.
  • ReAct agent over single-shot prompting — complex user queries often require multi-step tool use.
  • LangSmith observability from day one — not bolted on later.
  • Baseline ETL tests before embedding — garbage in, garbage out is the most common RAG failure.

Can this work for you?

  • Any e-commerce or product catalogue business in Germany with 100+ SKUs can benefit from this architecture.
  • Works for: furniture stores, electronics retailers, B2B parts suppliers, wholesale catalogs.
  • Integrates into existing websites as a chat widget — no full rebuild required.
  • Cost-effective: designed to minimise API spend from the start.

Hybrid RAG Pipeline & Guardrail Shields

Deterministic routing vs semantic search: E-commerce product catalogs present a fundamental challenge for standard RAG: LLMs routinely hallucinate numerical details like prices, remaining stock, or exact millimeter dimensions. To prevent financial liability, this system splits incoming queries across two parallel engines. Hard parameters (price limits, SKU identifiers, availability) execute directly as indexed PostgreSQL queries. Soft nuances (interior aesthetic, color harmony, visual room vibes) route through semantic vector search powered by pgvector and text-embedding models.

Guardrails & zero hallucinated prices: The LangGraph ReAct agent operates behind strict Pydantic argument validators. Before the model formulates a customer-facing recommendation, retrieved database facts are injected as verified ground-truth context. The agent prompt strictly forbids synthesizing ungrounded numbers. If an SKU is out of stock or price data is ambiguous, the agent explicitly clarifies or offers relevant catalog alternatives rather than guessing.

Latency & cost engineering: Rather than feeding the entire 1,200+ product catalog into prompt context windows—which inflates latency and token costs—the hybrid retriever fetches only top-k relevant candidates. This reduced token consumption and API expenses by approximately 90%. Hosted as a containerized FastAPI microservice on Google Cloud Run, cold-start latency is kept under 1.2s with continuous p95 response times under 800ms.

Frequently Asked Questions

How can an AI sales agent reduce operational costs for an e-commerce business?
A RAG-based AI sales agent automates product queries, recommendations, and customer support without human intervention. For an e-commerce store with 1,200+ SKUs, this system reduced API costs by ~90% using Hybrid RAG (SQL + vector search) and eliminated manual catalog lookups, saving hours of daily staff time.
What is Hybrid RAG and why does it reduce AI costs compared to standard chatbots?
Hybrid RAG combines SQL database queries with vector search (pgvector). Instead of sending every question to an expensive LLM, the system first checks structured data (SQL) and only uses the AI model for complex queries. This reduces API calls by up to 90% while maintaining accuracy and eliminating hallucinations on product data.
How does the agent ensure zero price and inventory hallucinations?
The agent uses deterministic tool execution: prices, stock levels, and SKUs are strictly retrieved from live database tables and directly injected into the prompt context. The LLM is constrained by strict Pydantic shields and system guardrails forbidding it from inventing figures.
What does it cost and take to build a production AI sales agent?
Development timeline typically ranges from 1 to 3 weeks depending on catalog complexity, data cleaning requirements, and CRM integrations. Deployed as a containerized microservice on Google Cloud Run with serverless scaling, monthly infrastructure operational costs remain under 30 EUR for low-to-medium traffic.

Tools used

Python LangGraph FastAPI PostgreSQL pgvector Gemini 2.5 Flash Sentence-Transformers LangSmith Docker Google Cloud Run pytest
Need a similar system for your business?

I build AI sales assistants and RAG agents for e-commerce and B2B companies in Germany and EU. Let's talk about your use case.

Contact me Read the article All projects
← Back to projects