RAG AI assistant for Starmat and Matplus sales staff
Under contract · Mediapilote● Live
An AI assistant for sales staff in Starmat and Matplus DIY stores: RAG answers with sources using pgvector, a project sheet, and photo, plan and voice input.
Context
Starmat and Matplus wanted to give sales staff in their DIY stores an AI assistant that could scope a customer’s project, break it into steps and answer questions on materials, tools, safety and regulations. The pilot department is bathrooms.
The starting point was a proof of concept. The client had split the rest into three stages: V0 (sourced text chat, document management, multi-tenancy), V0+ (photo, floor plan and voice), then V1 (NEGOGUIDE product catalogue, roles, cost and quality tracking).
Challenge
A salesperson cannot rely on a made-up answer. Every statement had to point to a specific passage in a manual, a data sheet or a regulatory text, and the assistant had to know when to abstain. Documents came in every shape: web pages, clean PDFs, scanned PDFs.
Hosting added its own limits: a shared server with a capped number of processes, and models served by OVH AI Endpoints with their own rate and batch-size limits. The pipeline had to fit within that without losing documents along the way.
Approach
I rewrote the foundation in TypeScript: a Fastify API, a worker that drains the indexing queue and a Next.js app for the chat and the back office. The pipeline fetches pages and PDFs, extracts text (pdftotext, then PaddleOCR and Tesseract for scanned pages), chunks it, computes embeddings and stores everything in PostgreSQL with pgvector. Search combines vector and BM25, then a reranker reorders passages before the answer is written.
For sales staff, the chat streams its answers with clickable citations, keeps a live project sheet and accepts a photo, a dimensioned floor plan or voice input. For administrators, I built document management with CSV import of URLs, versioned system prompts and project sheets, roles, conversation annotation and an evaluation bench with an LLM judge for regression testing. The NEGOGUIDE catalogue is synced by the worker and shows up in the chat as product cards.
(04) — Results
Key figures- 142
- commits
- 32
- versioned SQL migrations
- 4
- inputs: text, photo, floor plan, voice
- 40
- labelled queries in the retrieval bench
