🏆 Capstone Project - AI Operations Agent
🎯 Mục tiêu bài học
Sau bài học này, bạn sẽ:
✅ Xây dựng AI Operations Agent hoàn chỉnh
✅ Tích hợp 5+ working tools (DB, KB, Task, Notify, Voice)
✅ Implement Telegram Bot interface (text + voice)
✅ Setup Memory (Buffer + Entity) cho Agent
✅ Thêm Error Handling và Analytics tracking
✅ Hoàn thành capstone project với documentation
Tổng hợp toàn bộ kiến thức: build một AI Operations Agent có khả năng quản lý tasks, truy vấn data, và tương tác qua voice.
🔍 Project Overview
Core Agent
- AI Agent with GPT-4o, reasoning capabilities
- Memory: Buffer (10 msgs) + Entity memory
- Planning: Break complex tasks into steps
- Error handling and retry logic
Tools (minimum 5)
- Database query tool (read-only SQL)
- Knowledge base search (RAG)
- Task creation (Trello/Notion)
- Notification (Slack + Email)
- Voice I/O (STT + TTS)
Interfaces
- Telegram bot (text + voice)
- Slack bot (text only)
- Webhook API for integrations
Admin Dashboard
- Query logs in Google Sheets
- Usage metrics tracking
- Feedback collection
Checkpoint
Project cần đáp ứng những requirements nào? Hãy liệt kê 5 tools bắt buộc.
🏗️ Architecture
Checkpoint
Hãy mô tả architecture của AI Operations Agent. Data flow từ input đến output như thế nào?
🤖 Workflow 1: Agent Core
1// Agent System Prompt2const systemPrompt = `3You are an AI Operations Agent. You help the team manage operations efficiently.45Your capabilities:61. **Query Data**: Search database for metrics, reports, customer info72. **Knowledge Base**: Search internal docs for policies, procedures83. **Task Management**: Create, update tasks in project management tool94. **Notifications**: Send alerts via Slack or email105. **Voice**: Understand voice commands, respond with voice1112Rules:13- Be concise and action-oriented14- Always confirm before creating tasks or sending notifications15- Cite sources when answering from knowledge base16- Track what you do for audit purposes17- Communicate in Vietnamese unless asked otherwise18`;Checkpoint
System prompt cho Operations Agent cần chứa những gì? Rules nào quan trọng nhất?
📱 Workflow 2: Telegram Bot Interface
Checkpoint
Telegram Bot cần xử lý những loại input nào? Các commands cơ bản cần implement là gì?
🛠️ Workflow 3: Tool Implementations
1// Tool 1: Database Query2const dbTool = {3 name: "query_database",4 description: "Query business database. Can get sales, customers, orders data.",5 execute: async (query) => {6 const sql = await textToSQL(query);7 return await executeSQL(sql);8 }9};1011// Tool 2: Knowledge Base12const kbTool = {13 name: "search_knowledge_base",14 description: "Search company docs, policies, procedures, FAQs.",15 execute: async (query) => {16 return await vectorStoreSearch(query, topK=5);17 }18};1920// Tool 3: Task Management21const taskTool = {22 name: "manage_tasks",23 description: "Create, list, or update tasks. Actions: create, list, update.",24 execute: async (action, params) => {25 return await trelloAPI(action, params);26 }27};2829// Tool 4: Notifications30const notifyTool = {31 name: "send_notification",32 description: "Send Slack message or email notification.",33 execute: async (channel, message) => {34 return await sendNotification(channel, message);35 }36};Checkpoint
Mỗi tool cần implement những gì? Tool descriptions có đủ chi tiết cho Agent sử dụng không?
📊 Workflow 4: Analytics Dashboard
1// Log every interaction2const logEntry = {3 timestamp: new Date().toISOString(),4 userId: $json.userId,5 platform: $json.platform, // telegram, slack, webhook6 inputType: $json.inputType, // text, voice7 query: $json.query,8 intent: $json.detectedIntent,9 toolsUsed: $json.toolsUsed,10 responseTime: $json.processingMs,11 answerLength: $json.response.length,12 confidence: $json.confidence,13 feedback: "pending"14};1516// Save to Google Sheets: "Agent Analytics"Checkpoint
Analytics Dashboard track những metrics nào? Tại sao cần log mọi interaction?
🧪 Testing Scenarios
| Scenario | Input | Expected |
|---|---|---|
| Data query | "Doanh thu tháng này bao nhiêu?" | SQL query, formatted result |
| Knowledge | "Chính sách nghỉ phép thế nào?" | Answer from KB with citation |
| Task | "Tạo task review code cho Mai, due Friday" | Trello card created, confirmed |
| Notify | "Gửi Slack cho team về meeting 3pm" | Slack message sent |
| Voice | [Voice: "Tóm tắt email hôm nay"] | Voice response with summary |
| Multi-step | "Check sales, create report, send to team" | 3 tools used sequentially |
Checkpoint
Bạn đã test được bao nhiêu scenarios? Agent có xử lý đúng multi-step tasks không?
📋 Evaluation & Submission
| Criteria | Points |
|---|---|
| Agent core with reasoning | 20 |
| 5+ working tools | 25 |
| Telegram bot (text + voice) | 20 |
| Memory (buffer + entity) | 10 |
| Error handling | 10 |
| Analytics tracking | 10 |
| Documentation | 5 |
| Total | 100 |
- Export tất cả workflows (JSON)
- Screenshots: conversations, tool usage, analytics
- README: setup guide, architecture diagram
- Test report: 10 scenarios tested
- (Optional) Demo video 5 min
Checkpoint
Bạn đã hoàn thành được bao nhiêu điểm theo rubric? Những phần nào cần cải thiện?
Bạn đã hoàn thành khóa học n8n Advanced Agents! Bạn đã nắm vững cách xây dựng AI Agents nâng cao với tools, memory, planning, voice interface, và đã hoàn thành capstone project AI Operations Agent.
🚀 Bài tiếp theo
Quay lại: n8n Automation Pathway →
