Series · 42 parts
AI for Developers — LLMs, Agents & Coding
The complete AI path for developers in one series: from the history of AI and how LLMs work (tokens, sampling, embeddings, prompting) to choosing models, RAG and fine-tuning, building agents (tool use, architecture, patterns, MCP), and finally coding day-to-day with AI agents and Cursor — hands-on and hype-free.
-
Hành trình 70 năm của AI qua 7 era: symbolic AI, expert systems, statistical learning, deep learning, transformer, LLM, đến reasoning + agentic. Mỗi era có winter và breakthrough — bài học cho dev hôm nay.
-
3 tầng của prompt (system/user/assistant), 6 nguyên tắc viết prompt hiệu quả, sampling parameters (temperature, top-p, top-k, stopping criteria), personalization qua system prompt, multi-turn strategy, và template tái dùng cho dev.
-
Agent prompt design: messages/roles, personas, few-shot trade-offs, CoT vs reasoning models, JSON schemas, templates, injection guards, iteration.
-
Token là đơn vị compression, đơn vị suy nghĩ, và đơn vị tính tiền của LLM. Bài đi sâu BPE tokenization, tiếng Việt đắt 2-3x, thinking tokens, và framework chọn subscription vs API.
-
Tokens are the atomic unit of LLM memory and cost. Learn subword tokenization, context window math, and agent budgeting before you ship.
-
4 cơ chế kỹ thuật mà dev nào dùng LLM cũng nên hiểu sâu: BPE tokenization step-by-step, math của temperature scaling, top-p (nucleus) vs top-k sampling, sampling pipeline hoàn chỉnh, và parameter cheatsheet.
-
How LLMs turn logits into tokens — temperature, top_p, top_k, penalties, seeds — and why agent builders tune sampling differently for tool calls vs brainstorming.
-
EOS tokens, max_tokens, stop sequences, and finish_reason handling for production LLM agents — streaming, truncation, and runaway cost guards.
-
Mổ xẻ embedding từ Word2Vec đến text-embedding-3: hình học của ý nghĩa, distance metrics, evaluation MTEB, visualization (PCA/t-SNE/UMAP), multimodal CLIP, và 6 cạm bẫy practical (anisotropy, drift, dimensionality).
-
7 dimension đánh giá model LLM, so sánh thực chiến Claude/GPT/Gemini/Llama family đầu 2026, thinking model vs regular, open-source vs proprietary, và decision framework để chọn model đúng task theo chi phí + chất lượng.
-
A senior engineer framework for model selection — capability tiers, context, modality, cost, privacy, tool use — plus routing, cascades, and why benchmarks lie.
-
Tổng quan ecosystem LLM open weight 2026: 5 family chính, công cụ chạy local (Ollama, LM Studio, vLLM, llama.cpp), quantization formats (GGUF/GPTQ/AWQ), license gotcha, và hardware budget từ laptop đến cluster.
-
Bên trong vision-language model (CLIP, ViT, patch tokenization), audio (Whisper, native audio LLM), video (Gemini 2.0+), 3 architecture pattern (early/late/cross fusion), use case practical, và 7 limitation cần biết.
-
Hallucination không phải bug mà là bản chất của next-token prediction. Bài đi sâu vào 4 cơ chế gây hallucinate, taxonomy 6 dạng dev thường gặp, và pyramid 6 tầng phòng thủ từ type-check đến human review.
-
Pattern thực chiến giảm chi phí LLM ở scale: prompt caching, semantic cache, model routing, distillation, batch API, quantization, streaming + early stop, và framework đo ROI khi self-host.
-
Mổ xẻ alignment LLM: RLHF process step-by-step, Constitutional AI của Anthropic, DPO, jailbreak techniques (prompt injection, DAN, encoding attacks), red teaming, và checklist defense practical cho production AI app.
-
Why eval is the hardest part of shipping agents — golden datasets, offline vs online metrics, LLM-as-judge rubrics, human agreement, and regression in CI.
-
When to prompt, retrieve, or fine-tune: knowledge vs behavior, data needs, cost, privacy, SFT/LoRA/DPO — and why most teams start with prompt + RAG.
-
Mổ xẻ RAG: indexing pipeline, embeddings, vector DB, chunking strategies, retrieval (dense/sparse/hybrid), reranking, 8 failure mode phổ biến, và quyết định khi nào dùng RAG vs long context vs fine-tuning.
-
Fine-tuning vs prompt vs RAG — quyết định framework. 4 loại fine-tune (full, LoRA, QLoRA, instruction tuning), data preparation, cost analysis, và 6 cạm bẫy phổ biến (overfitting, catastrophic forgetting).
-
How senior engineers pack system prompts, tools, history, RAG, and output reserve into a fixed context window — and manage memory when the budget breaks.
-
How LLM function calling bridges models to the world: JSON Schema tools, the request→execute→result loop, parallel calls, validation, MCP, and security.
-
Mổ xẻ kiến trúc bên trong 1 AI agent: agent loop, tool use mechanics, 3 tầng memory, planning patterns (ReAct, Plan-and-Execute, Tree of Thoughts), multi-agent system, và 7 cạm bẫy phổ biến.
-
ReAct, Reflection, and Planning for LLM agents — when to use each, guardrails against runaway loops, and links to tool use and orchestration.
-
Tại sao 1 agent không đủ cho dự án lớn, cách dùng Orchestrator pattern với 6 kiểu điều phối (fan-out, validation chain, specialist routing...), setup thực tế, và anti-patterns cần tránh.
-
Tìm hiểu về MCP - chuẩn kết nối mở cho AI Agents như Claude, Cursor, Copilot: transport layer, JSON-RPC 2.0, primitives và sơ đồ kiến trúc đầy đủ.
-
Coding agent khác autocomplete ở chỗ nào, agent loop (observe-think-act) hoạt động ra sao, 4 level autonomy, khi nào để agent tự chạy vs khi nào human-in-the-loop, và những sai lầm của dev mới chuyển sang workflow agent-based.
-
Từ mindset đúng (agent là cộng sự, không phải autocomplete), công thức CARET cho prompt, chuyển spec thành task, đến 5 patterns thực chiến và anti-patterns khi làm việc với coding agent.
-
A bilingual master guide to AI coding agents in 2026 — the 5 layers of control (rules, permissions, commands, skills, sub-agents), local vs cloud, single-to-multi-agent progression, prompting, and cost/context management.
-
A bilingual guide on the developer mindset for working effectively with AI. From crafting prompts to defining rules and skills — the thinking framework that separates power users from casual prompters.
-
Chiến lược dùng AI để onboard codebase lớn: bird-eye view trước, entry-point mapping, dependency tracing, git history archaeology. So sánh với đọc code tuần tự và grep thủ công — thứ đã cũ từ 2023.
-
Workflow 4 pha để ship feature với AI agent: từ ticket mơ hồ đến PR merge. Nguyên tắc decomposition, spec-first, vertical slice, và những prompt template dùng đi dùng lại cho scaffold + review.
-
Cấu trúc debug với AI: reproduce trước, hypothesis sau, fix cuối. Kỹ thuật minimal repro, git bisect với AI, stacktrace decoding, heisenbug hunting, và lý do vì sao AI thường fix sai khi bạn chưa verify cause.
-
Review code AI sinh ra sao cho không bị lừa, self-review trước PR, test pyramid với AI, generate test không phải generate coverage giả, flaky test hunting, và checklist review chi tiết dùng được ngay.
-
Customization stack 5 tầng: Rules, Skills, MCP, Sub-agents, Hooks. Chiến lược progressive customization, khi nào team-share và khi nào giữ personal, và cách maintain để config không biến thành technical debt sau 6 tháng.
-
Hệ thống config files điều khiển coding agent (Claude Code + Cursor): CLAUDE.md, settings.json, .mdc rules, MCP servers, commands, sub-agents — ý nghĩa, cách dùng, và setup thực tế.
-
Rule là gì, khác Skill ra sao, 3 loại scope (alwaysApply / globs / manual), cấu trúc .mdc file, best practices viết rule ngắn-chất, và 6 rule mẫu sẵn dùng cho project TypeScript/frontend.
-
Skill là gì, khác prompt/rule ra sao, cách viết SKILL.md chuẩn, frontmatter, progressive disclosure, và những sai lầm phổ biến khi lần đầu tạo skill cho Cursor AI agent.
-
Sub-agent là gì, vì sao cần, các loại subagent trong Cursor (generalPurpose, explore, shell...), cách delegate đúng cách, pattern song song vs tuần tự, và những sai lầm làm parent agent "nổ" context.
-
Viết một skill handoff giữ tài liệu sống trong notes/ (progress, handoff log, architecture) và update mỗi lần đổi code, để agent mới resume mà không explore lại. Build từng bước + cách nâng lên global skill.
-
Case study end-to-end: implement reading progress indicator cho blog Astro. Đi qua đủ 4 pha (Plan → Scaffold → Build → Polish), dùng Rules + Skills + Sub-agent, review AI output, debug 1 edge case thật. Khép lại series Coding Agents.
-
A bilingual, hype-free guide for frontend developers in the AI era: what actually changed, the 2026 web tech landscape, new ways of working with agents, the skills that rise vs fade, and a concrete 30/60/90 survival playbook.