AI technical sales advisor for a B2B online store
An agent that finds products, checks live price and stock, calculates materials and drafts quotes, citing the data sheet behind every figure.
- Industry
- Flooring and wall panel distribution
- Engagement
- Direct client
- My role
- Agent architecture and development
- Stack
- Python, FastAPI, LangGraph, Claude, PostgreSQL, pgvector, Next.js
The problem
The client wanted their online store to answer the questions homeowners, installers and architects ask before buying: which product works in a bathroom, how many boxes cover 34 m², which certifications a panel has. And to do it without making up product codes or prices.
What I decided
- A fixed LangGraph graph instead of an autonomous agent. The sales process is known in advance, so a graph is more predictable and cheaper.
- Code does the maths. The model interprets the question and writes the answer, but boxes, square metres and wastage come from deterministic functions.
- A validator checks every answer before it goes out. If it mentions a product code, a figure or a claim that isn’t in the catalogue or the documentation, the answer is discarded and a template reply is used.
- Two models: a fast one to understand the question and a stronger one to write the answer.
What I built
- Hybrid RAG over data sheets and certificates, with verbatim quotes and page numbers.
- A read-only adapter on the store’s database for live price and stock.
- Draft carts and quotes, plus a handoff to the sales team when needed.
- Per-turn traces of latency, tokens and cost, with personal data redacted, and a monthly spending cap.
Result
On a suite of 42 real cases over the catalogue:
| Metric | Result |
|---|---|
| Cases passed | 39 of 42 (93%) |
| Product accuracy | 96% |
| Verbatim citations | 100% |
| Exact calculations | 100% |
| Median / p95 latency | 4.2 s / 8.4 s |
| Cost per answer | $0.008 |