能力标签
💬
Prompt模板

客户支持聊天机器人

基于 Python · 专业级提示词模板,解锁 AI 的真实潜力
英文名:Customer-Support-Chatbot-102
⭐ 5 Stars 💻 Python 📄 MIT 🏷 AI 8.0分
8.0AI 综合评分
chatbotllmfine-tuning
✦ AI Skill Hub 推荐

AI Skill Hub 强烈推荐:客户支持聊天机器人 是一款优质的Prompt模板。AI 综合评分 8.0 分,在同类工具中表现稳健。如果你正在寻找可靠的Prompt模板解决方案,这是一个值得深入了解的选择。

📚 深度解析

客户支持聊天机器人 是经过精心设计和实践验证的专业 Prompt 模板。Prompt 工程(Prompt Engineering)是充分发挥 Claude、ChatGPT 等大型语言模型潜力的关键技能,而一套经过优化的 Prompt 模板可以将 AI 输出质量提升数倍。

优质 Prompt 模板的核心价值在于其结构化设计:明确的角色设定、精确的任务描述、具体的输出格式要求和必要的边界条件,这些要素共同构成了一个能够持续产出高质量结果的 Prompt 框架。客户支持聊天机器人 提供的模板经过反复迭代和用户验证,能够有效减少 AI 的"幻觉"(Hallucination)和输出不稳定问题。

无论你使用 Claude 3.5 Sonnet、GPT-4、Gemini 还是国内的文心一言、智谱 AI,优质的 Prompt 设计都能跨模型复用。AI Skill Hub 建议将本模板保存为个人 Prompt 库的标准组件,根据具体场景调整参数后反复使用,形成自己的 AI 提效工作流。

📋 工具概览

客户支持聊天机器人 是经过精心设计和反复验证的专业 Prompt 模板集合。这些 Prompt 框架能够有效激活 Claude、ChatGPT 等大型语言模型的深层能力,让 AI 生成更准确、更有价值的输出结果。无需任何安装,直接复制模板内容到 AI 对话框即可使用。

GitHub Stars
⭐ 5
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
MIT
AI 综合评分
8.0 分
工具类型
Prompt模板
Forks

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

客户支持聊天机器人 是经过精心设计和反复验证的专业 Prompt 模板集合。这些 Prompt 框架能够有效激活 Claude、ChatGPT 等大型语言模型的深层能力,让 AI 生成更准确、更有价值的输出结果。无需任何安装,直接复制模板内容到 AI 对话框即可使用。

📌 核心特色
  • 精心设计的 Prompt 框架,快速激活 AI 的深层能力
  • 支持参数化替换,灵活适配多种业务场景
  • 经过反复验证的指令结构,显著提升 AI 输出质量和一致性
  • 适用于 Claude、ChatGPT 等主流大语言模型
  • 可作为团队标准 Prompt 模板复用和二次开发
🎯 主要使用场景
  • 快速生成高质量的专业文案、分析报告或结构化内容
  • 利用 Prompt 框架引导 AI 解决特定领域的复杂问题
  • 在不同 AI 工具间复用经过验证的提示词模板
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# Prompt 无需安装,直接复制使用
# 支持:Claude / ChatGPT / Gemini / 通义千问 等主流模型

# 使用步骤
# 1. 复制 Prompt 模板内容
# 2. 粘贴到 AI 对话框
# 3. 替换 [占位符] 为实际内容
# 4. 发送后获取结构化输出

# 获取原始文件
git clone https://github.com/AdilShamim8/Customer-Support-Chatbot-102
📋 安装步骤说明
  1. 复制本工具的 Prompt 模板内容
  2. 打开 Claude、ChatGPT 或其他 AI 对话工具
  3. 将 Prompt 粘贴到对话框开头
  4. 根据实际需求替换 [占位符] 中的内容
  5. 发送后 AI 将按照模板格式执行,获得结构化输出
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 粘贴到 Claude/ChatGPT 使用
# 示例 Prompt 结构:

你是一位 [角色],擅长 [领域]。
请根据以下要求完成任务:

任务背景:[描述背景]
具体要求:[详细说明]
输出格式:[期望格式]

# 将 [] 内内容替换为实际需求
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# customer-support-chatbot-102 配置文件示例(config.yml)
app:
  name: "customer-support-chatbot-102"
  debug: false
  log_level: "INFO"

# 运行时指定配置文件
customer-support-chatbot-102 --config config.yml

