ToolFixAI

Home / Technology

The boring stack is the feature.

Retrieval instead of memory. A deterministic rule where a wrong answer is dangerous. One database, no exotic infrastructure, and an acceptance test that blocks the release.

v1.0 — running Spring Boot 3.3 · Java 18 · MySQL 8 · Vue 3.5 · DashScope qwen-plus + text-embedding-v2 · Manifest V3 extension.

Architecture

Four parts, one database.

A conventional front-end/back-end platform: a Java service exposing REST and STOMP, two independently deployed Vue applications, and a browser extension that talks to the same API.

Buyer
H5 chat page — token link, no authEN · ZH · ES · JAphotos + guide pages
Edge / client
Vue 3.5 + Vite 5 buyer appVue 3.5 + Vite 5 merchant consoleChrome MV3 workbench
Service
Spring Boot 3.3 · MyBatis-PlusREST APISTOMP over WebSocketJWT filter · BCrypt
Domain
session state machineretrieval & prompt assemblysafety tripwireparsing jobs
Data & AI
MySQL 8 — 7 tables, vectors as JSONPDFBox + Tesseract OCRDashScope qwen-plustext-embedding-v2 · 1536d

No vector database

Embeddings are stored as JSON rows in MySQL and scored in the service layer. At the corpus sizes a merchant actually has — tens of documents, not millions — this is faster to operate and cheaper to run than a second piece of infrastructure.

One deployable unit

JDK 18, Node 18 and MySQL 8. OCR engages only for scanned manuals, so the base footprint stays small enough to run on a single mid-size instance.

Two independent front-ends

The buyer page can sit on its own domain, in the merchant’s branding, without the console being exposed. Both are static builds.

Architecture as deployed for the MVP; component choices are documented in the PRD and visible in the running build.

Retrieval pipeline

From a 40-page PDF to an answer in four seconds.

Every stage exists because of a failure we saw: manuals that lost their steps, model names that collided, buyer phrasing that no manual would ever match.

01 · Extraction
PDF text layer via PDFBox. If the layer is empty or missing, the page is rasterised and passed to Tesseract with Chinese and English data files. Extracted text is normalised for line-break hyphenation and table junk.
02 · Chunking
800-character sliding windows with 100-character overlap, paragraph-priority: a numbered step is kept whole wherever possible, because half a step is worse than none.
03 · Anticipated questions
Twelve questions per document, generated across six angles — warranty, repair, returns, process, timing, cost — embedded separately so a colloquial buyer question finds the manual even when the manual never phrases it that way.
04 · Model tagging
Documents carry product-model tags. A question that names a model narrows the candidate set before similarity is computed, which removes cross-SKU contamination.
05 · Retrieval
Cosine similarity over the filtered chunks; threshold 0.5, top 5. Keyword and model matching run as fallback; results are merged and de-duplicated by chunk id.
06 · Assembly
The prompt carries the merchant’s role definition, the buyer question and the retrieved chunks with their source document. The model is instructed to answer from those chunks only.
07 · Fallback
If nothing clears the threshold, or the model flags insufficient grounding, the merchant’s pre-written fallback script is sent — or the session escalates. The system does not free-form.
Grounded answers
Retrieval and answer assembly in the console.

Chunk size

800 chars · 100 overlap

Vectors

1536 dimensions

Threshold

cosine ≥ 0.5 · top 5

Per document

+12 anticipated questions

Fallback

merchant script, else escalate

Deterministic layer

The safety check does not run in the model.

Keyword matching runs before and after every round, outside the LLM. A prompt can be injected; a keyword table cannot be argued with.

The rule

Trigger set
smoke · fire · spark · burnt · electric shock · shock · swollen / bulging battery · leaking · injury · bleeding · exposed wire · water ingress · cracked disc
Match
Normalised against buyer text in the session language, plus image captions and structured symptom fields.
Action
Diagnosis halts, a safety notice replaces the guide page, the session moves to human hand-over with a high-priority flag.
Audit
Every trip is logged with the matched term and the transcript up to that point, so a false positive is diagnosable.

Data model

Seven tables. Nothing clever.

The schema is small enough to reason about in an afternoon and small enough to hand to a security reviewer without a diagram.

TableWhat it holds
merchantsTenant, brand profile, AI role prompt, fallback script, plan and quota state.
verification_codesEmail codes for registration and password reset, with expiry and attempt counters.
documentsSource manual, model tags, extracted summary, parsing status, chunk count.
chunksText, embedding vector (JSON), source offsets, keyword index terms.
customersName, product and order number behind a token link. No account, no password.
messagesEvery turn — buyer, AI or human — with role, timestamp, confidence and safety flags.
refresh_tokensHashed refresh tokens with rotation and revocation, 7-day lifetime.
Multi-tenancy

