Retail Knowledge — Q&A Engine
Overview
This skill answers questions using the store's configured knowledge base.
It is the foundational skill for all retail digital employee roles.
Depends on: Knowledge base populated via retail-agent-setup Step 03.
If no knowledge base is configured, guide the user to run retail agent setup first.
Query Routing
When a question arrives, classify it and route to the correct knowledge domain:
| Query Type | Keywords | Knowledge Domain |
|---|
| Product info | 产品/商品/成分/规格/面料/尺寸/功效 | INLINECODE2 |
| Policy |
退货/换货/退款/保修/三包/质保 |
policies |
| Promotion | 活动/优惠/折扣/满减/赠品/促销 |
promotions |
| FAQ | 怎么/如何/可以/能否/多久 |
faqs |
| Store info | 地址/营业时间/几点/电话/停车 |
store_info |
| Membership | 积分/会员/等级/VIP/余额 |
membership |
| Recommendation | 推荐/适合/送礼/比较/哪个好 | → hand off to
product-recommender skill |
| Inventory | 有没有/还有/库存/现货 | → hand off to
inventory-query skill |
| Complaint | 坏了/质量问题/投诉/要退 | → hand off to
complaint-handler skill |
Answer Construction Rules
Rule 1: Always ground answers in the knowledge base
Never invent product specs, policy terms, or promotion details.
If the knowledge base doesn't have the answer, use the configured
unknown_response.
Rule 2: Be specific
Bad: "我们有退货政策"
Good: "购买后7天内,商品未使用且保留吊牌,可申请无理由退货。退款将在3个工作日内到账。"
Rule 3: Cite conditions when relevant
For policies and promotions, always mention key conditions and exceptions.
Example: "满300减50,不与其他优惠叠加,促销商品除外。"
Rule 4: Match persona tone
Apply the configured
persona_config (name, tone, address form, emoji usage).
Reference: answer-style-guide.md
Rule 5: Handle unknowns gracefully
If no matching knowledge base entry exists:
- 1. Say so honestly (use configured
unknown_response) - Offer an alternative: escalate, or suggest the user contact staff
- Log the query internally for Step 12 gap digest
Never say "I don't know" bluntly — soften it while staying honest.
Multi-Turn Conversation
Maintain context across turns within a session:
- - Remember what product was mentioned earlier ("那款" / "刚才说的那个")
- Remember stated preferences ("她喜欢素色" → filter subsequent answers)
- If user backtracks or changes topic, reset context gracefully
Reference: conversation-patterns.md
Knowledge Base Structure
Expect the knowledge base (populated by retail-agent-setup) in this format:
CODEBLOCK0
Reference: kb-schema.md — full schema with field descriptions.
Fallback Behavior
If the knowledge base is empty or missing a domain:
| Missing Domain | Fallback Response |
|---|
| No products | "我们的商品信息正在整理中,请联系店员了解详情。" |
| No policies |
"退换货政策请联系门店工作人员确认。" |
| No promotions | "目前暂无特别优惠活动,欢迎关注我们的公众号获取最新信息。" |
| No store info | Escalate to configured L1 contact |
Script: Knowledge Base Search
Use scripts/kb_search.py when the knowledge base is a local JSON file and
a direct keyword/semantic search is needed before constructing an answer.
Reference: search-strategy.md — when to use exact
match vs. fuzzy match vs. LLM synthesis.
零售知识 — 问答引擎
概述
该技能利用门店配置的知识库回答用户问题。
它是所有零售数字员工角色的基础技能。
依赖项: 通过 retail-agent-setup 步骤03填充的知识库。
如果未配置知识库,请引导用户先运行 retail agent setup。
查询路由
当收到问题时,进行分类并路由至正确的知识领域:
| 查询类型 | 关键词 | 知识领域 |
|---|
| 产品信息 | 产品/商品/成分/规格/面料/尺寸/功效 | products |
| 政策 |
退货/换货/退款/保修/三包/质保 | policies |
| 促销 | 活动/优惠/折扣/满减/赠品/促销 | promotions |
| 常见问题 | 怎么/如何/可以/能否/多久 | faqs |
| 门店信息 | 地址/营业时间/几点/电话/停车 | store_info |
| 会员 | 积分/会员/等级/VIP/余额 | membership |
| 推荐 | 推荐/适合/送礼/比较/哪个好 | → 转交至 product-recommender 技能 |
| 库存 | 有没有/还有/库存/现货 | → 转交至 inventory-query 技能 |
| 投诉 | 坏了/质量问题/投诉/要退 | → 转交至 complaint-handler 技能 |
回答构建规则
规则1:始终以知识库为依据
不得编造产品规格、政策条款或促销详情。
如果知识库中没有答案,请使用配置的 unknown_response。
规则2:具体明确
错误示例:我们有退货政策
正确示例:购买后7天内,商品未使用且保留吊牌,可申请无理由退货。退款将在3个工作日内到账。
规则3:相关时注明条件
对于政策和促销,务必提及关键条件和例外情况。
示例:满300减50,不与其他优惠叠加,促销商品除外。
规则4:匹配角色语气
应用配置的 persona_config(名称、语气、称呼方式、表情符号使用)。
参考: answer-style-guide.md
规则5:妥善处理未知情况
如果知识库中没有匹配条目:
- 1. 如实告知(使用配置的 unknown_response)
- 提供替代方案:升级处理,或建议用户联系工作人员
- 内部记录该查询,用于步骤12的差距分析
切勿生硬地说我不知道——在保持诚实的同时委婉表达。
多轮对话
在会话中保持上下文连贯:
- - 记住之前提到的产品(那款 / 刚才说的那个)
- 记住已表达的偏好(她喜欢素色 → 过滤后续回答)
- 如果用户改变话题或回溯,优雅地重置上下文
参考: conversation-patterns.md
知识库结构
知识库(由 retail-agent-setup 填充)的预期格式如下:
json
{
products: [ { sku: ..., name: ..., description: ..., ... } ],
policyentries: [ { policyid: ..., title: ..., full_text: ..., ... } ],
promotions: [ { promo_id: ..., title: ..., rules: ..., ... } ],
faqs: [ { faq_id: ..., question: ..., answer: ..., ... } ],
store_info: { name: ..., address: ..., hours: ..., phone: ... },
membership: { levels: [...], pointsrules: ..., querymethod: ... }
}
参考: kb-schema.md — 包含字段描述的完整模式。
降级处理
如果知识库为空或缺少某个领域:
| 缺失领域 | 降级回复 |
|---|
| 无产品 | 我们的商品信息正在整理中,请联系店员了解详情。 |
| 无政策 |
退换货政策请联系门店工作人员确认。 |
| 无促销 | 目前暂无特别优惠活动,欢迎关注我们的公众号获取最新信息。 |
| 无门店信息 | 升级至配置的一级联系人 |
脚本:知识库搜索
当知识库为本地JSON文件,且在构建回答前需要进行直接关键词/语义搜索时,使用 scripts/kb_search.py。
参考: search-strategy.md — 何时使用精确匹配、模糊匹配或LLM综合处理。