# 或通过环境变量配置
export CUSTOMER_SUPPORT_CHATBOT_102_API_KEY="your-key"
export CUSTOMER_SUPPORT_CHATBOT_102_OUTPUT_DIR="./output"
📑 README 深度解析 真实文档 完整度 95/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

🌟 Overview

This system is a production-grade customer support chatbot that combines the power of Retrieval-Augmented Generation (RAG) with advanced prompt engineering and parameter-efficient fine-tuning (PEFT). It is designed to answer customer questions accurately by grounding responses in your own documentation — eliminating hallucinations and ensuring policy-compliant answers.

System Overview


┌─────────────────────────────────────────────────────────────────────┐
│                        CLIENT LAYER                                 │
│              Web App / Mobile / API Consumer                        │
└─────────────────────────┬───────────────────────────────────────────┘
                          │ HTTPS
                          ▼
┌─────────────────────────────────────────────────────────────────────┐
│                      FastAPI APPLICATION                            │
│  ┌─────────────┐  ┌──────────────┐  ┌────────────────────────────┐ │
│  │ Rate Limit  │  │   Request    │  │      CORS Middleware        │ │
│  │ Middleware  │  │   Logging    │  │                            │ │
│  └─────────────┘  └──────────────┘  └────────────────────────────┘ │
│                                                                     │
│  ┌─────────────┐  ┌──────────────┐  ┌────────────────────────────┐ │
│  │  /chat      │  │  /admin      │  │  /health /ready /live      │ │
│  │  /feedback  │  │  /documents  │  │  /metrics                  │ │
│  │  /stream    │  │  /evaluate   │  │                            │ │
│  └──────┬──────┘  └──────┬───────┘  └────────────────────────────┘ │
└─────────┼────────────────┼─────────────────────────────────────────┘
          │                │
          ▼                ▼
┌─────────────────────────────────────────────────────────────────────┐
│                       RAG PIPELINE                                  │
│                                                                     │
│  User Query                                                         │
│      │                                                              │
│      ▼                                                              │
│  ┌──────────────────────────────────────────────────────────────┐   │
│  │  1. CONVERSATION MANAGER                                     │   │
│  │     Load history → Redis / PostgreSQL                        │   │
│  └──────────────────────┬───────────────────────────────────────┘   │
│                         │                                           │
│  ┌──────────────────────▼───────────────────────────────────────┐   │
│  │  2. QUERY REFORMULATION (if conversational)                  │   │
│  │     "What about the fee?" → "What is the cancellation fee?"  │   │
│  └──────────────────────┬───────────────────────────────────────┘   │
│                         │                                           │
│  ┌──────────────────────▼───────────────────────────────────────┐   │
│  │  3. HYBRID RETRIEVAL                                         │   │
│  │                                                              │   │
│  │  ┌─────────────────┐      ┌──────────────────────┐          │   │
│  │  │  Vector Search  │      │   Keyword Search     │          │   │
│  │  │  (ChromaDB /    │      │   (BM25 /            │          │   │
│  │  │   FAISS /       │      │    Elasticsearch)    │          │   │
│  │  │   Pinecone)     │      │                      │          │   │
│  │  └────────┬────────┘      └──────────┬───────────┘          │   │
│  │           │                          │                       │   │
│  │           └────────────┬─────────────┘                       │   │
│  │                        ▼                                     │   │
│  │              RRF Fusion (rank merge)                         │   │
│  └──────────────────────┬───────────────────────────────────────┘   │
│                         │                                           │
│  ┌──────────────────────▼───────────────────────────────────────┐   │
│  │  4. RERANKING                                                │   │
│  │     Cohere / CrossEncoder / FlashRank                        │   │
│  │     top-10 → top-5                                           │   │
│  └──────────────────────┬───────────────────────────────────────┘   │
│                         │                                           │
│  ┌──────────────────────▼───────────────────────────────────────┐   │
│  │  5. PROMPT CONSTRUCTION                                      │   │
│  │     System prompt + Few-shot examples + Context + Query      │   │
│  │     Strategy: Zero-shot / Few-shot / CoT / Role-specific     │   │
│  └──────────────────────┬───────────────────────────────────────┘   │
│                         │                                           │
│  ┌──────────────────────▼───────────────────────────────────────┐   │
│  │  6. LLM GENERATION                                           │   │
│  │     OpenAI GPT-4o / Anthropic Claude 3                       │   │
│  │     Sync / Async / Streaming                                 │   │
│  └──────────────────────┬───────────────────────────────────────┘   │
│                         │                                           │
│  ┌──────────────────────▼───────────────────────────────────────┐   │
│  │  7. POST-PROCESSING                                          │   │
│  │     Citation footer + Hallucination check + Save history     │   │
│  └──────────────────────┬───────────────────────────────────────┘   │
│                         │                                           │
└─────────────────────────┼───────────────────────────────────────────┘
                          │
                          ▼
                     Response + Sources

