GraphRAG and AI Agent Development for Developer

| รายละเอียด

หลักสูตรนี้เหมาะสำหรับนักพัฒนาและวิศวกรซอฟต์แวร์ที่ต้องการออกแบบและพัฒนาระบบ AI Agent แบบ end-to-endรวมถึงการสร้างระบบ GraphRAG (Retrieval-Augmented Generation) สำหรับงาน Knowledge Management และ Intelligent Search ในองค์กร ผู้เรียนจะได้สร้างระบบ AI Agent จริงที่ทำงานบน Knowledge Graph ตามแนวทาง Skill Routing Architecture ซึ่งเป็น production architecture ที่สามารถนำไปประยุกต์ใช้กับ domain จริงในองค์กร

ระยะเวลา 3 Days (9:00 – 16:30)

💰 หลักสูตรของสถาบันไอเอ็มซี สามารถยื่นรับรองหลักสูตรและลดหย่อนภาษีได้ 200%

หลักสูตรนี้เหมาะกับ

  • นักพัฒนา Software / Back-end Developer ที่ต้องการสร้างระบบ AI ที่เชื่อมต่อกับ Knowledge Graph
  • AI Engineer / Data Engineer ที่ต้องการออกแบบระบบ RAG ที่มีความสามารถด้าน Reasoning และ Multi-hop Retrieval
  • Developer ที่ต้องการสร้าง AI Agent ที่ใช้ Skill Routing Architecture สำหรับ Domain-specific Q&A
  • ทีมที่ต้องการนำ Graph RAG ไปใช้กับระบบจริง เช่น Enterprise Knowledge Base, Document Intelligence หรือ Domain-specific AI Assistant
  • ผู้ที่ต้องการอัปสกิลด้าน LLM, Graph Database, MCP Protocol และ Agentic AI อย่างเป็นระบบ

คุณสมบัติของผู้เข้าอบรม

  • มีพื้นฐานการเขียนโปรแกรม Python ในระดับปฏิบัติได้
  • มีความเข้าใจเบื้องต้นเกี่ยวกับ API และ REST/HTTP services
  • มีความคุ้นเคยกับแนวคิด RAG หรือ Vector Database มาบ้าง (หรือผ่านหลักสูตร RAG มาแล้ว)
  • สามารถใช้ Terminal / Command Line ในระดับที่ทำงานตามขั้นตอนการติดตั้งและทดสอบโปรแกรมได้
  • มีความเข้าใจพื้นฐานเกี่ยวกับโครงสร้างข้อมูล เช่น JSON, Graph หรือ Relational Database

สิ่งที่ต้องเตรียม

  • เครื่องคอมพิวเตอร์ที่ไม่ปิดกั้นการเข้าถึงอินเทอร์เน็ตใดๆ
  • ทาง IMC จัดเตรียม API Key สำหรับใช้ในการทำ Labs ให้เรียบร้อยแล้ว
  • เครื่องคอมพิวเตอร์ที่ติดตั้ง Docker Desktop มาพร้อมใช้งานแล้ว และสามารถติดตั้งซอฟต์แวร์อื่น ๆ เพิ่มเติมได้ระหว่างเรียน

Benefits ประโยชน์ที่ได้รับ

  • ออกแบบ Knowledge Graph Schema และสร้าง Graph ด้วย NetworkX สำหรับ Domain-specific Knowledge
  • Implement Graph RAG Pipeline ที่ดึงข้อมูลจาก Knowledge Graph ด้วย NetworkX Traversal และ Hybrid Search
  • สร้าง MCP Server (Model Context Protocol) เพื่อ expose Graph และ Database tools ให้ Agent ใช้งาน
  • ออกแบบ Agent Architecture แบบ Skill Routing Pattern: plan → skill routing → tool call → report
  • Implement SkillLoader system — โหลด domain expertise on-demand ผ่านไฟล์ SKILL.md
  • สร้าง Custom Agent Loop ที่รองรับ multi-step reasoning และ TodoWrite task tracking
  • สร้าง Hybrid Retriever ผสาน Vector Search (RAG) กับ Graph Traversal สำหรับ Multi-hop Q&A
  • Deploy ระบบ Graph RAG Agent แบบ production-ready ด้วย Docker Compose

| เนื้อหาในการอบรม

วันที่ 1: Graph Foundations & Knowledge Graph Construction

🔹Module 1.1: Graph RAG Architecture Overview

▪️ ทำไม Graph RAG ถึงเหนือกว่า Vector-only RAG — ปัญหา Context Fragmentation และ Multihop Reasoning

▪️ Architecture ของระบบที่จะสร้าง: Knowledge Graph + Vector RAG + MCP Server + Custom Agent

