One-Sentence Ride-Hailing: HuoLaLa's WeChat Mini-Program AI Ordering Architecture
HuoLaLa details its implementation of AI-powered one-sentence ride-hailing in WeChat Mini-Program, covering the shift from GUI to MCP mode, seven atomic capabilities, Handoff mechanism for transaction safety, independent sub-package architecture, three-layer testing strategy, boundary constraints to prevent hallucination, and a dual-track approach with a self-developed AI assistant.
Problem: Complex Ordering Flow
HuoLaLa offers 30+ vehicle types and diverse services. The traditional flow requires users to find entry, select business, fill pickup/drop-off addresses, choose vehicle, fill cargo, select time, read agreements, and place orders — a process easy for frequent users but like a training course for infrequent ones. The goal: let users say one sentence (e.g., "send a bicycle to Shangmeilin Metro Station, how much?") and have AI extract parameters (pickup, drop-off, vehicle, time, cargo) and only ask for clarification when ambiguous, then hand off to the mini-program for payment confirmation.
WeChat AI Capabilities: Three Modes
GUI Mode: AI Clicks Like a Human
AI operates the UI: opens mini-program, recognizes pages, clicks buttons, fills forms, reads results. Quick to integrate but fragile: a promo popup blocks clicks; addresses need map selection and disambiguation; vehicle/price depend on city, route, config — not readable from page text; single utterances rarely fill all fields, and UI automation cannot maintain multi-turn context. Page changes break the chain.
MCP Mode: Capabilities as Callable Tools
WeChat provides an intelligent runtime and framework. Developers abstract mini-program functions into atomic interfaces and components, then wrap them as Skills. When users converse with the Mini-Program AI, it analyzes via the MCP protocol, selects appropriate atomic interfaces/components, processes data, executes tasks, and returns integrated results. MCP is the protocol and runtime; Skill is the business capability encapsulation — a "menu + operating procedures for AI" defining what can be done, required inputs, what must not be guessed, and how results are delivered. WeChat handles dialogue entry and tool dispatch; HuoLaLa handles addresses, vehicles, pricing, orders. Prices come from business APIs, not model generation; order status is not guessed. AI shifts from "clicking screens for users" to "calling services for users."
Handoff Mechanism: Return to Native Page
AI excels at intent understanding and information gathering, but confirmation, agreements, and payment require stable, traceable product UI. Handoff is the baton: AI completes the first half in dialogue, passes address, vehicle, notes, time, and scenario to the mini-program; the mini-program receives and finishes the second half via native confirmation page. The key is passing the user's expressed context — otherwise the AI experience is wasted. The flow: WeChat AI dialogue → HuoLaLa Skill → real business results + Handoff card → user clicks → mini-program receives context → native confirmation page recalculates and pays. The confirmation page re-calculates price; it does not trust the dialogue number because city config, vehicle availability, or pricing conditions may have changed in the intervening minutes. Consistency over seamlessness.
HuoLaLa's Integration with WeChat AI
Seven Atomic Capabilities
Freight ordering has many paths (intracity, cross-city, moving, errands) with dozens of flows. Users only say "send bicycle to Shangmeilin." From these flows, seven freely composable atomic capabilities were extracted:
Query Vehicle: Answers "what vehicle for a bicycle" — returns only currently available vehicles in the city.
Parse Address: Converts colloquial names like "Shangmeilin Metro Station" into structured address and coordinates.
Estimate Price: Returns estimated price based on real address, vehicle, and business config.
Query Order Detail: Uniquely matches "that order to Shangmeilin" then fetches details.
Query Order List: Returns recent order summaries for further filtering.
Reorder: Reuses historical info, re-enters estimation and confirmation flow.
Cancel Order: Executes only after explicit user confirmation.
Login is handled by Skill runtime middleware, not in the seven. The model only manages business intent: prompts for login when needed, ends the current call. When users change mid-conversation ("switch to Yufeng and quote again"), confirmed addresses are retained; only vehicle changes and re-estimation occur.
Skill Internal Architecture
Three intelligent-agent contracts constrain model behavior; runtime middleware unifies login and security; seven atomic APIs fetch only from real business systems; results undergo structured output, auto-continue calls, or Handoff delivery. Contracts: AGENTS.md governs capability boundaries; SKILL.md governs orchestration and rules; mcp.json governs tool contracts.
Boundary Delineation: WeChat Handles Dialogue, HuoLaLa Handles Ordering
Full chain: WeChat AI dialogue → HuoLaLa Skill → real business results + Handoff card → user clicks → mini-program receives context → native confirmation page recalculates and pays. WeChat responsible for understanding and dispatch; HuoLaLa for business, rules, and transactions. Price not generated by model; cannot bypass confirmation page for payment.
Implementation: Independent Sub-package, Not in Main Flow
WeChat runtime at top (dialogue + dispatch); Skill independent sub-package in middle (translates business capabilities to tools); HuoLaLa main package and business APIs at bottom (ordering + transactions). Sub-package only reads business APIs, no reverse dependency on order pages. Skill code in src/skills with own runtime and requests, independent of main package. AI code iterations never touch original order pages. Main package only reads handed-off context when user opens the Handoff card. Cross-cutting concerns (login, signature, security guards) centralized in runtime middleware; business code untouched. Constraints encoded in three contracts. Minimal data bridge between sub-package and main package: only login state, handoff context (address, vehicle, notes, time), and order draft usable by confirmation page. Confirmation page consumes and clears; if user leaves without confirming, handoff page also clears. Next quote starts fresh — no cross-session pollution.
Testing Strategy: Three Layers
WeChat Automated Evaluation: Developer tools auto-run evaluations to verify tool selection, Handoff, and boundary enforcement.
Self-Test Cases: 59 colloquial utterances collected, categorized by address, vehicle selection, pricing, order query, reorder, cancellation, rejection.
Internal Crowd Testing: Colleagues use their own phrasing to hail rides, observing whether model fills missing services, times, prices.
Case value lies not in quantity but in answering: how else might real users express? Where is the model most likely to hallucinate? WeChat runs evaluation on collected cases, verifying end-to-end Skill flow. Crowd-test issues recorded and triaged: model issue or Skill issue.
Optimization: Guarding Boundaries
Crowd-test issues mostly involve model stating unoccurred events as facts. Optimization follows cases: behavior → root cause → constraint that blocks it. Typical case: user asks vehicle for mattress, sofa, fridge; model infers medium truck length 3.8–4.3m; interface returns 3.9–4.3m. Cause: model used common knowledge to supplement a number not in the interface. Fix: add constraint — when stating dimensions, only repeat interface return verbatim, no "about", "approx", "±". Constraints documented in Agent description, Skill, and tool descriptions, consolidated into four rules.
Self-Developed AI Assistant: Dual-Track Approach
Two Parallel Routes
Track 1: WeChat AI. Dialogue in WeChat's platform agent; user may not even open HuoLaLa mini-program first. XiaoWei understands intent, calls HuoLaLa Skill, Handoffs back to mini-program for transaction. Channel-oriented: demand occurs before user arrives. Track 2: Self-developed AI Assistant. Dialogue inside HuoLaLa mini-program; model orchestration, streaming messages, address cards, pricing cards, ordering, payment all controlled by HuoLaLa. Product-oriented: deeper experience after user enters. Both solve the same problem from different positions. Key question: can underlying capabilities be reused? Can channel differences be isolated?
Five-Layer Architecture
Self-developed assistant lives in the mini-program as a complete conversational product: frontend consumes streaming gateway for text, address candidates, pricing cards, order actions; backend agent orchestration service manages model and tool dispatch; mini-program continues to reuse real business APIs for real-name, agreements, ordering, cashier. Layers: (1) Frontend — streaming gateway, not direct model calls; (2) Agent Orchestration — model + tool scheduling; (3) Business Tools — atomic capabilities; (4) Transaction — real-name, agreements, ordering, cashier; (5) Data/State — conversation, session, business state. Comparison table (see image) shows self-developed defaults to in-AI-page completion of agreement, real-name, order, payment, with fallback to new standard confirmation page; WeChat AI currently must return to mini-program confirmation page for transaction. Both guard the same bottom line: model handles understanding and orchestration; business system handles ordering and transactions.
Interaction Advantages of Self-Developed
Streaming display of answers and progress; user can stop generation anytime.
Ambiguous addresses → direct POI candidates, or reopen map to reselect.
Pricing result not plain text but interactive order card.
Supports photo-based vehicle selection, image attachments, quick commands.
Historical sessions, session recovery, "continue last order".
When conditions met, complete agreement, real-name, order, payment within AI page; result returns to conversation.
WeChat AI advantage: user doesn't need to enter HuoLaLa first; platform sits where demand originates, trading partial UI control for an earlier traffic entry.
Industry Common Practices
Service-type AI assistants converging on shared patterns. DiDi's AI ride-hailing is an example: connecting "say where to go" to real pricing and dispatch. Architecture reflects these practices: AI assistant becoming a new service orchestration layer, not just a smarter search box.
Summary and Thoughts
Traffic Side: New Channel Opportunity
Past growth entries required users to remember brand, find mini-program. Agent entry reverses order: user states need first, platform matches. For strong-intent scenarios like ride-hailing, this is a new demand-capture opportunity. The moment user says "help me send a bicycle to Shangmeilin", demand is established. Whoever is accurately understood, reliably invoked, and can catch the transaction gets the increment. Channel dividend requires not just "integration" but clear capabilities, trustworthy results, safe boundaries. Enterprises must design capabilities for Agents, not just pages for humans.
Product Side: Beyond Ride-Hailing
Starting with four scenarios — ride-hailing, pricing, order query, cancellation — because they share: one sentence clarifies, real-time data computes, path leads to payment. These four share the same chain: user speaks → AI structures demand → calls real business tools → returns to native page for closure. Once chain works, adding a business barely changes the pattern. Examples: Shipping — "3 boxes from warehouse to Tianhe store, arrive before off-work" → AI computes vehicle/price, order data syncs to confirmation page. Moving — "one-bedroom, fridge and washer, Saturday move" → AI asks floor/elevator, then quotes vehicle and moving fee. Expansion relies on further decomposing business into small tools with clear boundaries, trustworthy results, composability. Adding scenes = adding tools; stuffing all into one big assistant increases loss of control.
Architecture: Adapting to Channel Changes
Channels will change: today WeChat XiaoWei, tomorrow other system-level agents; self-developed interactions will keep evolving. Copying address, vehicle, pricing, order logic per entry causes divergence. Answer: core capability reuse, channel adaptation decoupled, transaction loop returns to native. Three-layer evolution architecture (see image): top — agent adaptation layer (WeChat Skill, self-developed streaming, future agents each adapt); middle — unified orchestration & governance (reusing business semantics and real data); bottom — core business layer (reusing address, vehicle, pricing, order, login, security rules, agnostic to entry source) and experience & transaction layer (reusing confirmation page, agreements, real-name, cashier, order detail; conversational UI and channel cards evolve separately). This structure enables actively embracing new platform entries without binding core business to any single platform; reusing mature transaction capabilities while leaving room for self-developed experience innovation.
"XiaoWei, XiaoWei, help me call a HuoLaLa, send my bicycle to Shangmeilin Metro Station, I'll ride along."
Sounds like just fewer screen taps, but behind it service entry, product form, and technical architecture are changing together. For those who can no longer ride, it saves a real stretch of road.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
