Multi-agent, Safety & Evals
Phân rã công việc, điều phối sub-agent và đánh giá hành động bằng evidence.
Multi-agent chỉ có lợi khi công việc chia được thành các nhánh đủ độc lập; chất lượng vẫn phụ thuộc contract giao việc, isolation, synthesis và verification.
Những điều cần nắm chắc
Mỗi sub-agent cần scope, output contract, budget và ownership rõ.
Shared filesystem tạo rủi ro ghi đè và merge conflict.
Parent agent phải kiểm chứng, không chỉ nối kết quả con.
Eval cần đo tool correctness, side effect, recovery, latency và cost.
Nội dung bài viết
Song song chỉ hiệu quả khi workstream độc lập
Accessibility audit, bundle analysis và test review có thể chạy song song vì mỗi nhánh có artifact riêng. Ba agent cùng sửa một component thường chỉ tạo coordination overhead và conflict.
Security boundary phải được áp dụng cho từng sub-agent. Việc parent có quyền không có nghĩa mọi child đều nên nhận cùng tool và cùng phạm vi dữ liệu.
Code & cấu trúc tham khảo
Fan-out có bounded workers và deterministic synthesis
1const contracts = [2 { role: 'accessibility', files: uiFiles, output: FindingSchema.array() },3 { role: 'performance', files: bundleFiles, output: BudgetResultSchema },4 { role: 'tests', files: testFiles, output: CoverageRiskSchema },5];67const results = await Promise.all(8 contracts.map((contract) =>9 runWorker({10 contract,11 tools: toolsFor(contract.role),12 maxSteps: 8,13 writeAccess: false,14 })15 )16);1718const verified = results.map(validateAgainstContract);19return synthesizeBySeverity(verified);Takeaway: Parallelism chỉ nằm ở workstream độc lập; schema validation và synthesis order vẫn deterministic.
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.
Multi-agent — OpenAI API
Phối hợp nhiều sub-agent và tổng hợp kết quả.
Evaluate agent workflows
Thiết kế evaluation cho workflow agent.
LangGraph — Multi-agent patterns
Supervisor, handoff và custom graph; kèm cảnh báo không phải task phức tạp nào cũng cần multi-agent.
Microsoft AutoGen AgentChat teams
Round-robin, selector team, termination condition và stateful team patterns.
Google ADK — Multi-agent systems
Hierarchy, delegation và workflow agents trong Agent Development Kit.
Anthropic — Building effective agents
Orchestrator-workers, parallelization và evaluator-optimizer patterns.