How the AI works
Zubby’s AI isn’t a plain chatbot. It’s an agent: a language model wrapped in a retrieval pipeline, a function-calling tool registry, and a guardrail layer that keeps it inside the lanes you set. This page explains what happens between a shopper typing a message and the AI replying — so you know exactly what to tune when an answer is wrong.
The five stages of a reply
- Intent classification. A small model decides what kind of question this is — product discovery, order status, policy, sizing, complaint, escalation, etc. Each intent has a different system prompt and tool allowlist.
- Retrieval. If the intent needs catalog or policy knowledge, we embed the shopper’s message into 1,536-dimensional vectors and run a hybrid search across your products, FAQs, pages, and reviews. The top hits become the agent’s “context window”.
- Tool selection. The main model decides whether to answer directly or call one of the tools: search products, compare, get bundle recommendations, get order status, check inventory, get size recommendation, get smart offer, get store policy, add to cart. Tools call back into your store’s live data.
- Drafting. The model writes a draft answer grounded in the retrieved snippets and tool outputs. Citations are tracked at the sentence level so the dashboard can show exactly which source backed which sentence.
- Guardrail pass. A second model verifies the draft against your brand rules (e.g. “never promise free shipping”, “never quote a discount over 20%”) and the global safety filter. Failures route to a fallback response or trigger a human handoff.
Retrieval
Retrieval is the most consequential stage. If the right snippets don’t show up in the top-k results, the AI either answers from memory (risky) or escalates (safe but unhelpful). Three things shape retrieval quality:
- Catalog completeness — every product synced with rich descriptions, attributes, and at least one image alt text.
- Knowledge base depth — your policies, FAQs, and long-form pages indexed. See Knowledge base.
- Embedding freshness — when a product changes, we re-embed within a minute via Shopify / Woo webhooks.
Hybrid retrieval
Citations
Every answer is annotated with source citations: product cards, page URLs, or a verbatim policy block. Citations are displayed inline in the widget and audited in Conversations → Detail view.
When a sentence has no citation, the dashboard flags it for review. Flagged sentences are a top input to the gaps inbox (Training).
Tools
Tools are functions the agent can call to get fresh data or take an action. You can disable any tool from AI → Tools — for instance, turn off add to cart if you want the agent to recommend but never modify the cart.
Guardrails
Two layers:
- Universal. Toxic content filter, jailbreak detection, PII redaction in outbound logs. Always on.
- Brand-specific. Your “do not say” list, allowed discount range, persona constraints. Edit under System prompt.
Provider routing
Zubby is multi-provider. The admin control plane resolves each capability (chat, embeddings, recovery) to a concrete model based on status, health, and priority. Supported providers: OpenAI, Azure OpenAI, Anthropic, and Gemini. Embeddings are pinned to 1,536 dimensions so any provider switch is hot-swappable without re-indexing.
Failover is automatic. If the primary provider returns a 5xx or breaches latency budgets, the next provider in the queue takes over within seconds — your shoppers don’t see an outage.
What good replies look like
Audit-worthy AI replies share three properties: they have at least one strong citation, they answer the actual question rather than the adjacent question, and they offer a clear next action (product link, return policy, escalate). The dashboard scores every conversation on these three axes; weekly review surfaces patterns to fix.