Skip to content

Jev Practices & Patterns

E-commerce: catalog classification, fraud, and returns

Catalog classification, fraud, and returns are high-volume decisions. How e-commerce teams use typed answers to route work.
Published
Category
Jev Practices & Patterns
Resources cited
8
Reading time
6 min
Tags#ecommerce#classification#fraud#returns

An e-commerce operation is a chain of small decisions: what this product is, what this customer wants, whether this order is risky, whether this pick is correct, and whether this interface is manipulating someone. Each one is narrow enough to evaluate, and each has a different cost of being wrong.

Catalog classification with a closed candidate set

Jev Kıyafet Bul turns a clothing request into a structured search. One Jev call reads the request: scope, type, length and color as Choice, plus belt, hood, waterproof and budget as Noul. Code narrows the catalog to at most 60 candidates, Jev scores matches in batches of 10, and ranking is score times confidence, top 12. When out-of-catalog confidence reaches 0.5, scoring is skipped and the app returns an empty result with an explanation.

The scope gate is the important design choice. A system that always returns 12 products will always look helpful and will sometimes be wrong. This one has an explicit abstain path, and a side panel replays each search step with real data so a developer can see what Jev decided score by score. Without a key the app runs on a deterministic fake, and tests run against the fake. The roughly 300 ms median latency is the author's own video measurement, the architecture is not disclosed, and the captured README truncates before the data-prep scripts.

Jev NAICS is the industrial version of the same pattern: classify a business description into one of 1,012 industries or hold it. It used 56 Jev calls for 16 blind descriptions where a tree walk alone used 84, and it measured 15 right and 1 held with zero wrong codes across its blind, dev and messy-dev sets. The README warns that its eval sets are small and synthetic and that the dataset's own labels were wrong for 18 of 60 descriptions. Fail-closed behavior is the claim, not production accuracy.

Intent routing is the first support decision

Adaptive-RAG switches only the intent node of a LangGraph workflow to Jev. Jev returns labels, confidence and class probabilities for 14 business intents, with Pydantic validation and a rule overlay, while the rest of the workflow stays on DeepSeek and a Jev failure falls back to the original classifier. Hybrid retrieval fuses BM25 and dense vectors with reciprocal rank fusion and optional BGE cross-encoder reranking, using 500-character text windows.

The demo is local-first and in Chinese, with SQLite and in-memory retrieval by default and PostgreSQL, Redis and Qdrant in Docker Compose. Orders and logistics are demo data, the API accepts a client-supplied user_id without trusted authentication, and the README says identity, TLS and persistence work are needed before public deployment. The useful part is the seam: one node can be swapped and evaluated without rewriting the agent, which is the same argument the retrieval with decisions piece makes.

The escalation gate is the product decision

ecom-cs-agent makes the gate explicit. One Jev call answers two typed questions per turn: the customer's primary intent among nine labels, and a Noul needs_human probability. The gate escalates on low confidence, with sensitive intents using a threshold plus 0.1, on a human-required intent, or when needs_human is at least 0.5. The LLM never runs in those cases. Network, rate-limit or format failures always escalate to a human, and the direct HTTP judge retries 429 and 529 with exponential backoff.

The repository ships 30 annotated conversations and four comparison arms: no judge layer, Jev judge, LLM self-reported confidence, and a three-way weighted fusion. That is the right experiment design, but the digest truncates inside the skills section, the repository lists no license, and the full results are not visible. Treat the architecture as the contribution and the comparison as unfinished.

The designing for rejection article is the general form: an abstain path is not a failure mode, it is the mechanism that makes the answered cases trustworthy.

Reviews are multi-label, not one score

The Smartphone Review Analyzer reads review text and detects which of seven topics it discusses, then rates satisfaction per topic with 14 Jev questions per review in one request. The topics are Camera, Battery, Display, Design, Performance, Build Quality and Value for Money. Satisfaction comes back on a continuous scale, for example 3.4 stars, rather than whole-star buckets, and a topic is rated only when the review actually mentions it, so there are no made-up ratings.

That last rule is a data-quality decision, not a modeling one. A missing rating is information: it says the reviewer did not discuss battery life, not that battery life is neutral. The project is four small modules with no framework, sample data is 50 reviews, and the captured README cuts off before the question wording and any accuracy checks. No license is listed, so reuse terms are unclear.

Returns and pick verification

