MA
← Selected systemsENGINEERING CASE STUDY

Anonymized commercial system · governed multi-channel conversational commerce

Persian Conversational Commerce

A governed sales assistant that separates what a model may interpret from what the catalog and deterministic policy are allowed to assert — it sells consultatively, refuses unsafe or fabricated answers, and serves customers across web widget, Telegram, and Instagram DM. The public surface below is a sanitized representative replay of the product experience, not a live production endpoint.

ContributionProduct architecture · backend · Persian NLU/NLP · evaluation · conversational UI · release hardening
Delivery surfacesWeb Widget · Telegram · Instagram DM — designed delivery surfaces
System shapeFastAPI · Redis · retrieval · deterministic policy · WooCommerce integration boundary
Public boundaryAnonymized · representative sanitized fixtures · no production logs, traffic, or client data
CORE QUESTION
How can an AI sales assistant guide customers toward suitable products without inventing facts, ignoring safety, or improvising commercial policy?
Owns · Governed multi-channel conversational commerce

System model

Interpret language. Ground facts. Enforce policy. Recommend within bounds.

Transition model

Why the conversation moves — every stage has a reason to hand over.

The system is not a single prompt. It is a staged flow where each transition is earned by the previous stage's outcome, so commerce actions only happen after safety and truth have been established.

01Social openingthe conversation starts as conversation, not a form
02Goal discoverythe assistant learns what the customer is actually solving for
03Safety clarificationminimum required constraints are asked before any recommendation
04Product retrievalonly approved catalog records can enter the candidate set
05Eligibility checkdeterministic gates block unsuitable or unsafe candidates
06Commerce lookupprice and availability come from the live shop source
07Recommendationa bounded comparison, never an improvised claim
08Approved cross-sellonly where an approved relationship and eligibility exist
09Purchase handoffa real purchase link or a clean human/channel handoff

Delivery surfaces

One governed brain, multiple delivery surfaces.

Web widget, Telegram, and Instagram DM are representative delivery surfaces of the system design. The conversations shown in this case study are representative reconstructions — no production customer logs, traffic, or conversion data is published.

Web Widget

Embedded assistant on the storefront with full consultative replay

Telegram

Conversation continues in Telegram with the same governed policy

Instagram DM

Direct-message surface bound to identical grounding and safety rules

Representative UX scenarios

Run five conversations that show the governance working.

Each scenario exercises a different governed behavior: consultative selling with persona, safety-before-sales under insistence, honest failure when WooCommerce is unreachable, recent-turn reference resolution plus the medical boundary, and resistance to injected authority claims. User questions are preserved; stronger health claims are softened in the public transcript so the case study remains about inference and commerce behavior rather than medical advice.

Representative UX replay
Sanitized demonstrations of system behavior · not production customer logs
PRODUCT EXPERIENCE
ح
دستیار فروش راهنمامشاوره محصول با اتکا به اطلاعات فروشگاه
آنلاین
چطور می‌تونم کمکتون کنم؟

یه چیزی می‌خوام که صبح‌ها انرژی خانواده رو خوب کنه؛ گیج‌ام که از کجا شروع کنم.

REPRESENTATIVE REPLAY

Representative UX conversations — sanitized demonstrations of system behavior, not production customer logs.

COMMERCE VALUES

Displayed commerce values come from representative WooCommerce snapshots and are not current prices. In the shipped system, WooCommerce remains the live authority for price, availability, and purchase links.

Product behavior surface

What the system reliably does — and what it refuses to do.

PersonaWarm Persian persona held across every turn
Consultative sellingGoal-driven guidance instead of scripted upsell pressure
Safety-before-salesInsistence does not override health constraints
Catalog groundingProduct attributes come only from approved records
WooCommerce truthPrices, stock, and links resolve through the live shop API
Recent-turn contextBounded memory resolves short references like “اون قبلیه”
Approved cross-sellCommercial suggestions trace to approved relationships
Injection resistanceIdentity claims and instructions cannot rewrite policy
Multi-channel deliveryWeb widget, Telegram, and Instagram DM surfaces

System boundary

The model interprets. The system decides what is true and allowed.

The design keeps language flexibility without giving the model authority over catalog facts, safety constraints, or commercial policy.

01

Interpretation

Language reasoning extracts intent, constraints, and conversational context.

02

Grounding

Only approved catalog records are factual authority for product attributes.

03

Policy

Deterministic rules can filter, rank, prohibit, or require clarification.

04

Commerce

Approved product relationships shape bounded comparisons and offers.

05

Evaluation

Provider-free fixtures verify grounding, continuity, and unsupported-claim behavior.

Commercial intelligence

A recommendation is a governed relationship, not an improvised upsell.

The system can recognize product comparisons and adjacent commercial opportunities, but the recommendation path remains bounded by approved relationships and current context.

CROSS-SELL

Adjacent, approved fit

A related product can appear only when the catalog relationship exists and the current eligibility decision permits it.

UPSELL

Bounded upgrade path

A higher-tier option is traceable to an approved relationship instead of being invented from model preference.

PACK / BUNDLE

Known composition

Bundle advice is grounded in approved pack relationships and product membership rather than improvised combinations.

SUBSTITUTE

Alternative under constraint

Substitution can be offered when a product is unsuitable or unavailable, but only from an approved substitute relationship.

Engineering decisions

Interpretation remains flexible; authority remains bounded.

DECISION 01

Separate language interpretation from product truth

The model may interpret intent and context, but approved catalog records remain factual authority.

DECISION 02

Keep commercial relationships explicit

Cross-sell, upsell, bundles, and substitutes come from approved relationships rather than improvised model preference.

DECISION 03

Gate selling eligibility deterministically

Approved selling edges are required before offers; caller-provided IDs are necessary but never sufficient.

DECISION 04

Require valid commerce lookups for prices and links

A missing or failed WooCommerce source produces a stated failure and a labeled prior snapshot — never an estimated fact.

Benchmark surface

What the system is designed to measure.

MEASUREMENT CONTRACT

Conversation quality is bounded by grounding, policy correctness, persona consistency, continuity, and the absence of invented product facts.

Persian intent fixtures, grounded-response suites, persona/style gates, golden behavior constraint cases, multi-turn replays, eligibility and injection boundary tests, and catalog mutation tests.
01Planner accuracyintent + constraint extraction
02Persona / style gateoffline renderer-persona suite
03Golden behavior constraintsforbidden claims · invented prices · off-policy offers
04Grounded responseclaims backed by catalog authority
05Selling eligibilityapproved edges only, IDs not sufficient
06Continuitybounded recent-turn state preservation

Evaluation

Offline gates make the claim inspectable before live-model behavior enters the picture.

SignalEvidenceInterpretation boundary
Semantic planner dry-run420 / 420 fixture cases passedVerifiedDry-run contract coverage; not live-model NLU accuracy.
Grounded-response gate114 / 114 provider-free cases passedVerifiedProvider-free fixture gate; not production rollout evidence.
Persona / style gate600 / 600 offline renderer-persona cases passedVerifiedOffline deterministic runtime gate; not proof of frontier-model naturalness.
Golden behavior constraint eval600 / 600 offline cases passed · forbidden output claims 0 · unapproved record usage 0 · static price/link invention 0 · selling-offer invention 0VerifiedProvider-free local validation; not production conversion evidence.
Selling eligibility gateApproved selling edges gated before offers · non-approved candidates blocked · caller-provided IDs necessary but not sufficientVerifiedDeterministic policy property; scope is the tested catalog fixtures.
Recent-turn memoryBounded prior-turn context · transcript remains untrusted · context/session isolation enforcedSupportedRuntime design constraint; not a long-term memory claim.
Unsupported factual claims0 in the 114-case provider-free gateVerifiedScoped to the tested fixtures and approved catalog data.
Continuity / commerce integration8 / 8 provider-free cases passed · 4 multi-turn · 4 mocked commerceSyntheticMocked commerce path; no revenue or conversion claim.
Runtime candidate corpus36 approved catalog records · 325 generated retrieval chunksSyntheticCatalog scale only; not production traffic scale.

Explicit boundaries

What this public surface does not claim.

No medical diagnosis or treatment authorityNo production customer conversations or raw logsNo private client identity or commercial internalsNo unsupported traffic, conversion, or revenue claimsDisplayed commerce values are representative snapshots, not current prices

Disclosure

Public enough to inspect. Private enough to respect the commercial boundary.

SHOWN

Product behavior

Sanitized conversational flows, architecture boundaries, offline evaluation counts, catalog scale, and the distinction between model interpretation and deterministic authority.

WITHHELD

Commercial internals

Client identity, proprietary catalog dumps, credentials, production traces and customer conversations, private business rules, current prices, and any unsupported traffic, conversion, or revenue metrics.