Skip to main content

Agentic AI: จากพื้นฐานสู่ระบบ

Learning modules ภาษาไทย ดัดแปลงจาก The Hitchhiker’s Guide to Agentic AI

Author

ผศ.ดร.รัตน์ชัยนันท์ ธรรมสุจริต

Published

4 ธันวาคม 2569

หน้าแรก

▶ วิดีโอบรรยายทั้งหมดอยู่ที่ช่อง YouTube Cogito-Space ซีรีส์ Cogito Learn →

Agentic AI: จากพื้นฐานสู่ระบบ

เรียนการสร้าง AI agent ตั้งแต่ทฤษฎีจนเขียนโค้ดที่ใช้งานได้จริง ทุกตอนมีวิดีโอทฤษฎีแบบ animation, lab ที่เขียนโค้ดทีละบรรทัดใน Jupyter, วิดีโอสรุป และ notebook ที่เปิดใน Google Colab ได้ทันที ดัดแปลงจากตำรา The Hitchhiker’s Guide to Agentic AI (Roitman 2026)

👋 เริ่มที่นี่ — แนะนำซีรีส์ใน 1 นาที (EP00)

ซีรีส์นี้ให้อะไร · ต้องมีพื้นฐานแค่ไหน · ควรเริ่มดูตรงไหน — เสียงอังกฤษ ซับไทย · ฟังเสียงไทยได้ที่ ⚙️ → แทร็กเสียง → ไทย

9 module (M0–M8)

20 ตอน (EP)

~14 ชั่วโมงวิดีโอเมื่อครบชุด

18 / 20 ตอนที่พร้อมเรียนแล้ว

แต่ละตอนเรียนอย่างไร

🎬

วิดีโอทฤษฎี — animation วาดมือ อธิบายแนวคิดและเหตุผลเบื้องหลังก่อนลงมือเขียนโค้ด

💻

Lab 2–5 ตัว — พิมพ์โค้ดทีละบรรทัดใน Jupyter พร้อม notebook ✏️ starter (เติมเฉพาะ TODO) และ ✅ เฉลย

📖

สรุป + หน้าอ่าน — วิดีโอสรุปท้ายตอน และหน้าเว็บนี้ที่มีแผนภาพ ผลลัพธ์จริงจาก lab และคำถามทบทวน

ทุกคลิปพูดภาษาอังกฤษ มี subtitle ไทยและอังกฤษ และมีเสียงภาษาไทยตามมาทีหลัง (เปลี่ยนได้ที่ ⚙️) · notebook ทุก lab มีฉบับภาษาอังกฤษ · ดูเรียงตาม playlist คลิปถัดไปจะเล่นต่อให้อัตโนมัติ

Capstone: Research Assistant Agent

ทั้งซีรีส์สร้างโปรเจกต์เดียวกันต่อเนื่อง คือ agent ผู้ช่วยค้นคว้างานวิจัยที่ค้นหาและอ่าน paper แล้วเขียนรายงานให้ แต่ละ module เพิ่มความสามารถให้มันหนึ่งอย่าง

EP05 · tool-use + ReAct ✓ → M2 · harness ✓ → M3 · RAG ✓ → M4 · memory ✓ → M5 · MCP + skills ✓ → M6 · multi-agent → M7 · eval → M8 · UI

เส้นทางการเรียน

เรียงตามลำดับที่แนะนำ ตอนที่ยังไม่เปิดจะทยอยออกทาง playlist · เลข § ในวงเล็บคือ section ในตำรา

M0 ก่อนเริ่ม: LLM ที่คนสร้าง agent ต้องรู้ พื้นฐานที่จำเป็น ข้ามได้ถ้าเคยใช้ LLM API มาแล้ว

EP00

ยินดีต้อนรับสู่ซีรีส์ ดูก่อน · 1 นาที ▶ ซีรีส์นี้ให้อะไร · พื้นฐานที่ต้องมี · เริ่มที่ EP01 · วิดีโอ

EP01

LLM ทำงานอย่างไร (ฉบับคนสร้าง agent) พร้อมเรียน ▶ token · temperature · ชื่อ model · quantization · modality · §1.1–1.2, §1.12 · 3 lab

EP02

Prompt, structured output และ hallucination พร้อมเรียน ▶ ใบสั่งงาน · few-shot · JSON schema · validate · grounding · §1.12.11, §1.13, §1.16 · 4 lab

M1 Agent คืออะไร และออกแบบอย่างไร จบ module แล้วเลือกได้ว่างานไหนใช้ workflow พอ งานไหนต้องเป็น agent

EP03

จาก chatbot สู่ agent พร้อมเรียน ▶ agent loop · tool · harness · human-in-the-loop · LangChain · ch15 · 2 lab

EP04

