BICOSY / BICO.CH
AI Shopping Assistant for bico.ch on WooCommerce
About the Project
How SAPIENTROQ built BICOSY, an AI shopping assistant for the Swiss mattress retailer bico.ch — a NestJS backend with pgvector RAG, declared typed tools and a WordPress plugin that streams live WooCommerce events into the conversation.
Used technologies:
Country
Switzerland
Industry
Retail / E-commerce (mattresses)
Development Hours
2000+
Team Size
4-6
Why a generic chatbot underperforms in storefronts
Most WooCommerce storefronts plug in a generic ai chatbot for ecommerce and watch it answer like a help desk: it greets the visitor, repeats the product description and stops short of guiding a real purchase. The team at bico.ch saw the same pattern — visitors asked mattress questions, the bot replied with marketing copy and the cart stayed empty. The brief for BICOSY was the opposite: a sales agent that follows the company sales logic, asks the right qualifying questions and lifts conversion through structured advice, not free-form chat.
The buyer reads this page asking one question — is this another prompt-engineering exercise dressed up as conversational commerce ai, or a real piece of software. The rest of the page answers that.
Architecture: three repos, one ai sales agent
BICOSY ships as three repositories with separate lifecycles: a WordPress plugin for ingestion and the chat widget, a NestJS backend that holds the AI brain, and a React admin for operators. Splitting them keeps the shop deployable on a regular WordPress cadence while the backend evolves on its own.
- Backend: NestJS + Prisma on PostgreSQL with pgvector enabled, Voyage AI embeddings, OpenAI and Azure OpenAI side by side for generation, Redis + BullMQ for jobs, Socket.IO for chat streaming.
- Observability: OpenTelemetry + Pino + Azure Monitor, so every tool call, embedding lookup and prompt version is traceable end to end.
- Admin panel: React + Vite + MUI with i18next for localisation, used by operators to inspect conversations, profiles and prompt versions.
The shape mirrors how we build other revenue-critical apps under Custom Platform Development.
Sales-script-in-code via declared typed tools
The conversation engine is built around an AI tools layer that declares typed skills the model is allowed to invoke: product search, lookup by name, mattress finder, profile receive and update, attribute asking and recommendations. Each tool has a typed input contract and a typed output, and the model is constrained by those declared tools and instructions rather than free-form prompts.
That is the difference between a rag chatbot ecommerce demo and a sales-script-in-code. The model cannot improvise a phantom SKU; it can only call productSearch or mattressFinder and explain what came back. Sales logic — when to ask for sleep position, when to suggest a topper, when to offer a comparison — lives in the tool layer and the instruction set, not in a single megaprompt that drifts each time someone edits it.
Live WooCommerce data, not stale exports
The WordPress plugin is the bridge between the shop and the woocommerce ai chatbot. It hooks the events that actually matter for a sales conversation and forwards them to the backend with a cookie-based visitor id:
- Add to cart, checkout start, payment, user registration and login — so the agent knows where the visitor is in the funnel.
- Product sync — the catalog the AI sees stays aligned with the catalog WooCommerce serves, not a nightly CSV.
- An Autoptimize tap so cache invalidation does not silently desync the assistant from the live product list.
The result is an agent that talks about what is in stock right now, reacts when a visitor abandons checkout and stops asking for information the visitor has already given.
Versioned prompts and a self-tuning loop
Prompt drift is the quiet killer of conversational agents — someone tweaks a line, conversion shifts, no one can roll back cleanly. BICOSY treats prompts as code. The conversation engine has dedicated modules for AI conversations, AI tools, embeddings, the vector store, instructions, attentions, goals, system instructions and tool instructions. Each system instruction is versioned end to end.
A dedicated auto-tune service closes the loop: it proposes prompt changes from live conversation feedback, submits them for review, and accepts or rejects them based on signal. Operators see proposed diffs in the React admin and ship a new prompt version the same way an engineer ships code — through review, not through an open text box.
This is the engineering discipline we bring to every conversational engagement under AI Consulting.
Per-customer memory, voice next, talk to us
Profile data the agent collects — sleep position, partner preferences, allergies, prior purchases — is persisted per customer in Postgres and flows back into the shop systems, so the second visit does not start from zero. The same advisor recognises the returning visitor across sessions and resumes where the conversation left off.
The natural extension is voice. When a buyer wants the same sales-script-driven agent on the phone or a call widget, the architecture lifts cleanly into our AI Voice Agent service — the tool layer, prompts and memory stay; only the channel changes.
If you run a WooCommerce or WordPress shop with more than 500 SKUs and your current chatbot is not earning its slot, scroll to the FAQ or book a discovery call to plan your AI sales advisor.
Solutions
Solutions in this engagement
- Declared typed tools constrain the model to real sales actions.
- WordPress plugin streams WooCommerce events to the NestJS backend.
- pgvector RAG over the live product catalog with Voyage embeddings.
- Versioned system instructions plus an auto-tune service review loop.
Delivered Value
- Sales-script-driven advisor reading live WooCommerce data.
- Tool-bound conversations that cannot invent phantom products.
- Prompt changes shipped through review, not an open text box.
- Per-customer profiles feeding back into the shop systems.
Frequently asked about this engagement
A generic chatbot answers questions; an ai sales agent runs a sales script. BICOSY is constrained by declared typed tools — product search, mattress finder, profile update, recommendations — and follows bico.ch sales logic with live stock.
The WordPress plugin hooks WooCommerce events — add to cart, checkout, payment, registration, login — and forwards them to the NestJS backend. A product sync plus an Autoptimize tap keep the AI catalog aligned with the live shop in real time.
Sales logic lives in a typed tool layer, not in a single megaprompt. The model can call lookup by name, mattress finder, profile receive and update, attribute asking and recommendations — each with a typed input and output. Drift from a careless edit is bounded by the contracts.
System instructions are versioned end to end. A dedicated auto-tune service proposes changes from live signal, submits them for review and accepts or rejects on outcome. Operators ship a new version through review in the React admin, with rollback to any earlier state.
It forwards WooCommerce add-to-cart, checkout, payment, registration and login events plus the cookie-based visitor id, and runs product sync and an Autoptimize tap so the AI catalog stays aligned. The chat widget ships from the same plugin.
About SAPIENTROQ
Interested in a solution?
We are glad to show you various options without any obligation.

Roland Kurmann
CEO, SAPIENTROQ


