Why every growing e-commerce store hits the same wall
Pre-sales support is the hidden bottleneck of online retail. Customers ask the same questions thousands of times: product dimensions, style compatibility, installation instructions, pricing for custom wall sizes. Each answer is simple. The volume is not.
Hiring more support staff scales the cost linearly with traffic. A generic chatbot gives generic answers and loses trust the moment it gets a price wrong. The real solution requires something that can handle both semantic questions ("something calm and modern for a bedroom") and hard factual lookups ("what is the exact price of SKU 000389 with 10% waste margin") โ without confusing the two.
That is the problem Hybrid RAG solves. And it is the architecture we built for da-vinchi.pl.
The core architectural decision: two truth layers
A plain LLM over documents hallucinates prices. A pure SQL bot misses semantic intent. Hybrid RAG splits knowledge into two layers: SQL for hard facts (price, SKU, stock), pgvector for soft knowledge (style, room guides, FAQ). The agent queries both โ and never invents a number it did not retrieve from the database.
The full pre-sales conversation โ without staff
How the two-layer knowledge system works
The fundamental architectural decision is to separate hard facts from soft knowledge and retrieve them through different paths.
โ
LangGraph ReAct agent โ decides which tools to call
โ โ
pgvector (Supabase) PostgreSQL (Supabase)
semantic: "calm bedroom style" SQL: price BETWEEN 100 AND 140
โ style guides, room matches โ SKU, exact price, stock_status
โ โ
Agent merges results โ product shortlist with real prices โ reply
SQL layer (hard facts): SKU, final_price, stock_status, route, colors, room tags. The agent never constructs a URL or price from memory. Every number shown to the customer comes from a live database query.
pgvector layer (soft knowledge): 142 semantic chunks across 5 types โ FAQ, technical specs, style guides, room recommendations, sales scripts. Queries like "something for a Scandinavian interior" trigger vector similarity search, return the right style context, which then feeds into SQL filters.
What each tool does and why it exists
How the knowledge base is built
Two independent pipelines feed the system:
Catalog import: CSV from the store's backend โ deduplication โ out-of-stock filtering โ 355 active SKUs in PostgreSQL. Re-runnable without duplicates.
Knowledge base build: Structured markdown documents โ 142 chunks across 5 semantic types. Chunking strategy varies by document: FAQ splits per question, room guides carry structured metadata, style mappings include color and category fields.
Both pipelines run independently and can be re-triggered when the product catalog or policies change.
What shipped
- 355 active SKUs in structured SQL
- 142 semantic knowledge chunks in pgvector
- 5 agent tools covering the full pre-sales flow
- Zero hallucinated prices in production testing
- Full web chat widget embedded on the store
- LangSmith tracing for every agent run
- pytest buyer-scenario integration tests on CI
Common questions about AI customer service automation
Tools used
I build RAG-based sales agents for e-commerce: product catalog integration, semantic search, price calculations, FAQ handling. Works with any product catalog โ wallpapers, furniture, electronics, B2B supplies. Based in Munich, working with clients across Europe.