▪️ ทำความรู้จัก Codebase: agent.py, CLAUDE.md, skills/, mcp/, data/

▪️ Demo: ระบบ PDPA GraphRAG Agent ทำงานจริง: ตอบคำถามเกี่ยวกับกฎหมาย PDPA, สิทธิ, บทลงโทษ

🔹Module 1.2: การจัดเตรียม Environment

▪️ ทำความเข้าใจ Stack ของระบบ: NetworkX (in-memory graph) + Qdrant (vector store) + LightRAG + FastMCP

▪️ Python environment: mcp, qdrant-client, openai, httpx, python-dotenv, networkx.env configuration: OPENROUTER_API_KEY, LLM_MODEL, QDRANT_HOST, QDRANT_PORT, USE_LLM_EXTRACT

▪️ ทำความเข้าใจ docker-compose.yml ของโครงการ: Qdrant + PDPA MCP Server

▪️ Hands-on Lab 1: Setup Qdrant ด้วย Docker + ตรวจสอบ connection ด้วย Python + รัน health check MCP Server ด้วย curl http://localhost:8100/mcp

🔹Module 1.3: การออกแบบ Knowledge Graph Schema

▪️ หลักการ Data Modeling สำหรับ Domain Knowledge: Nodes, Relationships, Properties

▪️ การออกแบบ Schema สำหรับ real-world domains เช่น Legal Document, Process, Regulatory Compliance

▪️ Index และ Constraint Design สำหรับ Performance Optimization บน In-memory Graph

▪️ เปรียบเทียบแนวทาง: In-memory Graph (NetworkX) กับ Graph Database — เลือกใช้อย่างไรตามบริบทของโครงการ

▪️ Hands-on Lab 2: วิเคราะห์ pdpa_knowledge_graph.json — ทำความเข้าใจ Node Types 11 ประเภท และ Edge Types 24 ประเภท แล้ว Load เข้า NetworkX และ Visualize ด้วย Python

🔹Module 1.4: Knowledge Graph Population จาก PDPA Text

▪️ Rule-based Parser vs. LLM-based Entity Extraction: trade-off ระหว่างความเร็วกับความยืดหยุ่น

▪️ scripts/build_graph.py : parse pdpa_full_text_v2.md แล้วสร้าง pdpa_knowledge_graph.json อัตโนมัติ

▪️ Heading Hierarchy สำหรับ MarkdownNodeParser: H1 → H2: หมวด → H3: ส่วน → H4:มาตรา

Entity Resolution และ Deduplication บน NetworkX graph

▪️ Output formats: pdpa_knowledge_graph.json, pdpa_networkx.json, nodes.csv, edges.csv

▪️ Hands-on Lab 3: รัน scripts/build_graph.py จาก pdpa_full_text_v2.md — ศึกษา rulebased parser และตรวจสอบ output graph ที่ได้

วันที่ 2: MCP Server + Graph RAG Pipeline

🔹Module 2.1: Model Context Protocol (MCP) Fundamentals

▪️ MCP คืออะไร: มาตรฐาน JSON-RPC 2.0 สำหรับเชื่อมต่อ LLM กับ External Tools

▪️ MCP Transport: HTTP/SSE vs. stdio — เลือกใช้อย่างไรในแต่ละบริบท

▪️ tools/list และ tools/call — วิธีที่ Agent ค้นพบและเรียกใช้ tools อัตโนมัติ

▪️ ทำความเข้าใจ mcp/ directory ใน codebase: RAG Server, MSSQL Server

▪️ Demo: ทดสอบ MCP Server ด้วย curl และ check_mcp.py

🔹Module 2.2: สร้าง MCP Server สำหรับ Graph RAG

▪️ Implement tools/list endpoint: expose 4 PDPA tools ให้ Agent เรียกใช้

▪️ search_pdpa — Hybrid search (Vector + Graph)

▪️ get_related_sections — Graph Traversal หามาตราเชื่อมโยง

▪️ get_penalty — BFS หาบทลงโทษ (max 3 hops)

▪️ get_pdpa_summary — สรุปโครงสร้าง graph (nodes, edges, types)

▪️ Implement tools/call endpoint: execute NetworkX traversal หรือ Qdrant search แล้ว return ผลลัพธ์

▪️ Hands-on Lab 4: Deploy PDPA MCP Server ด้วย Docker Compose (Qdrant +

mcp_server_rag.py ) แล้วทดสอบ 4 tools ด้วย curl : search_pdpa , get_related_sections, get_penalty, get_pdpa_summary

🔹Module 2.3: Hybrid Vector + Graph Retrieval