Workflow Patterns พร้อมเรียน ▶ chaining · routing · parallelization · orchestrator-workers · evaluator-optimizer · §19.1 · 6 lab รวม LangGraph

EP05

Autonomous Agent Patterns พร้อมเรียน ▶ ReAct · planning · reflection · tool-use · LangGraph · §19.2 · 5 lab

EP06

Design Principles และการเลือก pattern พร้อมเรียน ▶ หลักออกแบบ 6 ข้อ · ตาราง 19.3 · trace · ชุดทดสอบ · LangChain middleware · §19.3–19.4 · 4 lab

M2 Harness: ระบบปฏิบัติการของ agent สร้าง harness ตัวแรกของ capstone

EP07

Context Window Management พร้อมเรียน ▶ token budget · การตัดเงียบ · history window · สรุปแบบ recursive · LangChain SummarizationMiddleware · §18.1–18.3 · 4 lab

EP08

Tools, State and Error Handling พร้อมเรียน ▶ parallel tool call · prompt injection · checkpoint · backoff + jitter · loop guard · prompt caching · LangGraph · §18.4, 18.6–18.8 · 5 lab

EP09

Building a Production Harness พร้อมเรียน ▶ Listing 18.1 · ContextManager · ToolExecutor · LoopDetector · mock LLM · prompt คือ code · replay · LangChain middleware · §18.9–18.10 · 4 lab

M3 ความรู้: RAG ให้ agent ตอบจากเอกสารของเราเอง

EP10

RAG Fundamentals พร้อมเรียน ▶ บัตรห้องสมุด · embedding · cosine top-k · BM25 · dense · hybrid ด้วย RRF · chunking · parent-child · LangChain · §16.1–16.4 · 4 lab

EP11

Advanced & Agentic RAG พร้อมเรียน ▶ HyDE · RAG-Fusion · re-rank ด้วย cross-encoder · CRAG · router · วงวน agentic RAG · ไล่สารบัญ · Recall · MRR · NDCG · faithfulness · LangGraph · §16.5, 16.7–16.9 · 4 lab

M4 ความจำ agent ที่จำสิ่งที่ทำมาแล้วได้

EP12

Agent Memory พร้อมเรียน ▶ ความจำสี่ชนิด · MemGPT ร้อน อุ่น เย็น · importance · temporal decay · ADD / DUPLICATE / UPDATE · ลืม · Reflexion · memory tools · memory recall · abstention · LangGraph checkpointer + Store · ch17 · 4 lab

M5 เชื่อมโลกภายนอก: MCP และ Skills ต่อ agent เข้ากับ tool และความรู้แบบมาตรฐาน

EP13

MCP พร้อมเรียน ▶ N × M → N + M · host / client / server · stdio · JSON-RPC · tools, resources, prompts, sampling · tool annotations · ประตูขออนุญาต · prompt injection · FastMCP · langchain-mcp-adapters · ch21 · 4 lab

EP14

Agent Skills พร้อมเรียน ▶ skill · SKILL.md · static / router / DAG · วงจรชีวิตของ skill · manifest · skill กับ fine-tuning · deepagents · ch22 · 4 lab

M6 หลาย agent ทำงานร่วมกัน แบ่งงานให้ทีม agent

EP15

Multi-Agent Systems พร้อมเรียน ▶ ทีมเดียวหรือ agent ตัวเดียว · supervisor + workers · message passing · blackboard · task graph · Contract Net · โหวต · debate · red team · safety monitor · LangGraph supervisor / swarm · ch24 · 4 lab

EP16

A2A Protocol พร้อมเรียน ▶ Agent Card · task กับสถานะเจ็ดแบบ · poll / SSE / push · part ข้อความ ไฟล์ JSON · registry และ version · A2A กับ MCP · scope และ audit log · a2a-sdk · ch23 · 4 lab

M7 วัดผลและความน่าเชื่อถือ รู้ได้อย่างไรว่า agent ดีขึ้นจริง

EP17

Evaluating Agents พร้อมเรียน ▶ environment: reset และ step · reward และ reward hacking · metric ของงานหลายขั้น · benchmark · eval harness และช่วงความเชื่อมั่น · LLM-as-judge และอคติ · panel, κ และ G-Eval · กับดักของการวัด · Inspect AI · ch14, ch20 · 4 lab

EP18

Testing and Observability พร้อมเรียน ▶ testing pyramid: mock และ circuit breaker · golden trajectory · กฎพฤติกรรม · ด่านเงินและเวลา · trace ด้วย OpenTelemetry · metrics และ logs · หมวดความพังและ replay · Arize Phoenix · §25.5–25.6 · 4 lab

M8 Framework, production และ UI ปิดท้ายด้วย capstone ที่มี UI ใช้งานได้จริง

EP19

