Artificial Intelligence 22 min read

Design and Implementation of the Logistics Intelligent Robot “Yunli XiaoZhi” Powered by Large Language Models

The article details the development of Yunli XiaoZhi, an AI‑driven logistics chatbot that combines knowledge‑base Q&A, data‑analysis, proactive alerts and report‑pushing to streamline SOP access, reduce manual query effort, and improve operational efficiency for operators, carriers and drivers.

JD Tech
JD Tech
JD Tech
Design and Implementation of the Logistics Intelligent Robot “Yunli XiaoZhi” Powered by Large Language Models

The document presents the design and deployment of "Yunli XiaoZhi," an intelligent robot for logistics (运力) that leverages large language models to provide a unified, portable knowledge‑base and data‑analysis platform for internal operators, carriers, and drivers.

Current pain points include scattered SOPs and manuals, time‑consuming manual queries, lack of a unified search portal, no mobile access, and repetitive troubleshooting for common system issues.

To address these issues, the robot integrates intelligent Q&A, proactive warning, indicator queries, trajectory tracking, driving‑license image lookup, report push, and information push, all accessible via a single entry point on PC or mobile.

Technically, MCube evaluates template cache status, loads templates, converts them to a view‑tree, and uses an expression engine and event engine to render the UI. Knowledge bases are built from QA pairs and document ingestion, transformed into vectors and stored in the Vearch vector database. PDF parsing extracts structured text and tables, improving downstream knowledge quality.

{
    "metadata": {"footers": [], "headers": [], "catalogs": []},
    "chapters": {"1": "[CHAPTER_ROOT]", "1.1": "第一条 xxx", "1.2": "第二条 xxxx", "1.3": "第三条 xxxx"},
    "context": [{"text": "JDLxxxx规定", "type": "text", "pid": 1, "sid": 1, "metadata": {"section_range": []}, "cid": "1"}, ...]
}

The knowledge‑QA component uses LangChain and the company’s LLM API to implement a Retrieval‑Augmented Generation (RAG) system. A condense‑question chain rewrites follow‑up queries for better similarity matching. Example Python code:

from langchain import PromptTemplate
from langchain.chains import LLMChain
from langchain.chat_models import ChatOpenAI

def get_condense_question_chain(self):
    """精简问题链"""
    CONDENSE_QUESTION_PROMPT = PromptTemplate.from_template(
        """给定历史对话和一个后续问题,将后续问题改写为一个标准问题,用其原始语言,确保避免使用任何不清晰的代词。\n历史对话:{chat_history}\n后续输入: {question}\n标准问题:"""
    )
    condense_question_chain = LLMChain(
        llm=ChatOpenAI(model="", temperature="", openai_api_key="", openai_api_base=""),
        prompt=CONDENSE_QUESTION_PROMPT,
    )
    return condense_question_chain

For data analysis, a NoETL logical‑model asset framework automatically generates multi‑dimensional metric models from metadata. Model metadata is stored as JSON, for example:

{
    "uid": "742250d1dd9f457aa",
    "name": "离线_低装载线路占比_日_3",
    "nodes": [{"id": "98579cdb14b44423ace0", "data": {"viewUid": "e246257e141e4fe78", "viewSql": "SELECT dt, trans_type_new_name AS trans_type_name , ..."}, "type": "fact"}],
    "where": "trans_type_name <> '全部' AND transport_org_name <> '全部' ...",
    "measures": [{"id": 99, "names": ["低装载线路占比"], "sql": "SUM(low_loading_plink_cnt)/SUM(plink_cnt)", "type": "float", "format": "percentage", "sort": 1}],
    "dimensions": [{"id": 1, "names": ["区域"], "field": "transport_org_name", "type": "str", "format": "text", "description": "区域"}],
    "timeSeries": [{"id": 1, "names": ["日", "日期", "天"], "field": "dt", "type": "yyyy-mm-dd", "format": "date"}],
    "operator": "liuyanchen9",
    "updatedAt": 1714112126
}

Features are organized into six modules: (1) Indicator query via natural‑language prompts, (2) Knowledge Q&A covering SOPs, system guides, and dashboards, (3) Trajectory query by dispatch order number, (4) Driving‑license image lookup by license plate, (5) Report push with scheduled and alert‑based delivery, and (6) General information push such as weekly announcements and surveys.

Operational metrics show 50‑100 weekly active users, over 500 queries per week, and a reduction of query time from 2‑3 minutes to under one minute for trajectory and license‑plate lookups. Success rates are around 70% for data‑analysis queries and 50% for knowledge‑Q&A after user familiarisation.

The roadmap for Q2 includes expanding proactive announcement push, adding high‑frequency scenario queries (e.g., flight schedules), refining metric granularity, improving semantic understanding through user guidance and model training, and enhancing stability of data‑query services.

RAGvector databasedata analysisKnowledge Baselarge language modelAI chatbotlogistics operations
JD Tech
Written by

JD Tech

Official JD technology sharing platform. All the cutting‑edge JD tech, innovative insights, and open‑source solutions you’re looking for, all in one place.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.