dev-proPRO
OverviewLộ Trình HọcPhỏng VấnAI System
dev-pro— Thực chiến Frontend React, Next.js & Luyện phỏng vấn
contact@dev-pro.online•Code thật. Phỏng vấn thật.
AI Engineeringunderstand · build · evaluate

Lộ trình (3 tracks)

A01AI System Foundations
AI System Foundations0/2 hoàn thành
A02Agent Runtime & Orchestration
Agent Runtime & Orchestration0/3 hoàn thành
  • Bài học (3)
  • Agent Runtime & Harness28 phút · Trung cấp
  • Multi-agent, Safety & Evals24 phút · Nâng cao
  • Workflow, Agent hay Multi-agent Framework?40 phút · Nâng cao
A03Agent Skills Engineering
Agent Skills Engineering0/7 hoàn thành
Tiến độ0/12 bài
Agent Runtime & Orchestration
Nâng cao
40 phút
#Workflow
#Frameworks
#Trade-offs

Workflow, Agent hay Multi-agent Framework?

Chọn mức tự chủ và abstraction bằng failure model, state, control flow và observability—không bằng độ nổi tiếng của framework.

Core Mental Model

Bắt đầu bằng deterministic workflow; chỉ trao quyền chọn bước cho model khi variance của task tạo giá trị lớn hơn chi phí kiểm soát.

Những điều cần nắm chắc

Workflow có code path định trước; agent tự quyết định process và tool usage.

Multi-agent thêm coordination state, failure propagation và synthesis cost.

Framework được chọn sau khi đã biết state machine và reliability requirement.

Repository cũ có thể còn giá trị giáo dục nhưng không đồng nghĩa phù hợp production mới.

Nội dung bài viết

Complexity ladder trước framework matrix

Anthropic đề xuất đi từ augmented LLM đến prompt chaining, routing, parallelization, orchestrator-workers rồi mới tới autonomous agent. Mỗi nấc đổi latency, cost và failure surface. Nếu task phân rã ổn định, workflow code thường dễ test và vận hành hơn agent tự lập kế hoạch.

Multi-agent phù hợp khi subtasks thật sự độc lập hoặc cần context/role chuyên biệt. Nếu các worker liên tục chia sẻ mutable state hoặc sửa cùng artifact, coordination overhead có thể lớn hơn lợi ích song song.

Đọc framework qua primitive nó sở hữu

LangGraph tập trung graph state, durable execution và human-in-the-loop cho workflow dài. Semantic Kernel cung cấp agent abstraction, plugins và các orchestration pattern. AutoGen có đóng góp lớn về event-driven multi-agent, nhưng repository hiện khuyến nghị dự án mới xem Microsoft Agent Framework. CrewAI đưa role/task/crew lên abstraction cao hơn.

Không framework nào loại bỏ nhu cầu định nghĩa tool schema, permission, state ownership, termination và eval. Framework chỉ quyết định phần boilerplate nào được đóng gói và phần behavior nào trở nên implicit.

Swarm là case study về lifecycle của nguồn tham khảo

OpenAI Swarm minh họa hai primitive dễ hiểu: agent và handoff. Repository tự ghi rõ đây là educational/experimental và đã được thay thế cho production bởi OpenAI Agents SDK. Một source catalog tốt phải lưu cả status này, không chỉ URL.

Bài học tổng quát: luôn kiểm tra maintenance mode, migration note, experimental label và ngày cập nhật trước khi biến sample thành nền tảng kiến trúc.

Framework selection checklist

Vẽ state machine không phụ thuộc vendor trước: run, step, observation, checkpoint, approval, cancel và terminal states. Sau đó đánh giá framework theo durability, replay, tracing, interrupt/resume, TypeScript support, deployment model và khả năng thoát framework.

  • Control flow cố định hay model-driven?
  • State ephemeral, thread-scoped hay durable?
  • Có cần parallel, handoff hay evaluator-optimizer?
  • Ai sở hữu retry, idempotency và compensation?
  • Trace có đủ để tái hiện một failure production không?

Hướng triển khai đang hội tụ: agentic ở decision point, deterministic ở execution path

Các hệ sinh thái lớn đang hội tụ ở cùng một nguyên tắc: giữ model ở nơi cần semantic judgment, còn validation, permission, retry, state transition và artifact verification nằm trong code hoặc runtime. OpenAI gọi rõ ranh giới giữa direct tool calls và programmatic tool calling; Anthropic khuyến nghị tăng complexity theo nhu cầu; LangGraph và AutoGen đưa state, termination và coordination thành primitive quan sát được.

Một stack hiệu quả thường có bốn lớp: skills hoặc dynamic context để chỉ nạp expertise cần thiết; tools/MCP để chuẩn hóa capability; durable workflow để checkpoint và resume; eval/trace để chứng minh accuracy, efficiency và side effect. Multi-agent chỉ là topology tùy chọn ở trên bốn lớp này, không phải đích đến mặc định.

  • Dynamic context thay cho mega-prompt luôn nạp mọi thứ.
  • Bounded code path cho filtering, joining, validation và aggregation.
  • Model judgment tại routing, exception handling và final synthesis.
  • Human approval trước external write hoặc hành động khó đảo ngược.
  • Eval dataset và trace review đi cùng mỗi thay đổi prompt, skill hoặc tool.

Code & cấu trúc tham khảo

Decision sequence không phụ thuộc vendor

text
1Known steps + strict SLA -> deterministic workflow
2Distinct input categories -> router + specialized workflows
3Independent bounded subtasks -> parallel workers + deterministic synthesis
4Unknown task decomposition -> orchestrator-workers with budgets
5Long-running mutable process -> durable graph/runtime
6High-risk external side effects -> approval + idempotency + audit trail

Takeaway: Chọn topology trước, chọn library sau; nếu đổi framework mà mental model sụp đổ, abstraction ban đầu chưa đủ rõ.

Tài liệu đọc thêm

Repo, đặc tả và bài viết gốc để đi sâu sau bài học.

10 nguồn chọn lọc
Article
anthropic.com

Anthropic — Building effective agents

Complexity ladder và các workflow pattern composable.

Repository
github.com

LangGraph

Low-level orchestration cho long-running stateful agents.

Docs
learn.microsoft.com

Microsoft Semantic Kernel Agent Framework

Agent abstraction, plugins và orchestration patterns.

Repository
github.com

Microsoft AutoGen

Kiến trúc multi-agent và trạng thái maintenance hiện tại.

Repository
github.com

OpenAI Swarm

Case study educational về agent handoff; không dùng cho production mới.

Docs
docs.crewai.com

CrewAI documentation

Role/task/crew abstraction trong ecosystem multi-agent.

Docs
developers.openai.com

OpenAI — Programmatic Tool Calling

Chạy bounded tool-heavy stage bằng code và trả structured result nhỏ hơn.

Repository
github.com

LangGraphJS architecture specification

Channels, checkpointer và Pregel execution engine phía dưới graph API.

Docs
microsoft.github.io

AutoGen architecture and AgentChat

AgentChat abstraction trên event-driven AutoGen Core.

Repository
github.com

Google Agent Development Kit

Open-source runtime và patterns để xây, đánh giá, triển khai agent.