Agent frameworks เร็วๆ นี้ เลือก framework ไหน ต่างกันอย่างไร · ch25

EP20

Agentic UI เร็วๆ นี้ streaming และ human-in-the-loop · research agent พร้อม UI · ch26

ผู้สอน

ผศ.ดร.รัตน์ชัยนันท์ ธรรมสุจริต

หัวหน้า Virtual Research Unit in Artificial Intelligence (VRU-AI)
ภาควิชาวิทยาการคอมพิวเตอร์ คณะวิทยาศาสตร์
มหาวิทยาลัยศรีนครินทรวิโรฒ

สิ่งที่ต้องมี

🐍

Python พื้นฐาน — อ่านและแก้ function, list, dict ได้ ไม่ต้องมีพื้น machine learning

🔑

OpenRouter API key — lab ใช้ Gemma 4 26B (open weights) รัน notebook หนึ่งรอบใช้เงินไม่ถึงหนึ่งบาท วิธีตั้งค่าอยู่ใน README

🌐

Browser — เปิด notebook ใน Google Colab ได้เลย ไม่ต้องติดตั้งอะไรบนเครื่อง

หมายเหตุเกี่ยวกับเนื้อหาและ license

ซีรีส์นี้ไม่ใช่สำเนาตำรา แต่ละตอนตอบคำถามหรือให้ทักษะหนึ่งอย่าง และอาจดึงเนื้อหาข้ามบท แกนหลักคือ Part V ของตำรา (บทที่ 15–26) ส่วน RL, alignment และ reasoning training (Part II–III) ไม่อยู่ในซีรีส์นี้

ตำราต้นฉบับเผยแพร่ภายใต้ CC BY-SA 4.0 งานดัดแปลงนี้จึงเผยแพร่ภายใต้ CC BY-SA 4.0 เช่นกัน ใช้คำทับศัพท์ภาษาอังกฤษสำหรับ technical terms

เอกสารอ้างอิง