Every document, chunk, customer and message carries a merchant id. Cross-tenant reads are rejected in the service layer, not left to query discipline.

Retention

Sessions are retained for the merchant’s review. Buyer personal data is limited to what the link was issued with, and deletion requests cascade from the customer row.

Security

Designed for a buyer who never logs in.

The hardest security problem in this product is that buyers have no credentials. The answer is a token that is unguessable, scoped to one order and useless everywhere else.

Token links

High-entropy per-customer tokens bound to one product and order. No enumeration surface, no session list to leak.

Merchant auth

JWT access tokens with a 2-hour lifetime, rotating 7-day refresh tokens, BCrypt password hashing, email verification on sign-up.

Transport

TLS everywhere; authenticated STOMP channels for merchants, anonymous but session-scoped channels for buyers, so an agent joins a room rather than intercepting a stream.

Secrets

Database credentials, DashScope keys and mail credentials are injected as environment variables — never committed, never in an image layer.

Third-party AI

Only the retrieved chunks, the merchant’s role prompt and the buyer question are sent to the model. No buyer identity, no order number, no full transcript.

Audit

Every message and verdict is stored against the session. Safety trips, handovers and confidence scores are queryable after the fact.

Unit economics of a session

Pennies per diagnosis, logged per call.

A five-round session costs roughly ¥0.3–0.8 in model and hosting spend at current pricing. Every call records tokens and fees, so the model cost is a measured line item rather than an assumption.

Checked monthly against cost models at 1,000 / 5,000 / 20,000 sessions per month. The dominant cost risk is onboarding labour, not inference — which is what the pilot fee covers and what better parsing reduces over time.

VolumeMonthly AI spend (est.)Cost per sessionOverage rate
1,000 sessions¥300–800¥0.30–0.80¥0.45–0.80
5,000 sessions¥1,500–4,000¥0.30–0.80¥0.45–0.80
20,000 sessions¥6,000–16,000¥0.30–0.80¥0.45–0.80

Estimates from the business plan’s cost model; actuals are logged per call in the running system. Overage rates differ by plan.

Release gate

Pass or fail, not impressions.

Before any commercial pilot, the deployed system must complete all four checks against one real Shopify store. These are the same checks used to accept the MVP.

GATE 01

End-to-end loop

A buyer moves from order link to AI diagnosis to interception or hand-over, and the seller sees the full record.

GATE 02

Scripted faults

All 15–20 scripted real-world fault scenarios produce the expected AI verdict.

GATE 03

Safety

Every high-risk test case escalates to a human. Zero exceptions logged.

GATE 04

Seller console

Each session is fully visible — transcript, images, verdict, confidence and buyer feedback.

From the demo acceptance section of the business plan. The scripted fault library doubles as a regression suite.

Stack

Chosen to be operable by two people.

Every technology here has a large hiring pool, boring failure modes and a single well-documented way to run it. That is a deliberate trade against novelty.

LayerChoice
ServiceSpring Boot 3.3, Java 18, MyBatis-Plus
RealtimeSTOMP over WebSocket, authenticated channels
DatabaseMySQL 8 — seven tables, vector JSON
AIAlibaba DashScope — qwen-plus, text-embedding-v2 (1536d)
DocumentsPDFBox text extraction, Tesseract OCR (zh + en)
Front-endVue 3.5, Vite 5, Element Plus (console)
ExtensionChrome Manifest V3, v0.2.0
RuntimeJDK 18, Node 18, MySQL 8 — single instance

Roadmap

Sequence matters more than scope.

Each phase is unlocked by evidence from the previous one, not by ambition. Connectors come after retention, not before it.

Shipped

Phase 1 — now

One live Shopify store, end-to-end loop, preset knowledge base of ~15 high-frequency fake-fault scenarios, English buyer interface.

Planned

Phase 2

Subscription billing, multi-tenant onboarding, ROI dashboard, buyer-side multilingual expansion.

Planned

Phase 3

Amazon and WooCommerce connectors, parts and accessories recommendation, RMA workflow integration.

Ask us the hard technical question.

Retrieval quality, OCR accuracy on a bad scan, safety false positives, data residency — these are the questions a pilot should answer, and we would rather answer them before you sign.