Pick Verify adds a description-level judgment on top of a scan code to catch confusable picks. It returns accept or re-scan and never commands robot motion, which stays in the controller. It reports a 96 ms median against a 150 ms scan-cycle budget on a 5,000-pick replay, and it ships the confusable pairs it is meant to catch as part of the labeled replay.

The boundary is the point: this is a station-level verification aid beside an existing control loop, not a motion controller. It should be evaluated on the included replay before it gates live picks. The same restraint appears in the confidence gates in production discussion, where a model decision is allowed to route but not to perform an irreversible action.

Dark patterns and the risk of overreach

UXRay is a dark-pattern heads-up display that runs as an Android accessibility service. Its confidence bands are explicit: 0.9 and above shows a floating badge naming the pattern, 0.6 to 0.9 writes a quiet review log entry, and below 0.6 is discarded. The service never sends password-field values and skips the scan entirely on screens that look like card or PIN entry. Session stats, screens scanned, median latency and cost from input tokens at $0.042 per million input tokens, stay in memory.

The caveats are the story: the metadata lists no license, the test plan is manual and targets Indian shopping and food-delivery apps, and no accuracy or latency benchmarks are published beyond in-memory session stats. A dark-pattern detector that flags a legitimate checkout is a real cost to a merchant, so the 0.6 discard band and the human review path are not optional extras.

The rejection option and RAG passage classification entries cover the two mechanics that recur here: a closed answer set needs a way to say none, and a retrieved passage needs independent judgments for relevance and injection. The use-case map lists retail and customer support among its example domains, not as shipped products.

What ties the e-commerce cases together is that the model never owns the catalog, the order or the refund. It owns a bounded label, and code owns the consequence. That is why a 96 ms pick check and a 300 ms clothing search can both be useful: they are fast enough to sit inside a workflow that already knows what to do with the answer.

From the Jev directory

The resources behind this article.

4GitHub stars
Turkish-language natural-language search over an outerwear catalog: Jev reads each request in one call and scores candidate matches, while code handles price and size regex, filtering, ranking and the results UI, with a side panel showing what Jev decided.
Jev Demos & Experiments#community#catalog-import#logicrw
0GitHub stars
jmurray10's MIT-licensed FastAPI service and library that classify business descriptions into one of 1,012 NAICS 2022 industries or hold them for a person, with Postgres search and code-owned gates doing the work and Jev only picking from a closed list.
Jev Tools & CLIs#community#naics#classification
A Chinese-language e-commerce customer-service demo on FastAPI, LangGraph and React: adaptive retrieval routing with hybrid BM25-plus-vector search, and intent classification switchable between TypeSafe Jev's structured choice interface and DeepSeek.
Jev Demos & Experiments#community#github#python
0GitHub stars
An e-commerce after-sales customer-service agent built on the learn-claude-code skeleton. Every turn asks Jev for the customer's intent with a confidence and a needs-human probability in one call, and a pure-code gate sends low-confidence cases to a human before the LLM runs.
Jev Agents & MCP#community#catalog-import#yibie
A Python first-project that turns messy free-text smartphone reviews into Flipkart-style per-topic star ratings, powered by Jev via the TypeSafe SDK: 14 questions per review (mention detection plus satisfaction) across 7 topics such as camera, battery and display.
Jev Demos & Experiments#community#github#python
A warehouse pick-verification step that compares a scanned item, the bin's expected contents, and the order line to decide between accept and re-scan, catching confusable picks a barcode alone would pass.
Jev Integrations & Adapters#community#python#robotics
Community
An Android heads-up display that reads visible on-screen text through an AccessibilityService, asks TypeSafe's Jev whether a manipulative UI pattern looks likely, and shows a floating badge above 0.9 confidence; password fields are never sent and card or PIN screens are skipped.
Jev Tools & CLIs#community#catalog-import#madewithjev
Explore TypeSafe use cases by industry and turn promising ideas into concrete software workflows.
Jev Practices & PatternsDocs#official#use-cases
Official
Back to all articles

Related Jev articles

Transaction monitoring, AML, and credit decisions need calibrated thresholds. How decision models fit a regulated finance stack.
Jev Practices & Patterns#finance#fraud#aml
Read article
Taxonomies are too large for one question. How to walk a hierarchy in code and ask the model only about the branch you are in.
Jev Cookbooks#classification#taxonomy#routing
Read article

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai