MinAI - Về trang chủ
Dự án
12/1360 phút
Đang tải...

Capstone Project - Knowledge Base Chatbot

Xây dựng Knowledge Base Chatbot hoàn chỉnh với RAG trong n8n

🏆 Capstone Project - Knowledge Base Chatbot

0

🎯 Mục tiêu bài học

TB5 min

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.

1

📋 Project Overview

TB5 min
Diagram
Đang vẽ diagram...

Checkpoint

Capstone project gồm bao nhiêu workflows? Mỗi workflow có chức năng gì?

2

📝 Requirements

TB5 min
Project 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?

3

📥 Workflow 1: Document Indexing

TB5 min
Diagram
Đang vẽ diagram...

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?

4

🔎 Workflow 2: RAG Query Pipeline

TB5 min
Diagram
Đang vẽ diagram...

Key Configuration:

JavaScript
1// System prompt template
2const systemPrompt = `You are a friendly knowledge base assistant.
3
4Rules:
51. Answer ONLY from provided sources
62. Use [Source N] citations
73. If unsure, say so honestly
84. Respond in Vietnamese
95. Keep answers concise (max 3 paragraphs)
10
11Context:
12{context}
13
14Conversation History:
15{history}`;

Checkpoint

Query pipeline gồm những bước nào? System prompt cần bao gồm rules gì?

5

📱 Workflow 3: Telegram Bot

TB5 min
Diagram
Đang vẽ diagram...

Checkpoint

Telegram Bot cần hỗ trợ những commands nào? Rate limiting set bao nhiêu?

6

📊 Workflow 4: Analytics

TB5 min
JavaScript
1// Every query logged to Google Sheets
2const 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.processingTime
12};

Checkpoint

Analytics dashboard cần track những metrics nào?

7

🧪 Testing Plan

TB5 min
Test CaseInputExpected 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 resultsRandom unrelated queryGraceful fallback
Rate limit25 messages in 1 minRate limit at message 21

Checkpoint

Liệt kê 6 test cases. Test case nào khó implement nhất?

8

🎯 Evaluation Criteria

TB5 min
Grading Rubric
CriteriaPoints
Document indexing pipeline hoạt động20
RAG query pipeline chính xác25
Chat interface (Telegram/Slack)20
Citation và confidence scoring15
Error handling và edge cases10
Analytics tracking5
Documentation5
Total100

Checkpoint

Grading rubric phân bổ điểm như thế nào? Criteria nào chiếm nhiều điểm nhất?

9

📤 Submission

TB5 min
Nộp bài
  1. Export 4 workflows (JSON files)
  2. Screenshots: indexing results, chat conversation, analytics sheet
  3. README với setup instructions
  4. Test report: 10 questions và results
  5. (Optional) Demo video 3-5 minutes

Checkpoint

Cần nộp những gì? (Optional) demo video bao lâu?

🎉 Chúc mừng!

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.

🚀 Bài tiếp theo

n8n Advanced Agents →