Strategy Overview

#### 1. Zero-Shot (zero_shot) Direct answer from context. No examples. Fastest and most concise.


System: "Answer using ONLY the provided context. If unknown, say so."
Context: [retrieved docs]
User: "What is your return policy?"
Best for: Simple factual questions with clear answers in documentation. #### 2. Few-Shot (few_shot) Includes 2 demonstration Q&A examples before the actual question. Guides format, tone, and structure.

System: [support agent persona]
[Example 1: password reset Q&A]
[Example 2: billing dispute Q&A]
Context: [retrieved docs]
User: "What is your return policy?"
Best for: Consistent formatting, tone matching, structured responses. #### 3. Chain-of-Thought (chain_of_thought) Model reasons step-by-step before answering. Shows its work.

System: "Think step by step: 1) What is the problem? 
         2) What does context say? 3) What is the best response?"
Context: [retrieved docs]
User: "My order is missing."
→ "Let me think through this...
   Step 1: Customer hasn't received their order.
   Step 2: Context says wait 24h then file claim within 7 days.
   Step 3: Recommend immediate actions + claim process.
   Answer: ..."
Best for: Complex multi-step issues, troubleshooting, edge cases. #### 4. Role-Specific (role_specific) Specialized system prompts per department (billing, technical, general). User tier and history injected into system prompt.

System: "You are a billing specialist for AcmeCorp.
         Customer: Jane Doe (Premium tier, customer since 2021)
         Open tickets: 0. Recent purchases: Pro Plan"
Best for: Tiered support, department routing, VIP customers. #### 5. RAG Standard (rag_standard) ← Default Balanced combination: role persona + few-shot examples + context. Best for: General production use.

→ "What about digital products?" is reformulated to

Overview

Fine-tuning adapts an open-source model (Mistral, LLaMA, etc.) to: - Follow your company's tone and response style - Cite sources using ##begin_quote## markers (RAFT training) - Ignore distractor documents and focus on relevant content - Reduce hallucination in domain-specific contexts

✨ Features

📦 Prerequisites

2. Install dependencies

pip install -r requirements.txt python -m nltk.downloader punkt stopwords

Best quality (requires Cohere API key)

COHERE_API_KEY=your-key # → CohereReranker auto-selected

Local cross-encoder (no API, requires GPU/CPU)

LoRA — full precision, requires more VRAM

python scripts/finetune_adapter.py \ --method lora \ --lora-r 32 \ --epochs 5 ```

E2E tests (requires running app)

make up pytest tests/e2e/ --base-url http://localhost:8000 -v ```

All checks (required before PR)

make format lint test ```

Project 2 - Build a Customer Support Chatbot using RAGs and Prompt Engineering

or: docker-compose up -d

Option B: Local Development (No Docker)

```bash

Verify Installation

```bash

Local development (default, no setup needed)

VECTOR_STORE_TYPE=chroma

Rebuild Index

```bash

Rebuild the entire index from processed JSONL files

python scripts/build_index.py \ --processed-dir ./data/processed \ --store-type chroma \ --embedding-model text-embedding-3-small \ --clear # wipe and rebuild from scratch ``` ---

🚢 Deployment

Deploy with Docker Compose

