AI Skill Hub 强烈推荐:客户支持聊天机器人 是一款优质的Prompt模板。AI 综合评分 8.0 分,在同类工具中表现稳健。如果你正在寻找可靠的Prompt模板解决方案,这是一个值得深入了解的选择。
客户支持聊天机器人 是经过精心设计和反复验证的专业 Prompt 模板集合。这些 Prompt 框架能够有效激活 Claude、ChatGPT 等大型语言模型的深层能力,让 AI 生成更准确、更有价值的输出结果。无需任何安装,直接复制模板内容到 AI 对话框即可使用。
客户支持聊天机器人 是经过精心设计和反复验证的专业 Prompt 模板集合。这些 Prompt 框架能够有效激活 Claude、ChatGPT 等大型语言模型的深层能力,让 AI 生成更准确、更有价值的输出结果。无需任何安装,直接复制模板内容到 AI 对话框即可使用。
# Prompt 无需安装,直接复制使用 # 支持:Claude / ChatGPT / Gemini / 通义千问 等主流模型 # 使用步骤 # 1. 复制 Prompt 模板内容 # 2. 粘贴到 AI 对话框 # 3. 替换 [占位符] 为实际内容 # 4. 发送后获取结构化输出 # 获取原始文件 git clone https://github.com/AdilShamim8/Customer-Support-Chatbot-102
# 粘贴到 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"
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.
┌─────────────────────────────────────────────────────────────────────┐
│ 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
#### 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.
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
pip install -r requirements.txt python -m nltk.downloader punkt stopwords
COHERE_API_KEY=your-key # → CohereReranker auto-selected
python scripts/finetune_adapter.py \ --method lora \ --lora-r 32 \ --epochs 5 ```
make up pytest tests/e2e/ --base-url http://localhost:8000 -v ```
make format lint test ```
```bash
```bash
```bash
VECTOR_STORE_TYPE=chroma
```bash
python scripts/build_index.py \ --processed-dir ./data/processed \ --store-type chroma \ --embedding-model text-embedding-3-small \ --clear # wipe and rebuild from scratch ``` ---
```bash
docker-compose -f docker-compose.yml up -d
REDIS_URL=redis://localhost:6379/0
docker-compose restart redis
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
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
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
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
```
════════════════════════════════════════════════════════════
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%
════════════════════════════════════════════════════════════
| 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 | ---
cp .env.example .env
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
cp .env.example .env
nano .env
All configuration is via environment variables. Copy .env.example to .env
and fill in your values.
```env
LLM_PROVIDER=local CHAT_MODEL=./models/support-lora-merged ``` ---
SECRET_KEY=your-secret-key
APP_ENV=production LOG_LEVEL=INFO SECRET_KEY=<cryptographically-random-32-bytes> API_RATE_LIMIT=60
cat .env | grep OPENAI_API_KEY
source .env
#### `ChromaDB connection refused`
bash
class LLMProvider(str, Enum): MY_PROVIDER = "my_provider"
| Service | Required | Purpose | |---|---|---| | OpenAI | ✅ Recommended | GPT-4o for generation + embeddings | | Anthropic | Optional | Claude 3 alternative | | Cohere | Optional | Best-in-class reranking |
nano .env
curl -X POST http://localhost:8000/api/v1/chat/ \ -H "Content-Type: application/json" \ -d '{"message": "What is your return policy?"}'
open http://localhost:8000/docs
make dev
``` ---
```bash
python scripts/evaluate_pipeline.py \ --dataset ./data/eval/test_set.jsonl \ --output ./data/eval/report.json \ --max-samples 100
python scripts/evaluate_pipeline.py \ --no-llm-metrics
sum by (handler)(rate(http_requests_total{job="chatbot"}[5m])) ```
docker-compose up -d --scale chatbot=3
COHERE_API_KEY= # leave empty → FlashRank selected
check_hallucination=True
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 | ---
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)
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
}
make test-integration
@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
高质量的客户支持聊天机器人项目,具有很好的实用价值
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,客户支持聊天机器人 是一款质量优秀的Prompt模板,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | Customer-Support-Chatbot-102 |
| Topics | chatbotllmfine-tuning |
| GitHub | https://github.com/AdilShamim8/Customer-Support-Chatbot-102 |
| License | MIT |
| 语言 | Python |
收录时间:2026-06-04 · 更新时间:2026-06-04 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端