▪️ Qdrant Vector Store: collection setup, embed ด้วย BGE-M3 (Dense + Sparse), query

▪️ NetworkX BFS Traversal: เดินทาง Graph หา related nodes ไม่เกิน 3 hops

▪️ Hybrid Retrieval Strategy: Keyword extraction (LLM) → Vector Search → BFS Graph → Traversal → RRF Fusion → Context Assembly

▪️ Context Window Optimization: จำกัด context ให้พอดีกับ LLM context window

▪️ Hands-on Lab 5: เจาะลึก lightrag/retrieval.py — ทำความเข้าใจ Hybrid Retrieval pipeline แล้วทดสอบคำถาม PDPA ที่ต้องการ Multi-hop Reasoning

🔹Module 2.4: MCP Tool Integration

▪️ Dynamic Tool Discovery: ดึง MCP tools ผ่าน tools/list แล้ว auto-register กับ OpenAI function calling

▪️ tool_registry: mapping ระหว่าง tool name กับ MCP server URL

▪️ Error Handling และ Timeout ในการเรียก MCP tools

▪️ Multi-MCP support: เชื่อมต่อหลาย MCP server พร้อมกันผ่าน MCP_URLS (comma-separated)

▪️ Hands-on Lab 6: เชื่อมต่อ Agent กับ PDPA MCP Server (port 8100) แล้วทดสอบ Tool Discovery ( tools/list ) + Tool Calling ( tools/call ) บนคำถามเรื่อง PDPA จริง

วันที่ 3: Custom Agent Architecture & Capstone

🔹Module 3.1: Agent Architecture — Skill Routing Pattern

▪️ แนวคิด Skill Routing: บังคับ Agent จำแนก question type แล้วโหลด Skill ก่อนตอบทุกครั้ง เพื่อเพิ่ม Determinism และลด hallucination

▪️ System Prompt Design: build_system() — CLAUDE.md + Agent Loop Rule + Skill Routing Rule + Response Format

▪️ Workshop: วิเคราะห์และ debug system prompt บนคำถาม PDPA จริง เพื่อเข้าใจผลของ Skill Routing ต่อความสม่ำเสมอของคำตอบ

🔹Module 3.2: SkillLoader — On-demand Domain Expertise

▪️ Skill file format: skills/{skill-name}/SKILL.md พร้อม YAML frontmatter

(name, description)

▪️ SkillLoader._discover() : auto-scan skills directory แล้ว parse SKILL.md ทุกไฟล์

▪️ SkillLoader.load(name) : inject skill content เข้า context ด้วย XML tag

▪️ SkillLoader.descriptions() : generate skill list สำหรับ system prompt อัตโนมัติ

▪️ การออกแบบเนื้อหาใน SKILL.md: Pattern Table, ขั้นตอน step-by-step, ข้อควรระวัง

▪️Hands-on Lab 7: สร้าง SKILL.md สำหรับ PDPA domain อย่างน้อย 2 skills เช่น solve-pdpacompliance (สิทธิและหน้าที่) และ solve-pdpa-penalty (บทลงโทษ) แล้วทดสอบกับ SkillLoader

🔹Module 3.3: Custom Agent Loop

▪️ Agent Loop Architecture: plan → tool call → execute → observe → repeat

▪️TodoWrite / TodoRead builtin tools: enforce plan-before-act pattern

▪️ Skill builtin tool: ให้ Agent โหลด domain expertise on-demand ระหว่าง loop

▪️ Tool dispatch: builtin tools กับ MCP tools

▪️ Response Format: แยกข้อมูลจาก DB (data only) กับความเห็นของ Agent (analysis) ชัดเจน

▪️ Hands-on Lab 8: Implement Custom Agent Loop ครบแบบ Skill Routing โดยใช้ PDPA MCP Server เป็น Knowledge Source — ทดสอบตอบคำถามเรื่อง PDPA แบบ Multi-hop

| ผู้สอน

Mr. Aekanun Thongtae (ดูโปรไฟล์ >>ที่นี่)

  • CTO , Bangkok First Tech
  • Big Data Consultant at IMC Institute
  • Former Manager of Architecture and Prototype at EGA
  • Former Manager of Research and Development at EGA
  • Guest Lecturer in Many University, Courses of Data Mining and Information Security
  • Former Director of Relations Network at Student Loan Fund
Mr. Aekanun Thongtae

11,900 Baht (Exclude VAT)

Register
In House Training

หากท่านสนใจจัดอบรมในองค์กร
(In House Training)

ปลดล็อคศักยภาพ เพิ่มทักษะ ยกระดับทีมงาน
พัฒนาองค์กรอย่างมีประสิทธิภาพ

ขอรายละเอียดเพิ่มเติม