Anthropic. 2025. Writing Effective Tools for AI Agents—with Agents. Anthropic Engineering. https://www.anthropic.com/engineering/writing-tools-for-agents.
Brown, Tom B., Benjamin Mann, Nick Ryder, et al. 2020. “Language Models Are Few-Shot Learners.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2005.14165.
Chen, Howard, Ramakanth Pasunuru, Jason Weston, and Asli Celikyilmaz. 2023. Walking down the Memory Maze: Beyond Context Limit Through Interactive Reading. https://arxiv.org/abs/2310.05029.
Dettmers, Tim, Mike Lewis, Younes Belkada, and Luke Zettlemoyer. 2022. “LLM.int8(): 8-Bit Matrix Multiplication for Transformers at Scale.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2208.07339.
Fedus, William, Barret Zoph, and Noam Shazeer. 2022. “Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity.” Journal of Machine Learning Research. https://arxiv.org/abs/2101.03961.
Greshake, Kai, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz, and Mario Fritz. 2023. “Not What You’ve Signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection.” ACM Workshop on Artificial Intelligence and Security (AISec). https://arxiv.org/abs/2302.12173.
Holtzman, Ari, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2020. “The Curious Case of Neural Text Degeneration.” International Conference on Learning Representations (ICLR). https://arxiv.org/abs/1904.09751.
Hugging Face. 2023. Mixture of Experts Explained. Hugging Face blog. https://huggingface.co/blog/moe.
Hugging Face. 2025a. Chat Templates. Transformers documentation. https://huggingface.co/docs/transformers/main/en/chat_templating.
Hugging Face. 2025b. Quantization Overview. Transformers documentation. https://huggingface.co/docs/transformers/main/en/quantization/overview.
Ji, Ziwei, Nayeon Lee, Rita Frieske, et al. 2023. “Survey of Hallucination in Natural Language Generation.” ACM Computing Surveys 55 (12). https://arxiv.org/abs/2202.03629.
Jiang, Albert Q., Alexandre Sablayrolles, Antoine Roux, et al. 2024. Mixtral of Experts. https://arxiv.org/abs/2401.04088.
Kadavath, Saurav, Tom Conerly, Amanda Askell, et al. 2022. Language Models (Mostly) Know What They Know. arXiv:2207.05221. https://arxiv.org/abs/2207.05221.
Karpathy, Andrej. 2024. Let’s Build the GPT Tokenizer. YouTube video. https://www.youtube.com/watch?v=zduSFxRajkE.
Kim, Sehoon, Suhong Moon, Ryan Tabrizi, et al. 2024. “An LLM Compiler for Parallel Function Calling.” International Conference on Machine Learning (ICML). https://arxiv.org/abs/2312.04511.
Kojima, Takeshi, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. 2022. “Large Language Models Are Zero-Shot Reasoners.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2205.11916.
LangChain. 2025. Workflows and Agents. LangGraph documentation. https://langchain-ai.github.io/langgraph/tutorials/workflows/.
Lewis, Patrick, Ethan Perez, Aleksandra Piktus, et al. 2020. “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2005.11401.
Madaan, Aman, Niket Tandon, Prakhar Gupta, et al. 2023. “Self-Refine: Iterative Refinement with Self-Feedback.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2303.17651.
Manakul, Potsawee, Adian Liusie, and Mark J. F. Gales. 2023. “SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models.” Conference on Empirical Methods in Natural Language Processing (EMNLP). https://arxiv.org/abs/2303.08896.
Nguyen, Minh Nhat, Andrew Baker, Clement Neo, et al. 2025. “Turning up the Heat: Min-p Sampling for Creative and Coherent LLM Outputs.” International Conference on Learning Representations (ICLR). https://arxiv.org/abs/2407.01082.
Ouyang, Long, Jeff Wu, Xu Jiang, et al. 2022. “Training Language Models to Follow Instructions with Human Feedback.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2203.02155.
Patil, Shishir G., Tianjun Zhang, Xin Wang, and Joseph E. Gonzalez. 2024. “Gorilla: Large Language Model Connected with Massive APIs.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2305.15334.
Platen, Patrick von. 2020. How to Generate Text: Using Different Decoding Methods for Language Generation with Transformers. Hugging Face blog. https://huggingface.co/blog/how-to-generate.
Pydantic. 2026. Pydantic Documentation: Models and Validators. https://docs.pydantic.dev/latest/.
Qin, Yujia, Shihao Liang, Yining Ye, et al. 2024. “ToolLLM: Facilitating Large Language Models to Master 16000+ Real-World APIs.” International Conference on Learning Representations (ICLR). https://arxiv.org/abs/2307.16789.
Roitman, Haggai. 2026. The Hitchhiker’s Guide to Agentic AI: From Foundations to Systems. https://doi.org/10.48550/arXiv.2606.24937.
Sarthi, Parth, Salman Abdullah, Aditi Tuli, Shubh Khanna, Anna Goldie, and Christopher D. Manning. 2024. “RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval.” International Conference on Learning Representations (ICLR). https://arxiv.org/abs/2401.18059.
Schick, Timo, Jane Dwivedi-Yu, Roberto Dessì, et al. 2023. “Toolformer: Language Models Can Teach Themselves to Use Tools.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2302.04761.
Schluntz, Erik, and Barry Zhang. 2024. Building Effective Agents. Anthropic. https://www.anthropic.com/research/building-effective-agents.
Sennrich, Rico, Barry Haddow, and Alexandra Birch. 2016. “Neural Machine Translation of Rare Words with Subword Units.” Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL). https://arxiv.org/abs/1508.07909.
Shinn, Noah, Federico Cassano, Edward Berman, et al. 2023. “Reflexion: Language Agents with Verbal Reinforcement Learning.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2303.11366.
Vaswani, Ashish, Noam Shazeer, Niki Parmar, et al. 2017. “Attention Is All You Need.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/1706.03762.
Wang, Lei, Chen Ma, Xueyang Feng, et al. 2024. “A Survey on Large Language Model Based Autonomous Agents.” Frontiers of Computer Science. https://arxiv.org/abs/2308.11432.
Wang, Lei, Wanyu Xu, Yihuai Lan, et al. 2023. “Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Models.” Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (ACL). https://arxiv.org/abs/2305.04091.
Wang, Xuezhi, Jason Wei, Dale Schuurmans, et al. 2023. “Self-Consistency Improves Chain of Thought Reasoning in Language Models.” International Conference on Learning Representations (ICLR). https://arxiv.org/abs/2203.11171.
Wei, Jason, Xuezhi Wang, Dale Schuurmans, et al. 2022. “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models.” Advances in Neural Information Processing Systems (NeurIPS). https://arxiv.org/abs/2201.11903.
Weng, Lilian. 2023. LLM Powered Autonomous Agents. Lil’Log. https://lilianweng.github.io/posts/2023-06-23-agent/.
Willard, Brandon T., and Rémi Louf. 2023. Efficient Guided Generation for Large Language Models. arXiv:2307.09702. https://arxiv.org/abs/2307.09702.
Xu, Binfeng, Zhiyuan Peng, Bowen Lei, et al. 2023. ReWOO: Decoupling Reasoning from Observations for Efficient Augmented Language Models. https://arxiv.org/abs/2305.18323.
Yao, Shunyu, Jeffrey Zhao, Dian Yu, et al. 2023. “ReAct: Synergizing Reasoning and Acting in Language Models.” International Conference on Learning Representations (ICLR). https://arxiv.org/abs/2210.03629.