🏆 Capstone Project - Knowledge Base Chatbot
🎯 Mục tiêu bài học
Sau bài học này, bạn sẽ:
✅ Xây dựng Knowledge Base Chatbot hoàn chỉnh
✅ Implement Document Indexing Pipeline (Workflow 1)
✅ Build RAG Query Pipeline với citations (Workflow 2)
✅ Tạo Chat Interface với Telegram/Slack (Workflow 3)
✅ Setup Admin Dashboard và Analytics (Workflow 4)
Tổng hợp toàn bộ kiến thức: build Knowledge Base Chatbot hoàn chỉnh với document processing, RAG pipeline, và chat interface.
📋 Project Overview
Checkpoint
Capstone project gồm bao nhiêu workflows? Mỗi workflow có chức năng gì?
📝 Requirements
Workflow 1: Document Indexing
- Load documents from Google Drive (or local upload)
- Support PDF, TXT, and Markdown files
- Smart text splitting (recursive, chunk size 800)
- Metadata enrichment (source, date, type)
- Index to Pinecone or Supabase vector store
- Handle document updates (re-index on change)
Workflow 2: RAG Query Pipeline
- Pre-process user queries
- Search vector store (top 5 results)
- Build context with conversation history
- Generate answer with citations
- Confidence scoring
- Handle no-result cases gracefully
Workflow 3: Chat Interface
- Telegram Bot (primary interface)
- Session memory (last 10 messages)
- Commands: /start, /help, /clear
- Feedback buttons after each response
- Rate limiting (20 msg/min)
Workflow 4: Admin Dashboard
- Track queries and responses
- Monitor usage metrics
- Log feedback ratings
- Save to Google Sheets
Checkpoint
Liệt kê requirements chính cho mỗi workflow. Workflow nào quan trọng nhất?
📥 Workflow 1: Document Indexing
Expected Result:
- 10+ documents indexed
- Each document split into chunks with metadata
- Verify: search returns relevant chunks for test queries
Checkpoint
Indexing pipeline cần hỗ trợ những file types nào? Chunk size và overlap recommended?
🔎 Workflow 2: RAG Query Pipeline
Key Configuration:
1// System prompt template2const systemPrompt = `You are a friendly knowledge base assistant.34Rules:51. Answer ONLY from provided sources62. Use [Source N] citations73. If unsure, say so honestly84. Respond in Vietnamese95. Keep answers concise (max 3 paragraphs)1011Context:12{context}1314Conversation History:15{history}`;Checkpoint
Query pipeline gồm những bước nào? System prompt cần bao gồm rules gì?
📱 Workflow 3: Telegram Bot
Checkpoint
Telegram Bot cần hỗ trợ những commands nào? Rate limiting set bao nhiêu?
📊 Workflow 4: Analytics
1// Every query logged to Google Sheets2const logEntry = {3 timestamp: new Date().toISOString(),4 userId: $json.userId,5 platform: $json.platform,6 query: $json.query,7 answer: $json.answer.substring(0, 200),8 confidence: $json.confidence,9 sourcesUsed: $json.sources.length,10 feedback: "pending",11 responseTime: $json.processingTime12};Checkpoint
Analytics dashboard cần track những metrics nào?
🧪 Testing Plan
| Test Case | Input | Expected Output |
|---|---|---|
| Basic question | "What is our return policy?" | Answer from docs with citation |
| Follow-up | "How long do I have?" | Context-aware answer |
| Out of scope | "Weather today?" | "Not in knowledge base" |
| Vietnamese | "Chính sách bảo hành?" | Vietnamese answer |
| No results | Random unrelated query | Graceful fallback |
| Rate limit | 25 messages in 1 min | Rate limit at message 21 |
Checkpoint
Liệt kê 6 test cases. Test case nào khó implement nhất?
🎯 Evaluation Criteria
| Criteria | Points |
|---|---|
| Document indexing pipeline hoạt động | 20 |
| RAG query pipeline chính xác | 25 |
| Chat interface (Telegram/Slack) | 20 |
| Citation và confidence scoring | 15 |
| Error handling và edge cases | 10 |
| Analytics tracking | 5 |
| Documentation | 5 |
| Total | 100 |
Checkpoint
Grading rubric phân bổ điểm như thế nào? Criteria nào chiếm nhiều điểm nhất?
📤 Submission
- Export 4 workflows (JSON files)
- Screenshots: indexing results, chat conversation, analytics sheet
- README với setup instructions
- Test report: 10 questions và results
- (Optional) Demo video 3-5 minutes
Checkpoint
Cần nộp những gì? (Optional) demo video bao lâu?
Bạn đã hoàn thành khóa học n8n RAG & Agents! Bạn đã học được cách xây dựng knowledge base chatbot hoàn chỉnh với document processing, RAG pipeline, và chat interface.