```bash

Production deployment

docker-compose -f docker-compose.yml up -d

5. Enable Redis caching (already in docker-compose)

REDIS_URL=redis://localhost:6379/0

For Docker:

docker-compose restart redis

Development Setup


git clone https://github.com/yourorg/customer-support-chatbot.git
cd customer-support-chatbot
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
pre-commit install

🚀 Quick Start

Chunking Strategy Guide


Strategy         When to Use                          Trade-off
─────────────────────────────────────────────────────────────────────
fixed_size       Simple docs, uniform content         Fast, may split mid-sentence
sentence         Conversational content, FAQs         Better coherence, slower
paragraph        Policy docs, structured text         Natural boundaries
hierarchical     Long docs with headings ← recommended Best recall + context
semantic         Mixed content, research docs         Best coherence, needs GPU
sliding_window   Dense technical docs                 High recall, more chunks

LoRA Rank Selection Guide


rank (r)   Parameters Added    Quality    Speed
────────────────────────────────────────────────
4          ~1M                 Good       Fastest
8          ~2M                 Better     Fast
16         ~4M   ← recommended Excellent  Good
32         ~8M                 Best       Slower
64         ~16M                Marginal+  Slowest

Pull Request Guidelines

1. Branch naming: feature/, fix/, docs/, refactor/ 2. Commit messages: Follow Conventional Commits


   feat: add semantic chunking strategy
   fix: resolve FAISS persistence bug
   docs: update chunking strategy guide
   
3. Test coverage: New code must have ≥ 80% test coverage 4. Type hints: All public functions must be fully typed 5. Docstrings: All public classes and methods require docstrings

5. Update this README under Chunking Strategy Guide

```

4. Add API key to settings.py and .env.example

4. Add sample documents and ingest

Sample Report Output


════════════════════════════════════════════════════════════
  RAG EVALUATION REPORT: production_eval
════════════════════════════════════════════════════════════
  Total Samples:     150
  Overall Pass Rate: 87.3%
  Evaluation Time:   243.1s

  Metric Scores:
  ──────────────────────────────────────────────────────────
  ✅ faithfulness               avg=0.891 ± 0.087  pass=91.3%
  ✅ answer_relevance           avg=0.873 ± 0.094  pass=88.7%
  ✅ context_relevance          avg=0.812 ± 0.121  pass=84.0%
  ✅ answer_correctness         avg=0.798 ± 0.132  pass=82.0%
  ⚠️  context_recall            avg=0.681 ± 0.156  pass=71.3%
  ✅ rouge                      avg=0.412 ± 0.189  pass=79.3%
  ✅ citation_precision         avg=0.834 ± 0.097  pass=87.3%
  ✅ answer_length              avg=0.943 ± 0.067  pass=94.7%
════════════════════════════════════════════════════════════

Optional External Services

| Service | Default | Alternative | |---|---|---| | Vector Store | ChromaDB (local) | Pinecone (cloud) or FAISS (disk) | | Keyword Search | BM25 (in-memory) | Elasticsearch (Docker) | | Conversation Store | Redis (Docker) | In-memory fallback | | Database | PostgreSQL (Docker) | SQLite for dev | ---

2. Configure environment

cp .env.example .env

Edit .env — minimum required:

1. Clone and set up Python environment

git clone https://github.com/AdilShamim8/Customer-Support-Chatbot-102.git cd customer-support-chatbot python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate

3. Configure environment

cp .env.example .env

Set OPENAI_API_KEY and APP_ENV=development

nano .env

⚙️ Configuration

All configuration is via environment variables. Copy .env.example to .env and fill in your values.

Core Settings

```env

In .env — point to local merged model

LLM_PROVIDER=local CHAT_MODEL=./models/support-lora-merged ``` ---

Add to .env for production:

SECRET_KEY=your-secret-key

1. Set production environment variables

APP_ENV=production LOG_LEVEL=INFO SECRET_KEY=<cryptographically-random-32-bytes> API_RATE_LIMIT=60

Check .env file exists and has the key

cat .env | grep OPENAI_API_KEY

Reload environment

source .env



#### `ChromaDB connection refused`
bash

1. Add to LLMProvider enum in settings.py

class LLMProvider(str, Enum): MY_PROVIDER = "my_provider"

API Keys (at least one LLM provider required)

| Service | Required | Purpose | |---|---|---| | OpenAI | ✅ Recommended | GPT-4o for generation + embeddings | | Anthropic | Optional | Claude 3 alternative | | Cohere | Optional | Best-in-class reranking |

OPENAI_API_KEY=sk-...

nano .env

6. Test the API

curl -X POST http://localhost:8000/api/v1/chat/ \ -H "Content-Type: application/json" \ -d '{"message": "What is your return policy?"}'

7. Open API docs

open http://localhost:8000/docs

5. Start the API server

make dev

or: uvicorn src.api.main:app --reload --port 8000

Set COHERE_API_KEY empty → FlashRankReranker auto-selected

``` ---

Via API (Upload)

```bash

📡 API Reference

CLI evaluation against test dataset

python scripts/evaluate_pipeline.py \ --dataset ./data/eval/test_set.jsonl \ --output ./data/eval/report.json \ --max-samples 100

