Capstone Project
Capstone: AI Assistant for a Bank Call Center
End-to-end design case แปลง business problem เป็น requirements และ quality attributes, design architecture แบบ RAG + agent + API gateway + core APIs, วาง security, compliance และ LLMOps, วางแผน rollout แล้วส่ง solution blueprint, ADR 3 ฉบับ และ risk register ตาม rubric
บทนี้รวมทุกอย่างในคอร์สเข้าด้วยกันเป็นงานเดียว คุณจะทำหน้าที่ AI Solution Architect ของธนาคารสมมติแห่งหนึ่ง ได้รับโจทย์จาก executives และต้องส่ง deliverables แบบเดียวกับที่ใช้ในการทำงานจริง
The brief
ธนาคารมี call center พนักงาน 300 คน รับสายวันละประมาณ 9,000 สาย คำถามส่วนใหญ่เป็นเรื่องบัตรเครดิต ค่าธรรมเนียม และสถานะคำขอ พนักงานใหม่ใช้เวลาค้นคู่มือระหว่างสายนาน ลูกค้ารอนาน executives ต้องการ “AI assistant” ที่ช่วยพนักงานตอบได้เร็วและถูกต้องขึ้น และในระยะถัดไปอยากเปิดให้ลูกค้าถามเองผ่าน mobile app และ LINE OA
Assumptions เพิ่มเติม
- คู่มือและ policies ราว 400 ฉบับ update ทุกเดือน บางฉบับเห็นได้เฉพาะ supervisors
- Core banking เป็น legacy system มี API อ่านสถานะบัตรและสถานะคำขอ แต่รองรับ load ได้จำกัด
- CRM มี API สำหรับ create ticket
- ธนาคารใช้ Azure เป็น primary cloud มี landing zone อยู่แล้ว
- Customer data ต้อง process ตาม data residency policy ของธนาคาร
Step 1: Requirements & quality attributes
แยก business goals ให้ measurable ก่อน (บทที่ 2 (Architecture Fundamentals & Decisions))
| Business goal | Metric |
|---|---|
| ลดเวลาต่อสาย | average handling time (AHT) ลดลง 10% ในกลุ่ม pilot |
| ตอบถูกต้องสม่ำเสมอ | groundedness ≥ 90% บน eval set, complaints เรื่องข้อมูลผิดไม่เพิ่มขึ้น |
| Onboarding พนักงานใหม่เร็วขึ้น | time-to-proficiency ลดลง |
แล้วเขียน quality attribute scenarios อย่างน้อยด้าน performance, availability, security และ compliance เช่น “เมื่อ LLM ไม่ตอบภายใน 8 วินาที ระบบต้องแสดง links ของ documents ที่ search เจอให้พนักงานแทน”
Capacity estimate สมมติ peak hour มีพนักงาน 300 คนถาม assistant เฉลี่ยคนละ 0.5 คำถามต่อนาที = 150 requests ต่อนาที แต่ละ request มี input 3,000 tokens และ output 400 tokens → ราว 510,000 tokens per minute (TPM) ตัวเลขนี้ใช้ขอ TPM quota ของ deployment และ design load balancing ที่ AI gateway ทั้งนี้ rate limiter มักประเมินแต่ละ request จาก input รวมกับ max output tokens ที่ตั้งไว้ ไม่ใช่ output จริง จึงควรขอ quota เผื่อไว้ (ถ้าตั้ง max 600 tokens จะเป็น 150 × 3,600 = 540,000 TPM)
Step 2: Architecture
Design decisions ที่ต้องตัดสินใจและอธิบาย
- RAG (บทที่ 4 (RAG Architecture)) chunking ของคู่มือ, hybrid search, security trimming สำหรับคู่มือของ supervisors และ monthly re-index
- Agent (บทที่ 5 (AI Agents & Orchestration)) tools ที่อนุญาต, แยก read กับ write, จุดที่ต้องมี human approval และเหตุผลว่าทำไม phase แรกเลือก single agent หรือ workflow
- Integration (บทที่ 6 (APIs, Microservices & Legacy Integration)) APIM หน้าทุก channel, anti-corruption layer หน้า core, cache และ rate limit เพื่อปกป้อง core, idempotency key สำหรับการ create ticket
- Platform (บทที่ 7 (Cloud-native on Azure)) compute ที่เลือก, private endpoints, managed identity และ fallback เมื่อ LLM ล่มหรือเกิน quota
Step 3: Security & compliance
ใช้ threat model และ OWASP Top 10 for LLM (บทที่ 10 (Security, Governance & Compliance)) กับ design ของคุณ อย่างน้อยต้องตอบ
- Customer identity ที่ใช้เรียก core API มาจากที่ใด และป้องกันการดู data ของคนอื่นอย่างไร
- PII ใดเข้า prompt บ้าง ลดได้อีกไหม และ logs เก็บอะไร retention นานเท่าไร
- Data ถูก process ที่ region ใด ตรงกับ data residency policy หรือไม่
- เมื่อเปิดให้ลูกค้าใช้เอง (phase 2) risks ใดเพิ่มขึ้น และต้องเพิ่ม controls อะไร
Step 4: LLMOps & measurement
(บทที่ 9 (MLOps & LLMOps)) กำหนด
- Initial eval set, sources ของคำถาม และวิธีเพิ่ม production failures เข้า eval set
- Release gate ของ prompt และ configuration
- Dashboard ที่ติดตาม: quality, latency, tokens และ cost, handoff rate และ user feedback
- Migration plan เมื่อ model version ปัจจุบันจะถูก retire
Step 5: Rollout
(บทที่ 11 (PoC, Technology Evaluation & Stakeholders))
| Phase | Scope | Exit criteria |
|---|---|---|
| PoC (6 สัปดาห์) | RAG บนคู่มือ, testers 20 คน, ยังไม่ integrate core | ผ่าน quality และ cost criteria |
| Pilot (2–3 เดือน) | พนักงาน 50 คน, integrate core แบบ read-only, create ticket ได้ | AHT ลดลงตาม target, ไม่มี data incident |
| Scale out ทั้ง call center | พนักงานทั้งหมด ทยอยเพิ่มแบบ canary | metrics คงที่เมื่อ load เพิ่ม |
| Phase 2 | ลูกค้าใช้เองผ่าน mobile app และ LINE OA | ผ่าน risk assessment และ approval จาก committees ที่เกี่ยวข้อง |
Deliverables
- Solution blueprint (6–10 หน้า): executive summary 1 หน้า, requirements และ quality attribute scenarios, C4 Context และ Container, data flow ที่ระบุ PII, Azure service mapping, capacity และ cost estimate, rollout plan
- ADR 3 ฉบับ เลือกเรื่องที่สำคัญจริง เช่น
- ADR-001 เริ่มจาก employee assistant ก่อน customer-facing assistant
- ADR-002 hybrid search และ security trimming บน Azure AI Search
- ADR-003 workflow + single agent แทน multi-agent ใน phase แรก
- Risk register อย่างน้อย 8 items ครอบคลุม technical, security, regulatory และ operational risks
ID Risk Likelihood Impact Mitigation Owner
R-01 คำตอบอ้าง policy ที่ยกเลิกแล้ว Medium High filter effective_date, monthly re-index KM team
R-02 Indirect prompt injection ใน documents Low High scan documents ก่อน index, Prompt Shields Security
R-03 Core API รับ load ไม่ไหว Medium High cache, rate limit ที่ APIM, circuit breaker Platform
...
Rubric
| Criterion | Weight | Excellent | Adequate | Needs work |
|---|---|---|---|---|
| Business alignment | 15% | ทุกส่วนของ design trace กลับไปยัง measurable metrics | มี metrics แต่บางส่วนของ design ไม่ trace กลับ | ไม่มี measurable metrics |
| Architecture soundness | 25% | RAG, agent, integration และ platform ถูกต้อง เหมาะกับโจทย์ ไม่ over-engineer | ใช้ได้แต่มี weaknesses ที่ไม่ได้อธิบาย | ขาด components สำคัญหรือใช้ pattern ผิด |
| Security & compliance | 20% | controls enforce ด้วยระบบนอก model ครอบคลุม threats หลัก ตอบคำถาม auditor ได้ | ครอบคลุมบางส่วน พึ่ง prompt ในบางจุด | ไม่ได้พิจารณาอย่างเป็นระบบ |
| ADR quality | 15% | options จริง rationale ชัด บอก trade-offs ตรงไปตรงมา | มี rationale แต่ไม่ได้เทียบ options | เป็นแค่คำบรรยาย decision |
| LLMOps & rollout | 15% | มี eval, release gate, monitoring และ exit criteria ทุก phase | มีบางส่วน | ไม่มีแผนวัดผลหลัง release |
| Communication | 10% | executives เข้าใจจากหน้าแรก dev team นำไปสร้างต่อได้ | อ่านเข้าใจ แต่ไม่ได้แยก audience | สับสน หรือ technical เกินไปสำหรับ executives |
แบบทดสอบ
Peak hour มี 150 requests ต่อนาที แต่ละ request มี input 3,000 tokens และ output 400 tokens ต้องการ quota รวมกี่ tokens per minute (TPM)