Without LLM metrics (fast, no API calls)

python scripts/evaluate_pipeline.py \ --no-llm-metrics

Requests by endpoint

sum by (handler)(rate(http_requests_total{job="chatbot"}[5m])) ```

4. Disable debug endpoints

Scale API workers

docker-compose up -d --scale chatbot=3

(no API call, runs locally)

COHERE_API_KEY= # leave empty → FlashRank selected

In src/api/main.py, set:

check_hallucination=True

🔬 Research & References

This system implements techniques from the following papers: | Paper | Application | |---|---| | RAFT: Adapting Language Model to Domain Specific RAG | Fine-tuning strategy | | Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks | RAG foundation | | Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods | Hybrid search fusion | | LoRA: Low-Rank Adaptation of Large Language Models | Parameter-efficient fine-tuning | | QLoRA: Efficient Finetuning of Quantized LLMs | Memory-efficient training | | RAGAS: Automated Evaluation of RAG | Evaluation framework | | Lost in the Middle | Context positioning insight | ---

Document Ingestion Pipeline


Raw Documents (PDF, DOCX, HTML, MD, TXT)
         │
         ▼
┌─────────────────────┐
│   DOCUMENT PARSER   │
│  Rule-based         │
│  AI-based (unstr.)  │
│  → ParsedDocument   │
└────────┬────────────┘
         │
         ▼
┌─────────────────────┐
│      CHUNKER        │
│  Fixed / Sentence   │
│  Paragraph          │
│  Hierarchical  ←── recommended
│  Semantic           │
│  Sliding Window     │
│  → DocumentChunk[]  │
└────────┬────────────┘
         │
         ├──────────────────────────────────┐
         ▼                                  ▼
┌────────────────────┐           ┌────────────────────┐
│   VECTOR INDEX     │           │   KEYWORD INDEX    │
│  Embed chunks      │           │  Tokenize chunks   │
│  ChromaDB / FAISS  │           │  BM25 / Elastic    │
│  / Pinecone        │           │                    │
└────────────────────┘           └────────────────────┘
         │                                  │
         └──────────────┬───────────────────┘
                        ▼
                  HYBRID INDEX
                (Ready for search)

🔄 RAG Pipeline

`GET /admin/stats` — Pipeline Statistics


curl http://localhost:8000/api/v1/admin/stats
Response:

{
  "vector_store_count": 1842,
  "keyword_index_count": 1842,
  "document_count": 47,
  "llm_requests": 1293,
  "total_tokens_used": 2847291,
  "total_cost_usd": 14.23
}

Integration tests (mocked LLM)

make test-integration

Integration test pattern (mock LLM)

@pytest.mark.asyncio async def test_pipeline(mock_pipeline): response = await mock_pipeline.aquery("How do I reset my password?") assert response.answer assert len(response.sources) > 0

🔧 Troubleshooting

🎯 aiskill88 AI 点评 A 级 2026-06-04

高质量的客户支持聊天机器人项目,具有很好的实用价值

⚡ 核心功能

👥 适合人群

内容创作者和自媒体人职场人士和学生ChatGPT / Claude 重度用户希望提升 AI 使用效率的普通用户

🎯 使用场景

  • 快速生成高质量的专业文案、分析报告或结构化内容
  • 利用 Prompt 框架引导 AI 解决特定领域的复杂问题
  • 在不同 AI 工具间复用经过验证的提示词模板

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +无需安装,立即可用
  • +适配所有主流 AI 工具
  • +经社区验证的最佳实践
⚠️ 不足
  • 效果依赖使用者对 Prompt 工程的熟悉程度
  • 不同模型和版本的响应效果可能存在差异
  • 复杂场景需结合实际需求二次调整
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

使用提供的训练数据和fine-tuning脚本训练模型
💡 AI Skill Hub 点评

总体来看,客户支持聊天机器人 是一款质量优秀的Prompt模板,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 客户支持聊天机器人
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 Customer-Support-Chatbot-102
Topics chatbotllmfine-tuning
GitHub https://github.com/AdilShamim8/Customer-Support-Chatbot-102
License MIT
语言 Python
🔗 原始来源
🐙 GitHub 仓库  https://github.com/AdilShamim8/Customer-Support-Chatbot-102 🌐 官方网站  https://ragchatbot1.space-z.ai

收录时间:2026-06-04 · 更新时间:2026-06-04 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。