Context Engineering: Chìa khóa xây dựng AI Agent hiệu quả

Context Engineering là chiến lược quản lý toàn bộ thông tin (context) cho AI Agent, khác với Prompt Engineering. Tìm hiểu 3 kỹ thuật cốt lõi giúp Agent thông minh hơn và duy trì sự tập trung dài hạn.

Trong những năm đầu của kỷ nguyên AI tạo sinh, Prompt Engineering từng là kỹ năng được săn đón, giúp chúng ta tìm ra những từ ngữ và cấu trúc tốt nhất để khai thác sức mạnh của mô hình ngôn ngữ lớn (LLM). Tuy nhiên, khi chúng ta chuyển từ các tác vụ một lần (one-shot task) sang xây dựng các AI Agent (Tác nhân AI) có khả năng hoạt động tự chủ, thực hiện nhiều bước và ghi nhớ thông tin trong thời gian dài, một khái niệm mới đã nổi lên và trở nên quan trọng hơn: Context Engineering (Kỹ thuật Ngữ cảnh).
Bài viết này sẽ làm rõ Context Engineering là gì, nó khác biệt như thế nào so với Prompt Engineering và những chiến lược cốt lõi mà các kỹ sư AI tại Anthropic đang áp dụng để xây dựng các Agent thông minh và đáng tin cậy.

1. Context Engineering là gì?

Context (Ngữ cảnh) đề cập đến toàn bộ tập hợp các tokens được đưa vào khi lấy mẫu (sampling) từ một LLM. Nó là nguồn tài nguyên quan trọng, nhưng có giới hạn, cung cấp cho mô hình mọi thứ nó cần để đưa ra quyết định hoặc tạo ra đầu ra mong muốn.

Context Engineering (CE) là tập hợp các chiến lược nhằm quản lý và tối ưu hóa tiện ích của các tokens đó, chống lại các giới hạn cố hữu của LLM (như cửa sổ ngữ cảnh giới hạn), nhằm mục đích:

Tìm ra cấu hình ngữ cảnh nào có khả năng tạo ra hành vi mong muốn của mô hình nhất. Nói cách khác, CE không chỉ là về việc bạn viết gì trong prompt, mà là về việc bạn sắp xếp và duy trì toàn bộ trạng thái thông tin có sẵn cho LLM tại bất kỳ thời điểm nào.

2. Khác biệt cốt lõi giữa Context Engineering và Prompt Engineering

Anthropic xem Context Engineering là sự tiến hóa tự nhiên của Prompt Engineering.

| Tiêu chí | Prompt Engineering | Context Engineering |
| ————- | ——————————– | —————————————- |
| **Trọng tâm** | Viết hướng dẫn (prompt) hiệu quả | Quản lý toàn bộ ngữ cảnh của mô hình |
| **Phạm vi** | Một tác vụ đơn lẻ | Nhiều vòng tương tác, trạng thái dài hạn |
| **Cách làm** | Tối ưu từng câu | Tối ưu toàn bộ luồng thông tin |
| **Khi dùng** | Một câu hỏi – một câu trả lời | Agent tự hoạt động, tự học, tự nhớ |

Prompt Engineering đề cập đến các phương pháp viết và tổ chức hướng dẫn cho mô hình ngôn ngữ lớn (LLM) nhằm đạt được kết quả tối ưu (bạn có thể tham khảo thêm trong tài liệu hướng dẫn của chúng tôi về các chiến lược Prompt Engineering hiệu quả).

Trong khi đó, Context Engineering là tập hợp các chiến lược nhằm lựa chọn và duy trì tập hợp token (thông tin) tối ưu trong quá trình suy luận (inference) của LLM — bao gồm toàn bộ thông tin khác có thể được đưa vào ngữ cảnh, không chỉ riêng phần prompt.

Trong giai đoạn đầu của việc phát triển ứng dụng với LLM, prompting chiếm phần lớn công việc của kỹ sư AI, vì phần lớn các trường hợp sử dụng (ngoài trò chuyện thông thường) yêu cầu prompt được tối ưu cho các tác vụ một lần như phân loại hoặc sinh văn bản.

Đúng như tên gọi, trọng tâm chính của Prompt Engineering là cách viết prompt hiệu quả, đặc biệt là system prompt (hướng dẫn hệ thống).
Tuy nhiên, khi chúng ta tiến tới việc xây dựng các tác nhân AI (AI Agents) có khả năng mạnh mẽ hơn — hoạt động qua nhiều vòng suy luận (multi-turn inference) và thời gian dài hơn (long-horizon tasks) — chúng ta cần có các chiến lược để quản lý toàn bộ trạng thái ngữ cảnh, bao gồm:
– System instructions (hướng dẫn hệ thống)
– Tools (công cụ mà agent có thể gọi)
– Model Context Protocol (MCP)
– Dữ liệu bên ngoài
– Lịch sử tin nhắn

Một Agent hoạt động theo vòng lặp sẽ liên tục tạo ra ngày càng nhiều dữ liệu có thể liên quan đến các vòng suy luận tiếp theo. Những thông tin này phải được tinh lọc một cách tuần hoàn để giữ lại các phần quan trọng nhất.
Context Engineering chính là nghệ thuật và khoa học của việc chọn lọc những gì sẽ được đưa vào cửa sổ ngữ cảnh giới hạn từ “vũ trụ thông tin” liên tục mở rộng đó.

3. Các yếu tố cốt lõi cần chú ý khi phát triển AI Agent
Nguyên tắc vàng của Context Engineering là: Tìm tập hợp tokens có tín hiệu cao (high-signal tokens) nhỏ nhất để tối đa hóa xác suất đạt được kết quả mong muốn.

3.1. Coi Context là Tài nguyên Hữu hạn
Các nghiên cứu cho thấy, giống như con người có giới hạn bộ nhớ làm việc (working memory), LLM cũng có một “ngân sách chú ý” (Attention Budget) và gặp hiện tượng Context Rot (khả năng nhớ lại thông tin giảm khi số lượng tokens tăng lên).

Do đó, các kỹ sư cần:
– Tối giản hóa: Chỉ đưa vào thông tin thực sự cần thiết.
– Tinh gọn Tools: Thiết kế các công cụ (Tools) không bị chồng chéo chức năng, rõ ràng và tạo thành một bộ tối thiểu để tránh gây mơ hồ cho Agent khi ra quyết định.
Sử dụng ví dụ (Few-shot) chọn lọc: Thay vì nhồi nhét một danh sách dài các trường hợp biên, hãy chọn lọc các ví dụ điển hình, đa dạng (canonical examples) để minh họa hành vi mong đợi.

3.2. Tối ưu Hướng dẫn Hệ thống (System Prompts)
Prompt ban đầu là một phần không thể thiếu của ngữ cảnh. Nó cần đạt đến “độ cao phù hợp” (Right Altitude) – trạng thái cân bằng hoàn hảo:
– Tránh quá cứng nhắc: Không nên mã hóa logic phức tạp, dễ gãy (brittle, hardcoded logic) vào prompt.
– Tránh quá mơ hồ: Không cung cấp hướng dẫn quá chung chung, thiếu tín hiệu cụ thể.
– Tối ưu: Sử dụng ngôn ngữ đơn giản, trực tiếp. Tổ chức prompt thành các phần riêng biệt (, ) bằng thẻ XML hoặc Markdown để mô hình dễ dàng phân tách thông tin.

3.3. Chiến lược quản lý Ngữ cảnh cho Tác vụ dài hạn (Long-Horizon Tasks)
Đối với các Agent cần hoạt động liên tục trong thời gian dài (như di chuyển codebase lớn, nghiên cứu chuyên sâu), vượt quá giới hạn của cửa sổ ngữ cảnh, Context Engineering cung cấp ba kỹ thuật chính:

Vì sao Context Engineering lại quan trọng trong việc xây dựng AI Agent mạnh mẽ

Mặc dù các mô hình ngôn ngữ lớn (LLM) có tốc độ xử lý cao và khả năng quản lý khối lượng dữ liệu ngày càng lớn, nhưng chúng – giống như con người – vẫn có giới hạn về khả năng tập trung và dễ bị “rối loạn thông tin” khi ngữ cảnh trở nên quá lớn. Các nghiên cứu dạng “needle-in-a-haystack” (tìm kim trong đống rơm) đã phát hiện ra một hiện tượng gọi là context rot — tức là khi số lượng token trong cửa sổ ngữ cảnh tăng lên, khả năng của mô hình trong việc ghi nhớ và truy xuất chính xác thông tin từ ngữ cảnh đó lại giảm xuống.

1. Context là tài nguyên có giới hạn

Dù một số mô hình có thể suy giảm chậm hơn, nhưng hiện tượng này xảy ra ở tất cả các LLM. Vì vậy, ngữ cảnh phải được xem như một tài nguyên hữu hạn, có lợi ích giảm dần theo từng token thêm vào.Giống như con người chỉ có một dung lượng bộ nhớ làm việc (working memory) nhất định, LLM cũng có “ngân sách chú ý” (attention budget) mà nó sử dụng khi xử lý khối lượng lớn ngữ cảnh. Mỗi token mới được thêm vào đều “tiêu tốn” một phần ngân sách đó, khiến việc chọn lọc thông tin đưa vào mô hình trở nên vô cùng quan trọng.

2. Giới hạn bắt nguồn từ kiến trúc Transformer

Nguồn gốc của sự khan hiếm “chú ý” này nằm ở kiến trúc Transformer – nền tảng của các LLM hiện nay. Trong kiến trúc này, mỗi token có thể “chú ý” đến mọi token khác trong toàn bộ ngữ cảnh, tạo ra n² mối quan hệ cặp đôi cho n token. Khi độ dài ngữ cảnh tăng lên: Khả năng của mô hình trong việc duy trì các mối quan hệ này bị kéo căng, dẫn đến sự đánh đổi tự nhiên giữa kích thước ngữ cảnh và độ tập trung của sự chú ý. Ngoài ra, LLM được huấn luyện chủ yếu trên các chuỗi ngắn, vì vậy chúng có ít kinh nghiệm và ít tham số chuyên biệt hơn cho các mối quan hệ phụ thuộc dài hạn trên toàn ngữ cảnh.

3. Giải pháp kỹ thuật giúp mở rộng ngữ cảnh (nhưng không hoàn hảo)

Một số kỹ thuật như position encoding interpolation (nội suy mã hóa vị trí) giúp mô hình xử lý chuỗi dài hơn bằng cách thích ứng chúng với phạm vi ngữ cảnh ngắn hơn mà mô hình đã được huấn luyện. Tuy nhiên, điều này có thể làm giảm độ chính xác trong việc hiểu vị trí token, khiến hiệu năng giảm dần chứ không sụp đổ hoàn toàn.

Kết quả là: Mô hình vẫn hoạt động tốt với ngữ cảnh dài, nhưng có thể mất độ chính xác trong việc truy xuất thông tin hoặc suy luận dài hạn, so với khi làm việc với ngữ cảnh ngắn hơn.

Giải phẫu của một ngữ cảnh hiệu quả

Vì các mô hình ngôn ngữ lớn (LLM) bị giới hạn bởi “ngân sách chú ý” (attention budget) hữu hạn, kỹ thuật xây dựng ngữ cảnh hiệu quả là tìm ra tập hợp nhỏ nhất của các token có giá trị cao (high-signal tokens) — tức là những phần thông tin cô đọng, quan trọng — sao cho tối đa hóa khả năng đạt được kết quả mong muốn.
Tuy nhiên, việc áp dụng nguyên tắc này trong thực tế không hề đơn giản. Dưới đây là những hướng dẫn cụ thể về cách áp dụng nó cho các thành phần khác nhau trong ngữ cảnh:

1. System prompt — phải cực kỳ rõ ràng và đúng “độ cao”

Phần system prompt nên được viết bằng ngôn ngữ đơn giản, trực tiếp, truyền đạt ý tưởng ở đúng “độ cao” (altitude) phù hợp cho tác nhân (agent).
“Độ cao phù hợp” ở đây chính là vùng Goldilocks — không quá cụ thể, cũng không quá mơ hồ. Hai sai lầm phổ biến khi viết system prompt là:

Quá chi tiết:
Một số kỹ sư cố gắng mã hóa những logic phức tạp vào trong prompt để điều khiển hành vi của agent một cách chính xác tuyệt đối. Cách làm này dễ gãy và khó bảo trì, vì chỉ cần thay đổi nhỏ cũng khiến toàn bộ hệ thống phản ứng sai.

Quá chung chung:
Ngược lại, có những prompt chỉ cung cấp hướng dẫn mơ hồ, không đưa ra tín hiệu cụ thể cho mô hình về loại kết quả mong đợi. Trong trường hợp này, mô hình giả định sai ngữ cảnh chia sẻ và dễ sinh ra phản hồi lệch hướng.

***** Giải pháp tối ưu ******
Tạo prompt ở “độ cao vừa phải” — đủ cụ thể để hướng dẫn hành vi rõ ràng, nhưng đủ linh hoạt để mô hình có thể suy luận và thích ứng.
Nói cách khác, hãy đưa ra heuristics mạnh (nguyên tắc định hướng) thay vì “kịch bản cứng nhắc”.

2. Cấu trúc prompt rõ ràng, gọn gàng

Chúng tôi khuyến khích tổ chức prompt thành các phần riêng biệt, ví dụ như:

## Tool guidance
## Output description

Bạn có thể dùng XML tag hoặc tiêu đề Markdown để phân tách rõ ràng từng phần.Tuy nhiên, khi các mô hình ngày càng thông minh hơn, cách định dạng có thể sẽ dần ít quan trọng hơn — trọng tâm vẫn là nội dung và tính rõ ràng giữ lượng thông tin ở mức “tối thiểu đầy đủ”

Bất kể bạn chọn cấu trúc như thế nào, mục tiêu chính là:
“Cung cấp lượng thông tin nhỏ nhất nhưng vẫn đủ để mô hình hiểu và thực hiện đúng hành vi mong muốn.”
“Tối thiểu” không có nghĩa là ngắn gọn đến mức thiếu thông tin. Agent vẫn cần được cung cấp đầy đủ dữ kiện ban đầu để hành xử đúng.

Cách làm tốt nhất:

Bắt đầu bằng một prompt tối giản, thử nghiệm nó với mô hình tốt nhất hiện có, sau đó bổ sung hướng dẫn hoặc ví dụ cụ thể dựa trên những lỗi phát sinh trong giai đoạn thử nghiệm đầu tiên.
Thiết kế công cụ (Tools) cho Agent các công cụ cho phép agent tương tác với môi trường và lấy thêm ngữ cảnh mới trong quá trình làm việc.

Vì công cụ là “hợp đồng” giữa agent và thế giới bên ngoài, nên việc thiết kế chúng cần ưu tiên hiệu quả, cụ thể:
Trả về thông tin một cách tiết kiệm token, hướng dẫn hành vi của agent sao cho hiệu quả và hợp lý.
Trong bài “Writing tools for AI agents – with AI agents”, Anthropic khuyến nghị rằng:
– Công cụ nên dễ hiểu đối với mô hình,
– Có ít chồng chéo chức năng,
– Giống như các hàm trong codebase tốt — tự chứa, rõ ràng, chịu lỗi tốt,

Các tham số đầu vào nên mô tả rõ ràng, không nhập nhằng, và phù hợp với khả năng của mô hình.

Sai lầm phổ biến:
Một bộ công cụ “phình to” quá mức — chứa quá nhiều chức năng hoặc khiến agent bối rối khi chọn công cụ nào để dùng.
Nếu một kỹ sư con người còn không chắc nên dùng công cụ nào, thì đừng mong một AI agent làm tốt hơn.

Giải pháp: Xây dựng một tập công cụ tối thiểu khả dụng (minimal viable toolset) — điều này giúp việc bảo trì dễ hơn và ngữ cảnh gọn hơn trong các tương tác dài hạn.

5. Ví dụ minh họa (Few-shot prompting)

– Cung cấp ví dụ — hay còn gọi là few-shot prompting — là một thực hành tốt đã được chứng minh qua thời gian.
Nhưng: Đừng “nhồi nhét” hàng loạt tình huống ngoại lệ (edge cases) vào prompt để cố gắng bao phủ mọi quy tắc có thể xảy ra.
Thay vào đó, hãy chọn lọc một bộ ví dụ tiêu biểu, đa dạng và mang tính chuẩn mực (canonical), thể hiện hành vi mong muốn của agent.
Với một mô hình ngôn ngữ, “một ví dụ hay đáng giá hơn cả ngàn dòng hướng dẫn”.
– Giữ ngữ cảnh gọn mà tinh dù bạn đang làm việc với system prompt, công cụ, ví dụ, hay lịch sử hội thoại, hãy nhớ nguyên tắc vàng: “Giữ cho ngữ cảnh có thông tin, nhưng chặt chẽ.”

Mục tiêu của context engineering không phải là nhồi nhét dữ liệu,
mà là chọn lọc thông minh — sao cho mỗi token đều có giá trị đóng góp rõ ràng.

Sự tiến hóa của agent và tầm quan trọng của ngữ cảnh. Khi các mô hình nền tảng (base models) ngày càng thông minh hơn, mức độ tự chủ của agent cũng tăng lên.
Một agent có thể tự điều hướng trong những không gian vấn đề phức tạp, phục hồi sau lỗi, và tự học từ môi trường — điều mà trước đây phải dựa vào kỹ sư con người.

Cùng với sự tiến hóa đó, tư duy thiết kế ngữ cảnh (context design) cũng thay đổi.
Nếu trước đây, nhiều ứng dụng AI chỉ sử dụng kỹ thuật truy xuất ngữ cảnh trước khi suy luận (pre-inference retrieval) — ví dụ, dùng embeddings để lấy ra những đoạn thông tin quan trọng trước khi gửi vào model — thì nay, xu hướng mới là “just-in-time context retrieval”.

– “Just-in-time” – Cung cấp ngữ cảnh đúng lúc thay vì tải trước toàn bộ dữ liệu liên quan, các agent hiện đại chỉ lưu lại những “định danh nhẹ” (lightweight identifiers) như:
– Đường dẫn tệp (file paths),
– Câu truy vấn đã lưu (stored queries),
– Liên kết web (URLs), v.v.
=> Rồi khi cần, agent sẽ tự động gọi công cụ để tải dữ liệu vào ngữ cảnh tại thời điểm runtime.

Ví dụ:
👉 Claude Code – giải pháp “agentic coding” của Anthropic – sử dụng chiến lược này để phân tích dữ liệu phức tạp trên cơ sở dữ liệu lớn. Thay vì nạp toàn bộ dataset, mô hình chỉ viết các truy vấn có mục tiêu, lưu kết quả, và dùng lệnh Bash như head hay tail để xem xét các phần cần thiết.

Cách tiếp cận này bắt chước nhận thức của con người:
chúng ta không ghi nhớ toàn bộ dữ liệu, mà dùng hệ thống tổ chức bên ngoài — như thư mục, hộp thư, hay bookmark — để truy xuất đúng thông tin khi cần. Metadata – Cấu trúc giúp agent hiểu ngữ cảnh: Không chỉ tiết kiệm dung lượng, metadata của các tệp và tham chiếu còn cung cấp tín hiệu quan trọng giúp agent suy luận.

Ví dụ:
Một tệp tên test_utils.py nằm trong thư mục tests/ mang ý nghĩa khác hoàn toàn so với tệp cùng tên trong src/core_logic/.
Cấu trúc thư mục, quy ước đặt tên, và dấu thời gian (timestamp)
→ tất cả đều giúp agent hiểu mục đích và mức độ liên quan của thông tin.

Khả năng tự khám phá ngữ cảnh (Progressive disclosure). Khi cho phép agent tự do điều hướng và truy xuất dữ liệu, ta mở ra khả năng “khám phá ngữ cảnh dần dần” — nghĩa là agent tự tìm ra ngữ cảnh liên quan thông qua trải nghiệm.

Mỗi hành động tạo ra thêm dữ kiện cho vòng suy luận kế tiếp:
– Kích thước file → gợi ý độ phức tạp,
– Tên file → ám chỉ mục đích,
– Thời gian cập nhật → chỉ ra mức độ mới và liên quan.

Agent dần xây dựng bức tranh hiểu biết từng lớp một, chỉ giữ lại thông tin cần thiết trong “bộ nhớ làm việc”, và dùng chiến lược ghi chú (note-taking) để lưu lại phần còn lại.

Kết quả là: Agent tập trung vào phần ngữ cảnh liên quan nhất, thay vì bị “chìm” trong lượng thông tin khổng lồ và nhiễu.

Hiệu năng vs. Tự chủ – Bài toán đánh đổi

Tất nhiên, truy xuất ngữ cảnh lúc runtime chậm hơn so với việc dùng dữ liệu đã được tính toán sẵn.
Hơn nữa, cần kỹ sư giàu kinh nghiệm để thiết kế công cụ và chiến lược điều hướng hợp lý.
Nếu không có định hướng rõ ràng, agent có thể:
– Dùng sai công cụ,
– Đi vào ngõ cụt,
– Hoặc bỏ lỡ thông tin quan trọng.
=> Do đó, trong nhiều tình huống, chiến lược lai (hybrid) là tối ưu:
Một phần ngữ cảnh được tải sẵn để đảm bảo tốc độ, phần còn lại được agent tự truy xuất khi cần.

Ví dụ:
👉 Claude Code nạp sẵn các tệp CLAUDE.md vào ngữ cảnh, nhưng vẫn có thể dùng glob hoặc grep để tự tìm file đúng lúc, tránh lỗi chỉ mục cũ hoặc cây cú pháp phức tạp. Chiến lược này đặc biệt phù hợp với môi trường ổn định như pháp lý hay tài chính, nơi dữ liệu ít thay đổi nhưng vẫn cần độ chính xác cao.Kỹ thuật context engineering cho tác vụ dài hạn

Các tác vụ “dài hơi” — như chuyển đổi toàn bộ codebase hoặc dự án nghiên cứu dài hạn — đòi hỏi agent phải:
– Duy trì tính mạch lạc và mục tiêu trong suốt quá trình, Làm việc qua hàng ngàn bước, vượt xa giới hạn context window của mô hình.
– Chờ đợi “context window lớn hơn” không phải là lời giải duy nhất. Bởi vì, dù dài đến đâu, ngữ cảnh vẫn có thể bị nhiễm nhiễu (context pollution) hoặc chứa thông tin lỗi thời.

Anthropic đề xuất 3 kỹ thuật giúp agent làm việc hiệu quả hơn với thời gian dài:
– Compaction – nén và tổng hợp thông tin cũ để tiết kiệm context,
– Structured note-taking – ghi chú có cấu trúc, giúp agent nhớ lại logic,
– Multi-agent architectures – chia tác vụ lớn thành nhiều agent nhỏ cùng phối hợp.

Compaction – Nén ngữ cảnh thông minh

Compaction là kỹ thuật tóm tắt và nén lại nội dung khi cuộc hội thoại hoặc tác vụ của agent bắt đầu chạm đến giới hạn context window.
Cụ thể, thay vì để mô hình phải “mang vác” toàn bộ lịch sử tương tác dài, ta tạo một bản tóm tắt trung thực (high-fidelity summary), rồi khởi tạo lại ngữ cảnh mới bằng chính bản tóm tắt đó.

Mục tiêu: Giúp agent duy trì mạch logic và độ chính xác lâu dài, mà không bị giảm hiệu suất do giới hạn token.

Ví dụ trong Claude Code, Anthropic thực hiện compaction bằng cách:
Gửi toàn bộ lịch sử tin nhắn cho mô hình, dể mô hình tự tóm tắt và nén lại thông tin quan trọng nhất.bản tóm tắt này thường giữ lại:
– Các quyết định kiến trúc,
– Lỗi chưa xử lý,
– Chi tiết triển khai quan trọng, và loại bỏ những phần dư thừa như kết quả của các lệnh công cụ (tool outputs).
=> Sau đó, agent tiếp tục làm việc với ngữ cảnh đã nén cộng thêm 5 file được truy cập gần nhất — giúp người dùng có cảm giác liền mạch, không lo ngại về giới hạn context.

Điểm tinh tế trong compaction:

Chính là chọn cái gì giữ, cái gì bỏ.Nếu nén quá tay, agent có thể mất những chi tiết nhỏ nhưng quan trọng về sau. Anthropic khuyên kỹ sư nên:
Tối đa hóa recall trong giai đoạn đầu (đảm bảo mọi thông tin quan trọng đều được giữ lại),
Sau đó tối ưu precision, loại bỏ phần dư thừa để tinh gọn hơn.

Ví dụ dễ hiểu: Kết quả của một tool đã được gọi nhiều bước trước hầu như không cần giữ lại.
Anthropic thậm chí đã thêm “tool result clearing” – một dạng compaction nhẹ và an toàn – vào Claude Developer Platform.

Structured Note-Taking – Ghi chú có cấu trúc (Bộ nhớ agentic)

Structured note-taking, hay còn gọi là bộ nhớ agentic, là kỹ thuật mà agent thường xuyên ghi chú các thông tin quan trọng ra ngoài context window.
Những ghi chú này sẽ được gọi lại vào ngữ cảnh khi cần thiết trong các bước sau.

Mục tiêu: Cung cấp cho agent một dạng “bộ nhớ dài hạn” mà không tốn nhiều token.
Ví dụ: Claude Code có thể tạo file TODO.md hoặc NOTES.md để lưu danh sách việc cần làm. Các agent tùy chỉnh có thể ghi chú tiến độ, trạng thái, hoặc các dependency quan trọng giữa các bước phức tạp. Anthropic minh họa bằng ví dụ thú vị: Claude chơi Pokémon 🎮 — Agent này ghi nhớ chính xác hàng ngàn bước chơi:
“Trong 1.234 bước qua, tôi đã luyện Pikachu ở Route 1, tăng 8 cấp, còn 2 cấp nữa đạt mục tiêu.”
Không cần hướng dẫn thêm, Claude tự phát triển bản đồ, nhớ vùng đã khám phá, lưu chiến lược đánh boss hiệu quả nhất, và tiếp tục từ chỗ dừng trước đó sau khi context được reset.

Kết quả: Claude duy trì sự mạch lạc xuyên suốt hàng giờ hoạt động, Thực hiện được chiến lược dài hạn mà không cần giữ mọi thông tin trong context window.
Anthropic đã ra mắt “Memory Tool” (bản beta) trong Claude Developer Platform, cho phép agent lưu trữ và truy xuất ghi chú từ hệ thống file —tức là agent có thể: Xây dựng knowledge base cá nhân, Giữ trạng thái dự án giữa các phiên, Và truy cập lại công việc cũ mà không cần giữ toàn bộ trong context hiện tại.

Sub-Agent Architectures – Kiến trúc đa agent chuyên biệt

Sub-agent architecture là chiến lược phân tán công việc giữa nhiều agent nhỏ, mỗi agent đảm nhận một nhiệm vụ cụ thể trong ngữ cảnh riêng biệt (clean context window).Thay vì để một agent phải “gánh” toàn bộ dự án, Anthropic chia nhỏ thành: Agent chính (lead agent): định hướng tổng thể, ra kế hoạch.Các sub-agent: thực hiện các phần việc kỹ thuật sâu, hoặc dùng tool để tìm thông tin liên quan.Mỗi sub-agent có thể “làm việc” rất sâu (vài chục nghìn token), nhưng chỉ trả lại bản tóm tắt súc tích 1.000–2.000 token cho agent chính.
Ưu điểm:
– Tách biệt rõ ràng giữa “ngữ cảnh chi tiết” và “ngữ cảnh tổng hợp”,
– Giúp agent chính tập trung vào phân tích, tổng hợp và ra quyết định.
Anthropic cho biết mô hình này đã tăng hiệu suất đáng kể trong các tác vụ nghiên cứu phức tạp
(ví dụ: hệ thống nghiên cứu đa agent trong bài How We Built Our Multi-Agent Research System).

Kết luận

Kỹ thuật ngữ cảnh (context engineering) đại diện cho một bước chuyển mình căn bản trong cách chúng ta xây dựng các ứng dụng dựa trên mô hình ngôn ngữ lớn (LLM). Khi các mô hình ngày càng trở nên mạnh mẽ hơn, thách thức không chỉ nằm ở việc tạo ra một prompt hoàn hảo — mà là việc lựa chọn có chủ đích những thông tin nào sẽ được đưa vào trong “ngân sách chú ý” (attention budget) giới hạn của mô hình tại mỗi bước.
Dù bạn đang triển khai compaction cho các tác vụ dài hạn, thiết kế các công cụ tiết kiệm token, hay giúp các tác nhân (agent) khám phá môi trường của mình một cách vừa đúng lúc (just-in-time), thì nguyên tắc cốt lõi vẫn không đổi:
Tìm ra tập hợp nhỏ nhất các token có giá trị thông tin cao nhất để tối đa hóa khả năng đạt được kết quả mong muốn.

Những kỹ thuật được trình bày ở đây sẽ còn tiếp tục phát triển cùng với sự tiến bộ của các mô hình. Chúng ta đã bắt đầu thấy rằng các mô hình thông minh hơn sẽ cần ít kỹ thuật “ép buộc” hơn, cho phép các tác nhân hoạt động tự chủ hơn. Tuy nhiên, ngay cả khi năng lực của mô hình tiếp tục mở rộng, việc xem ngữ cảnh như một nguồn tài nguyên quý giá và hữu hạn vẫn sẽ là yếu tố trung tâm để xây dựng các tác nhân đáng tin cậy và hiệu quả.
Hãy bắt đầu khám phá kỹ thuật context engineering trên nền tảng Claude Developer Platform ngay hôm nay, và tham khảo thêm “Memory and Context Management Cookbook” để tìm hiểu những mẹo và phương pháp thực hành tốt nhất.

🧠 Codex CLI vs Claude Code vs Gemini CLI

1) Codex CLI — Tóm tắt khả năng & các nâng cấp chính

Codex CLI là agent chạy ngay trong terminal, đóng vai
trò “pair programmer” biết lập kế hoạch, dùng công cụ và tự kiểm tra đầu
ra theo từng bước. Bản nâng cấp 2025 tập trung vào khả năng cộng tác
thời gian thực, theo dõi tiến độ, và kiểm soát quyền truy cập an toàn —
giúp bạn chuyển từ các yêu cầu nhỏ tương tác nhanh đến nhiệm vụ dài hơi
(refactor, thêm tính năng, viết test) mà không rời môi trường làm việc.

Khả năng cốt lõi

  • Agentic coding trong terminal: ra lệnh, nhận kế
    hoạch, xem log/diff, và áp dụng thay đổi trực tiếp ở thư mục làm việc;
    phù hợp cả phiên ngắn (prompt–sửa–chạy) lẫn nhiệm vụ nhiều bước.
  • Hiểu và điều hướng codebase: đọc tập tin liên quan,
    đề xuất chỉnh sửa/viết mới, chạy lệnh build/test để xác thực; có thể
    duy trì ngữ cảnh dài hơn nhờ cơ chế nén hội thoại.
  • Tận dụng mô hình tối ưu cho coding: hỗ trợ dùng
    GPT-5-Codex cho tác vụ cục bộ trong CLI (tùy chọn), cho chất lượng mã
    và khả năng điều khiển tốt hơn.
  • Tích hợp an toàn theo quyền: làm việc ở các mức cấp
    quyền khác nhau (chỉ đọc/duyệt thủ công, tự động trong workspace, hoặc
    toàn quyền có mạng) để cân bằng tốc độ và kiểm soát rủi ro.

Các nâng cấp nổi bật (2025)

  • Đính kèm & chia sẻ hình ảnh ngay trong CLI: gửi
    screenshot/wireframe/diagram để tạo ngữ cảnh UI chung, từ đó agent bám
    sát ý đồ thiết kế hơn.
  • Theo dõi tiến độ bằng to-do list: CLI hiển thị các
    bước việc, trạng thái hoàn thành, và cho phép tiếp tục/điều chỉnh khi
    tác vụ phức tạp.
  • Công cụ tích hợp tốt hơn: thêm web search
    MCP (Model Context Protocol) để kết nối hệ thống bên ngoài với độ
    chính xác sử dụng công cụ cao hơn.
  • Terminal UI mới: hiển thị lệnh công cụ và
    diff rõ ràng, dễ theo dõi; giúp bạn duyệt và chấp thuận thay
    đổi nhanh.
  • Ba chế độ phê duyệt đơn giản: Read-only (duyệt thủ
    công), Auto (toàn quyền trong workspace, cần duyệt khi ra ngoài), Full
    access (đọc file bất kỳ & chạy lệnh có mạng); kèm cơ chế nén hội thoại
    để giữ phiên làm việc dài.
  • Khả dụng & cài đặt nhanh: gói CLI phát hành dạng
    open-source; cài qua npm và dùng chung tài khoản
    ChatGPT/Codex để đồng bộ trải nghiệm giữa máy cục bộ, IDE và cloud.

Ý nghĩa thực tiễn

  • Cho phiên ngắn: phản hồi nhanh, sinh/ghi mã, xem diff
    và hợp nhất từng phần một — rất hợp xây dựng nguyên mẫu, sửa lỗi, viết
    test.
  • Cho nhiệm vụ dài hơi: theo dõi to-do, dùng công cụ
    đúng lúc (search/MCP), duy trì ngữ cảnh nhiều giờ; giảm tải việc lặp
    thủ công và rủi ro “lạc ngữ cảnh”.
  • Cho đội ngũ coi trọng an toàn: mặc định sandbox vô
    hiệu mạng; mọi thao tác “nhạy cảm” đều có cơ chế xin phép, log minh
    bạch, và có thể giới hạn miền mạng tin cậy khi cần.

2) Gemini CLI — kết nối & ngữ cảnh dài

Gemini CLI đưa mô hình Gemini vào terminal với thế mạnh nổi bật là
khả năng gom ngữ cảnh lớn
khả năng “kéo tri thức ngoài” (web/search, MCP) khi cần. Cách
làm việc phù hợp là vừa viết mã vừa tổng hợp tài liệu, quy chuẩn, ví dụ
và snippet từ nhiều nguồn ngay trong một phiên.

Khả năng & trải nghiệm chính

  • Tổng hợp đa nguồn: đọc nhiều tệp
    README/changelog/guide cùng lúc, rút ý và hợp nhất thành checklist
    hoặc mã khởi tạo.
  • Grounding khi thiếu ngữ cảnh: có thể tra cứu rồi
    “điền chỗ trống” (thư viện, API mẫu, quy ước thiết kế) để tiếp tục
    triển khai.
  • Tích hợp công cụ qua MCP/tiện ích: mở rộng tác vụ từ
    terminal (chạy lệnh, xử lý tệp, thao tác hệ thống) trong cùng một
    luồng hội thoại.
  • Thích hợp giai đoạn khởi tạo: bootstrap dự án, dựng
    khung cấu trúc, tạo script cài đặt & cấu hình linter/test nhanh.

Điểm mạnh

  • Gom và “tiêu hoá” tài liệu rất tốt, hữu ích khi yêu cầu dính nhiều quy
    chuẩn/tiêu chí.
  • Tiện ích terminal đa dạng; có thể chuyển từ thảo luận sang thực thi
    lệnh liền mạch.
  • Phù hợp các bài toán phải vừa tra cứu vừa phát triển (setup,
    tích hợp nhiều dịch vụ, tạo sample end-to-end).

Điểm cần lưu ý

  • Đầu ra dễ dài; nên yêu cầu rút gọn hoặc
    chỉ ghi thay đổi tối thiểu để tránh mã/cấu hình thừa.
  • Ở bài toán nhiều ràng buộc (ví dụ: vật lý/va chạm trong game), logic
    đôi khi thiếu ổn định — nên kèm test nhỏ để “neo” hành vi mong muốn.
  • Prompt càng dài càng dễ tăng độ trễ; chia nhỏ mục tiêu giúp cải thiện
    tốc độ và độ chính xác.

Khi nào nên dùng / không nên dùng

  • Nên dùng: khởi tạo dự án, hợp nhất guideline, tạo
    khung CI/CD, viết script cài đặt; tích hợp SDK/API mới có nhiều tài
    liệu rải rác.
  • Không lý tưởng: tác vụ yêu cầu logic thời gian thực
    nhạy cảm (gameplay/physics), hoặc tối ưu UI/animation vi mô cần tinh
    chỉnh thủ công.

3) Claude Code — độ sâu & tái cấu trúc

Claude Code thiên về hiểu dự án
giữ tính nhất quán trên codebase lớn. Công cụ này làm tốt các
việc như điều hướng toàn repo, chuẩn hoá kiến trúc, viết module theo
convention, chạy test và thậm chí đề xuất PR hoàn chỉnh với mô tả rõ
ràng.

Khả năng & trải nghiệm chính

  • Refactor quy mô lớn: phát hiện trùng lặp, tách
    mô-đun, chuẩn hoá naming/foldering, giải thích tác động kiến trúc.
  • Review có lý do: output thường kèm chú thích “vì sao”
    và “cách kiểm chứng”, thuận tiện cho code review theo nhóm.
  • Giữ trạng thái & luồng làm việc: có thể theo dõi đề
    xuất qua nhiều bước (quét, đổi tên, cập nhật test, cập nhật tài liệu).
  • UI/animation có tổ chức: ở bài front-end đòi hỏi
    chuyển cảnh hoặc nhiều trạng thái, cách tổ chức logic thường gọn gàng,
    ít “giật cục”.

Điểm mạnh

  • Rất phù hợp với kế hoạch tái cấu trúc/chuẩn hoá đa mô-đun
    hoặc khi cần củng cố ranh giới giữa các layer.
  • Đầu ra dễ đọc, có chú thích; thuận lợi cho duy trì lâu dài và
    onboarding thành viên mới.
  • Hỗ trợ quy trình nhóm: có thể đề xuất commit/PR với mô tả chi tiết,
    checklist kiểm thử và hướng dẫn rollout.

Điểm cần lưu ý

  • Tốc độ không phải thế mạnh; cần cân nhắc khi deadline gấp hoặc chỉ sửa
    1–2 file nhỏ.
  • Để đạt “đúng gu” kiến trúc, nên mô tả convention (naming, foldering,
    state, test strategy) ngay từ đầu.
  • Với việc rất nhỏ, chi phí thời gian có thể lớn hơn lợi ích so với các
    công cụ hướng tốc độ.

Khi nào nên dùng / không nên dùng

  • Nên dùng: refactor lớn, nâng cấp framework, tách
    mô-đun, chuẩn hoá API, dọn nợ kỹ thuật, viết/hoàn thiện test.
  • Không lý tưởng: thử nghiệm nhanh/POC siêu nhỏ, tinh
    chỉnh UI/copywriting vi mô cần phản hồi tức thì.

4) Bảng so sánh chính

Tiêu chí Codex CLI Gemini CLI Claude Code
Model nền OpenAI Codex (tối ưu coding) Gemini 2.5 Pro Claude Sonnet 4
Context window ~128K tokens ~1M tokens ~200K tokens (xấp xỉ)
Truy cập FS & Shell
Tính năng khác biệt Tốc độ phản hồi nhanh, vòng lặp ngắn Kéo tri thức ngoài, ngữ cảnh dài Quét codebase, gợi ý PR, chuẩn hoá
Phù hợp nhất cho Prototype, sửa lỗi, tác vụ cục bộ Quy trình “viết mã + tra cứu” Dự án nhiều mô-đun, refactor/maintain
Tốc độ/độ trễ Nhanh nhất Trung bình Chậm hơn
UI/Animation Thiên chức năng Khá tốt, phụ thuộc prompt Mượt & có tổ chức
Xử lý lỗi Cần can thiệp tay ở logic phức tạp Ổn nếu prompt rõ Phát hiện & sửa tốt, kèm giải thích

5) Demo 2 tác vụ cụ thể

Task 1 — Platformer 2D phong cách Super Mario

Prompt: “Tạo một trò chơi platformer 2D cơ bản theo phong cách Super
Mario. Trò chơi nên có bố cục đơn giản dựa trên các ô vuông với Mario
đứng trên các khối đất, nền trời với những đám mây, khối hình dấu hỏi
phía trên và một đường ống màu xanh lá cây gần đó. Bao gồm các cơ chế cơ
bản như di chuyển trái/phải và nhảy bằng các phím mũi tên trên bàn phím.
Mô phỏng trọng lực và va chạm với các nền tảng. Sử dụng đồ họa theo
phong cách pixel-art với các tài nguyên cục bộ được nhúng hoặc tham
chiếu.”

Codex CLI

Gemini CLI

Claude Code

Task 2 — Đồng hồ động theo chủ đề thời tiết

Prompt: “Thiết kế và phát triển một bảng điều khiển đồng hồ động theo
chủ đề thời tiết với giao diện trực quan phong phú chỉ bằng HTML, CSS và
JavaScript. Mục tiêu chính là tạo ra một giao diện đồng hồ thời gian
thực, không chỉ hiển thị thời gian hiện tại mà còn tự động điều chỉnh
theo thời gian trong ngày. Triển khai bốn hiệu ứng chuyển tiếp nền động
thể hiện bình minh, trưa, hoàng hôn và đêm, mỗi hiệu ứng có màu sắc và
các yếu tố động riêng biệt như mây trôi, sao lấp lánh, hoặc mặt trời/mặt
trăng mọc/lặn, và cung cấp tùy chọn chuyển đổi giữa định dạng thời gian
12 giờ và 24 giờ. Để tăng thêm tính tương tác, hãy thêm một phần hiển
thị câu trích dẫn động lực hoặc năng suất theo từng giờ.”

Codex CLI

Gemini CLI

Claude Code

6) Ưu & Nhược điểm thực tế

6.1 Codex CLI

Ưu điểm

  • Tốc độ phản hồi rất nhanh; phù hợp vòng lặp “chia nhỏ — chạy thử — sửa
    — lặp”.
  • Trải nghiệm terminal gọn gàng: xem diff → áp dụng, chạy test/format
    ngay trong CLI.
  • Ổn định ở tác vụ nhỏ/vừa; giữ mạch công việc tốt khi bạn dẫn dắt bằng
    checklist/to-do.

Nhược điểm

  • UI/animation phức tạp (parallax, canvas, webGL) thường cần chỉnh tay
    thêm; thiên về chức năng.
  • Logic nhiều tầng, đa mô-đun: đôi lúc bỏ sót ràng buộc; cần test bao
    phủ để duy trì chất lượng.
  • Tài liệu hoá sinh tự động thường ngắn; cần yêu cầu bổ sung “why/how”.

6.2 Gemini CLI

Ưu điểm

  • Ngữ cảnh rất lớn: đọc nhiều tệp/README/changelog cùng lúc, tổng hợp
    nguồn nhanh.
  • Kéo tri thức ngoài (web/search) khi thiếu snippet/tiêu chuẩn, rồi hợp
    nhất vào triển khai.
  • Hữu ích khi khởi tạo dự án mới cần nhiều guideline & tài liệu tham
    chiếu.

Nhược điểm

  • Đầu ra thường dài; cần rút gọn để tránh code/CSS dư hoặc cấu trúc rườm
    rà.
  • Logic chưa ổn định ở bài toán nhiều ràng buộc (ví dụ game với va
    chạm/trọng lực).
  • Độ trễ trung bình; prompt càng dài càng tốn thời gian suy nghĩ.

6.3 Claude Code

Ưu điểm

  • Hiểu dự án tốt, nổi bật ở refactor, gom code trùng, đặt tên có chủ
    đích, output có chú thích.
  • UI/animation mượt, trạng thái rõ; phù hợp demo front-end đòi hỏi
    chuyển cảnh tinh tế.
  • Phù hợp quy trình nhóm: có thể sinh commit/PR có mô tả, tài liệu hoá
    bài bản.

Nhược điểm

  • Tốc độ chậm hơn; không phù hợp khi cần xử lý “siêu nhanh”.
  • Phụ thuộc prompt chi tiết để đạt kiến trúc “đúng gu”.
  • Với tác vụ rất nhỏ (1–2 file), chi phí thời gian đôi khi lớn hơn lợi
    ích so với Codex.

7) Chọn công cụ nào theo nhu cầu

Muốn tốc độ & vòng lặp ngắn

Chọn Codex. Giao tác vụ nhỏ-vừa, kiểm diff theo
bước; tận dụng test/format tự động để “khoanh vùng lỗi” nhanh.

Muốn kéo ngữ cảnh ngoài & tìm kiếm

Chọn Gemini. Gom README, guideline, link web → hợp
nhất checklist & script; hữu ích khi khởi tạo dự án nhiều ràng buộc.

Muốn refactor & quản lý codebase lớn

Chọn Claude. Giao nhiệm vụ tổ chức lại cấu trúc,
sinh PR có mô tả; yêu cầu giải thích kiến trúc & tác động.

Playwright Agents — 🎭 Planner, 🎭 Generator, 🎭 Healer

What are Playwright Agents?

This article distills the official guidance and demo video into a practical, production‑ready walkthrough. Playwright ships three agents you can run independently or in a loop: 🎭 Planner, 🎭 Generator, and 🎭 Healer.

🎭 Planner

Explores your app and produces a human‑readable Markdown plan.

  • Input: a clear request (e.g. “Generate a plan for guest checkout”), a seed test, optional PRD.
  • Output: specs/*.md with scenarios, steps, and expected results.

🎭 Generator

Converts the Markdown plan into executable Playwright tests and validates selectors/assertions during generation.

  • Input: Markdown from specs/, seed test and fixtures.
  • Output: tests/*.spec.ts aligned to the plan.

🎭 Healer

Runs tests, replays failures, proposes patches (locator updates, waits, data fixes) and re‑runs until passing or guardrails stop.

  • Input: failing test name.
  • Output: a passing test or a skipped test if functionality is broken.
🎭 Planner → 🎭 Generator → 🎭 Healer Overview

1. Requirements

  • Node.js 18+ and npm
  • Playwright Test latest version
  • VS Code 1.105+ (Insiders channel) for full agentic UI experience
  • AI Assistant – Choose one: Claude Code, OpenCode, or VS Code with AI extensions
  • Git for version control
  • Modern web browser (Chrome, Firefox, Safari)

2. Step-by-Step Installation Guide

Step 1: Prerequisites

  • Install Node.js 18+ from nodejs.org
  • Install npm (comes with Node.js)
  • Install VS Code 1.105+ from VS Code Insiders for agentic experience
  • Choose and install an AI Assistant:
    • Claude Code – for Claude integration
    • OpenCode – for OpenAI integration
    • VS Code with AI extensions – for built-in AI features
  • Install Git for version control

Step 2: Navigate to Demo Directory

# Navigate to the demo directory
C:\Users\ADMIN\Documents\AI_QUEST_LTP> cd "playwright Agent Test Example - PhatLT"

Step 3: Install Dependencies

playwright Agent Test Example - PhatLT> npm install
playwright Agent Test Example - PhatLT> npx playwright install

Step 4: Initialize Playwright Agents

# Initialize agent definitions for Claude Code (recommended)
playwright Agent Test Example - PhatLT> npx playwright init-agents --loop=claude

# Or for VS Code
playwright Agent Test Example - PhatLT> npx playwright init-agents --loop=vscode

# Or for OpenCode
playwright Agent Test Example - PhatLT> npx playwright init-agents --loop=opencode

Step 5: Verify Setup

# Test seed file
playwright Agent Test Example - PhatLT> npx playwright test tests/seed-agents.spec.ts

# Check project structure
playwright Agent Test Example - PhatLT> dir .claude\agents
playwright Agent Test Example - PhatLT> dir .github
playwright Agent Test Example - PhatLT> dir specs
playwright Agent Test Example - PhatLT> npm init -y
Wrote to playwright Agent Test Example - PhatLT\package.json:
{
  "name": "phatlt-playwright",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "playwright test",
    "test:headed": "playwright test --headed",
    "test:ui": "playwright test --ui",
    "test:debug": "playwright test --debug",
    "test:chromium": "playwright test --project=chromium",
    "test:firefox": "playwright test --project=firefox",
    "test:webkit": "playwright test --project=webkit",
    "report": "playwright show-report",
    "codegen": "playwright codegen"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "type": "commonjs",
  "description": "",
  "devDependencies": {
    "@playwright/test": "^1.56.0",
    "@types/node": "^24.7.2"
  }
}

playwright Agent Test Example - PhatLT> npm install -D @playwright/test
added 1 package, and audited 2 packages in 2s
found 0 vulnerabilities

playwright Agent Test Example - PhatLT> npx playwright install
Installing browsers...
✓ Chromium 120.0.6099.109
✓ Firefox 120.0
✓ WebKit 17.4

playwright Agent Test Example - PhatLT> npx playwright init
✓ Created playwright.config.ts
✓ Created tests/
✓ Created tests/example.spec.ts
✓ Created tests/seed.spec.ts

3. Step-by-Step Testing Guide

Step 1: Test Seed File

Run the seed test to verify Playwright Agents setup:

# Test seed file for agents
playwright Agent Test Example - PhatLT> npx playwright test tests/seed-agents.spec.ts

# Run with browser UI visible
playwright Agent Test Example - PhatLT> npx playwright test tests/seed-agents.spec.ts --headed

# Run in debug mode
playwright Agent Test Example - PhatLT> npx playwright test tests/seed-agents.spec.ts --debug

Step 2: Test Generated Tests

Run the example generated tests from the Generator agent:

# Run generated Google search tests
playwright Agent Test Example - PhatLT> npx playwright test tests/google-search-generated.spec.ts

# Run specific test by name
playwright Agent Test Example - PhatLT> npx playwright test --grep "Perform Basic Search"

# Run all tests
playwright Agent Test Example - PhatLT> npx playwright test

Step 3: Test Different Browsers

# Run tests only on Chromium
playwright Agent Test Example - PhatLT> npx playwright test --project=chromium

# Run tests only on Firefox
playwright Agent Test Example - PhatLT> npx playwright test --project=firefox

# Run tests only on WebKit
playwright Agent Test Example - PhatLT> npx playwright test --project=webkit

Step 4: Generate Test Reports

# Generate HTML report
playwright Agent Test Example - PhatLT> npx playwright show-report

# Run tests with UI mode
playwright Agent Test Example - PhatLT> npx playwright test --ui

Step 5: Using Playwright Agents

Now you can use the Playwright Agents workflow with Claude Code:

# In Claude Code, ask the Planner:
"I need test scenarios for Google search functionality. Use the planner agent to explore https://www.google.com"

# Then ask the Generator:
"Use the generator agent to create tests from the test plan in specs/"

# Finally, use the Healer if tests fail:
"The test 'Perform Basic Search' is failing. Use the healer agent to fix it."

4. Project Structure and Files

playwright Agent Test Example - PhatLT/
├── .claude/agents/              # Claude Code agent definitions
│   ├── playwright-test-planner.md    # 🎭 Planner agent
│   ├── playwright-test-generator.md  # 🎭 Generator agent
│   └── playwright-test-healer.md     # 🎭 Healer agent
├── .github/                     # Official agent definitions
│   ├── planner.md               # 🎭 Planner instructions
│   ├── generator.md             # 🎭 Generator instructions
│   └── healer.md                # 🎭 Healer instructions
├── specs/                       # Test plans (Markdown)
│   └── google-search-operations.md   # Example test plan
├── tests/                       # Generated tests
│   ├── seed-agents.spec.ts      # Seed test for agents
│   └── google-search-generated.spec.ts  # Generated test example
├── .mcp.json                    # MCP server configuration
├── playwright.config.ts         # Playwright configuration
├── package.json                 # Project dependencies
└── test-results/               # Test execution results

5. How Playwright Agents Work (End‑to‑End)

  1. 🎭 Planner — explores your app and creates human-readable test plans saved in specs/ directory.
  2. 🎭 Generator — transforms Markdown plans into executable Playwright tests in tests/ directory.
  3. 🎭 Healer — automatically repairs failing tests by updating selectors and waits.
  4. Execution — run generated tests with npx playwright test.
  5. Maintenance — Healer fixes issues automatically, keeping tests stable over time.
playwright Agent Test Example - PhatLT> npx playwright test tests/seed-agents.spec.ts

Running 1 test using 1 worker

  ✓ [chromium] › tests/seed-agents.spec.ts › seed (2.1s)

  1 passed (2.1s)

playwright Agent Test Example - PhatLT> npx playwright test tests/google-search-generated.spec.ts

Running 5 tests using 1 worker

  ✓ [chromium] › tests/google-search-generated.spec.ts › Google Search - Basic Operations › Perform Basic Search (3.2s)
  ✓ [chromium] › tests/google-search-generated.spec.ts › Google Search - Basic Operations › Verify Search Box Functionality (1.8s)
  ✓ [chromium] › tests/google-search-generated.spec.ts › Google Search - Basic Operations › Search with Empty Query (1.5s)
  ✓ [chromium] › tests/google-search-generated.spec.ts › Google Search - Results Validation › Verify Search Results Display (4.1s)
  ✓ [chromium] › tests/google-search-generated.spec.ts › Google Search - Results Validation › Navigate Through Search Results (5.3s)

  5 passed (16.0s)

6. How Playwright Agents Work

Playwright Agents follow a structured workflow as described in the official documentation. The process involves three main agents working together:

🎭 Planner Agent

The Planner explores your application and creates human-readable test plans:

  • Input: Clear request (e.g., “Generate a plan for guest checkout”), seed test, optional PRD
  • Output: Markdown test plan saved as specs/basic-operations.md
  • Process: Runs seed test to understand app structure and creates comprehensive test scenarios

🎭 Generator Agent

The Generator transforms Markdown plans into executable Playwright tests:

  • Input: Markdown plan from specs/
  • Output: Test suite under tests/
  • Process: Verifies selectors and assertions live, generates robust test code

🎭 Healer Agent

The Healer automatically repairs failing tests:

  • Input: Failing test name
  • Output: Passing test or skipped test if functionality is broken
  • Process: Replays failing steps, inspects UI, suggests patches, re-runs until passing
// Example: Generated test from specs/basic-operations.md
// spec: specs/basic-operations.md
// seed: tests/seed.spec.ts

import { test, expect } from '../fixtures';

test.describe('Adding New Todos', () => {
  test('Add Valid Todo', async ({ page }) => {
    // 1. Click in the "What needs to be done?" input field
    const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' });
    await todoInput.click();

    // 2. Type "Buy groceries"
    await todoInput.fill('Buy groceries');

    // 3. Press Enter key
    await todoInput.press('Enter');

    // Expected Results:
    // - Todo appears in the list with unchecked checkbox
    await expect(page.getByText('Buy groceries')).toBeVisible();
    const todoCheckbox = page.getByRole('checkbox', { name: 'Toggle Todo' });
    await expect(todoCheckbox).toBeVisible();
    await expect(todoCheckbox).not.toBeChecked();

    // - Counter shows "1 item left"
    await expect(page.getByText('1 item left')).toBeVisible();

    // - Input field is cleared and ready for next entry
    await expect(todoInput).toHaveValue('');
    await expect(todoInput).toBeFocused();

    // - Todo list controls become visible
    await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).toBeVisible();
  });
});

7. Agent Deep Dives

🎭 Planner — author plans that generate great tests

  • Goal: Convert product intent into executable, atomic scenarios.
  • Inputs: business request, seed.spec.ts, optional PRD/acceptance criteria.
  • Output quality tips: prefer user‑intent over UI steps, keep 1 scenario = 1 assertion focus, name entities consistently.
  • Anti‑patterns: mixing setup/teardown into steps; over‑specifying selectors in Markdown.

🎭 Generator — compile plans into resilient tests

  • Validates selectors live: uses your running app to confirm locators/assertions.
  • Structure: mirrors specs/*.md; adds fixtures from seed.spec.ts; keeps tests idempotent.
  • Resilience: prefer roles/labels; avoid brittle CSS/XPath; centralize waits.

🎭 Healer — stabilize and protect correctness

  • Scope: flaky selectors, timing, deterministic data; not business‑logic rewrites.
  • Review gates: patches proposed as diffs; you accept/reject before merge.
  • Outcomes: test fixed, or skipped with a documented reason when the feature is broken.

8. Project Structure and Artifacts

Playwright Agents follow a structured approach as described in the official documentation. The generated files follow a simple, auditable structure:

repo/
  .github/                    # agent definitions
    planner.md               # planner agent instructions
    generator.md             # generator agent instructions  
    healer.md                # healer agent instructions
  specs/                     # human-readable test plans
    basic-operations.md      # generated by planner
  tests/                     # generated Playwright tests
    seed.spec.ts             # seed test for environment
    add-valid-todo.spec.ts   # generated by generator
  playwright.config.ts       # Playwright configuration

Agent Definitions (.github/)

Under the hood, agent definitions are collections of instructions and MCP tools provided by Playwright. They should be regenerated whenever Playwright is updated:

# Initialize agent definitions
npx playwright init-agents --loop=vscode
npx playwright init-agents --loop=claude  
npx playwright init-agents --loop=opencode

Specs in specs/

Specs are structured plans describing scenarios in human-readable terms. They include steps, expected outcomes, and data. Specs can start from scratch or extend a seed test.

Tests in tests/

Generated Playwright tests, aligned one-to-one with specs wherever feasible. Generated tests may include initial errors that can be healed automatically by the healer agent.

Seed tests (seed.spec.ts)

Seed tests provide a ready-to-use page context to bootstrap execution. The planner runs this test to execute all initialization necessary for your tests including global setup, project dependencies, and fixtures.

// Example: seed.spec.ts
import { test, expect } from './fixtures';

test('seed', async ({ page }) => {
  // This test uses custom fixtures from ./fixtures
  // 🎭 Planner will run this test to execute all initialization
  // necessary for your tests including global setup, 
  // project dependencies and all necessary fixtures and hooks
});

9. Examples from Official Documentation

🎭 Planner Output Example

The 🎭 Planner generates human-readable test plans saved as specs/basic-operations.md:

# TodoMVC Application - Basic Operations Test Plan

## Application Overview

The TodoMVC application is a React-based todo list manager that demonstrates 
standard todo application functionality. Key features include:

- **Task Management**: Add, edit, complete, and delete individual todos
- **Bulk Operations**: Mark all todos as complete/incomplete and clear all completed todos  
- **Filtering System**: View todos by All, Active, or Completed status with URL routing support
- **Real-time Counter**: Display of active (incomplete) todo count
- **Interactive UI**: Hover states, edit-in-place functionality, and responsive design

## Test Scenarios

### 1. Adding New Todos

**Seed:** `tests/seed.spec.ts`

#### 1.1 Add Valid Todo

**Steps:**
1. Click in the "What needs to be done?" input field
2. Type "Buy groceries"
3. Press Enter key

**Expected Results:**
- Todo appears in the list with unchecked checkbox
- Counter shows "1 item left"
- Input field is cleared and ready for next entry
- Todo list controls become visible (Mark all as complete checkbox)

🎭 Generator Output Example

The 🎭 Generator transforms the Markdown plan into executable Playwright tests:

// Generated test from specs/basic-operations.md
// spec: specs/basic-operations.md
// seed: tests/seed.spec.ts

import { test, expect } from '../fixtures';

test.describe('Adding New Todos', () => {
  test('Add Valid Todo', async ({ page }) => {
    // 1. Click in the "What needs to be done?" input field
    const todoInput = page.getByRole('textbox', { name: 'What needs to be done?' });
    await todoInput.click();

    // 2. Type "Buy groceries"
    await todoInput.fill('Buy groceries');

    // 3. Press Enter key
    await todoInput.press('Enter');

    // Expected Results:
    // - Todo appears in the list with unchecked checkbox
    await expect(page.getByText('Buy groceries')).toBeVisible();
    const todoCheckbox = page.getByRole('checkbox', { name: 'Toggle Todo' });
    await expect(todoCheckbox).toBeVisible();
    await expect(todoCheckbox).not.toBeChecked();

    // - Counter shows "1 item left"
    await expect(page.getByText('1 item left')).toBeVisible();

    // - Input field is cleared and ready for next entry
    await expect(todoInput).toHaveValue('');
    await expect(todoInput).toBeFocused();

    // - Todo list controls become visible
    await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).toBeVisible();
  });
});

10. Best Practices

  • Keep plans atomic: Small, focused scenarios help 🎭 Generator produce clean tests. Avoid mixing multiple user flows in one scenario.
  • Stabilize with seed: Centralize navigation, authentication, and data seeding in seed.spec.ts to ensure consistent test environment.
  • Prefer semantic selectors: Use getByRole, getByLabel, and getByText for resilient element selection.
  • 🎭 Healer guardrails: Review patches carefully; accept locator/wait tweaks, but avoid broad logic changes that might mask real bugs.
  • Version agent definitions: Commit .github/ changes and regenerate them whenever Playwright is updated.
  • Choose the right AI assistant: VS Code, Claude Code, or OpenCode — pick the one that fits your team’s workflow and preferences.
  • Maintain traceability: Keep clear 1:1 mapping from specs/*.md to tests/*.spec.ts using comments and headers.
  • Test the agents: Start with simple scenarios to understand how each agent works before tackling complex user flows.

11. Troubleshooting

🎭 Planner can’t explore the app

Ensure your app is running locally, seed test works, and the app is accessible. Check that authentication and navigation are properly set up in seed.spec.ts.

🎭 Generator can’t find elements

Run the app locally, ensure routes are correct, and verify that elements have proper roles, labels, or accessible names. The 🎭 Generator validates selectors live against your running app.

🎭 Healer loops without fixing

Set explicit timeouts, add deterministic test data, and reduce flakiness in network waits. The 🎭 Healer works best with stable, predictable test conditions.

AI assistant doesn’t trigger agents

Re-run npx playwright init-agents --loop=[assistant], reload the IDE, and ensure the correct workspace root is open with agent definitions in .github/.

Generated tests fail immediately

Check that your seed test passes first. Ensure the app state matches what the 🎭 Planner observed. Verify that test data and authentication are consistent between planning and execution.

Agent definitions are outdated

Regenerate agent definitions after Playwright updates: npx playwright init-agents --loop=[assistant]. This ensures you have the latest tools and instructions.

12. CI/CD Integration

You can run the same agent‑generated tests in CI. Keep agent definitions in the repo and refresh them on Playwright upgrades.

# .github/workflows/tests.yml (excerpt)
name: Playwright Tests
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx playwright test --reporter=html

13. FAQ

Do I need Claude Code?

No. Playwright Agents work with VS Code (v1.105+), Claude Code, or OpenCode. Choose the AI assistant that fits your team’s workflow and preferences.

Where do test plans live?

In specs/ as Markdown files generated by the 🎭 Planner. Generated tests go to tests/.

What if a feature is actually broken?

The 🎭 Healer can skip tests with an explanation instead of masking a real bug. It distinguishes between flaky tests and genuinely broken functionality.

Can I run agent-generated tests in CI?

Yes. The agents produce standard Playwright tests that run with npx playwright test in CI. Agent definitions are only needed for test authoring, not execution.

How do I update agent definitions?

Run npx playwright init-agents --loop=[assistant] whenever Playwright is updated to get the latest tools and instructions.

What’s the difference between 🎭 Planner, 🎭 Generator, and 🎭 Healer?

🎭 Planner: Explores your app and creates human-readable test plans. 🎭 Generator: Transforms plans into executable Playwright tests. 🎭 Healer: Automatically fixes failing tests by updating selectors and waits.

14. Demo video and Source code

GitHubGitHub repository: phatltscuti/playwright_agents

 

Context Engineering cho AI Agents – Tóm tắt từ Anthropic

 

Context Engineering cho AI Agents

Tóm tắt từ bài viết của Anthropic về nghệ thuật quản lý context trong phát triển AI

🎯 Context Engineering là gì?

Context Engineering là tập hợp các chiến lược để tuyển chọn và duy trì bộ tokens (thông tin) tối ưu trong quá trình AI agents hoạt động.

Nó bao gồm việc quản lý toàn bộ trạng thái context như:

  • System prompts (hướng dẫn hệ thống)
  • Tools (công cụ)
  • Model Context Protocol (MCP)
  • External data (dữ liệu bên ngoài)
  • Message history (lịch sử hội thoại)
  • Các thông tin khác trong context window

💡 Bản chất: Context Engineering là nghệ thuật và khoa học về việc tuyển chọn thông tin nào sẽ đưa vào context window giới hạn từ vũ trụ thông tin liên tục phát triển của agent.

🔄 Khác biệt giữa Context Engineering và Prompt Engineering

📝 Prompt Engineering

  • Focus: Cách viết instructions (hướng dẫn)
  • Phạm vi: Tối ưu hóa system prompts
  • Use case: Tác vụ đơn lẻ, one-shot
  • Tính chất: Rời rạc, tĩnh

Ví dụ: “Tóm tắt văn bản này thành 3 điểm chú trọng số liệu tài chính”

🧠 Context Engineering

  • Focus: Model nhìn thấy gì trong context window
  • Phạm vi: Toàn bộ trạng thái thông tin
  • Use case: Multi-turn, tác vụ dài hạn
  • Tính chất: Lặp lại, động, liên tục

Ví dụ: Quyết định agent nên xem toàn bộ tài liệu, 3 phần cuối, hay bản tóm tắt đã chuẩn bị?

🎭 Ẩn dụ: Prompt engineering là “nói cho ai đó biết phải làm gì”, còn context engineering là “quyết định nên cung cấp nguồn lực gì cho họ”.

⚡ Tại sao Context Engineering quan trọng hơn?

Khi AI agents thực hiện các tác vụ phức tạp trên nhiều vòng lặp, chúng tạo ra ngày càng nhiều dữ liệu. Thông tin này phải được tinh chỉnh theo chu kỳ. Context engineering xảy ra mỗi khi chúng ta quyết định đưa gì vào model – đây là quá trình lặp đi lặp lại, không phải một lần.

⚠️ Những điều cần chú ý khi phát triển AI Agents

1. 🎯 Vấn đề “Goldilocks Zone” cho System Prompts

System prompts cần nằm ở “vùng vừa phải” giữa hai thái cực:

❌ Quá cứng nhắc: Hardcode logic if-else phức tạp → agent dễ vỡ, khó bảo trì

❌ Quá mơ hồ: Hướng dẫn chung chung, giả định context chung → thiếu tín hiệu cụ thể

✅ Vùng tối ưu: Đủ cụ thể để dẫn dắt hành vi, nhưng đủ linh hoạt để cung cấp heuristics mạnh mẽ

2. 🧹 “Context Rot” – Sự suy giảm độ chính xác

Khi context window dài ra, độ chính xác của model giảm xuống:

  • Giới hạn chú ý: LLMs giống con người – không thể nhớ mọi thứ khi quá tải. Nhiều tokens ≠ chính xác hơn
  • Context rot: Context càng dài, độ chính xác truy xuất càng giảm. Thêm 100 trang logs có thể che mất chi tiết quan trọng duy nhất
  • Kiến trúc transformer: Tạo n² mối quan hệ giữa các tokens (10K tokens = 100M quan hệ, 100K tokens = 10B quan hệ)

💡 Giải pháp: Implement pagination, range selection, filtering, truncation với giá trị mặc định hợp lý

3. 🔧 Quản lý Tools hiệu quả

  • Giữ tools riêng biệt: Không tạo 2 tools cùng làm việc giống nhau (VD: cùng fetch news)
  • Mô tả rõ ràng: Viết tool descriptions như hướng dẫn nhân viên mới – rõ ràng, tránh mơ hồ
  • Token-efficient: Giới hạn tool responses (VD: Claude Code giới hạn 25,000 tokens mặc định)
  • Error handling tốt: Error messages phải cụ thể, actionable, không phải error codes mơ hồ

4. 📊 Just-in-Time Context Retrieval

Thay vì load toàn bộ dữ liệu trước, hãy fetch dữ liệu động khi cần:

  • Tránh overload context window
  • Giảm token costs
  • Ngăn context poisoning (nhiễu thông tin)
  • Tương tự cách con người dùng hệ thống indexing bên ngoài

5. 🎨 Ba chiến lược cho tác vụ dài hạn

📦 Compaction (Nén thông tin)

Tóm tắt context cũ, giữ lại thông tin quan trọng

📝 Structured Note-Taking

Agent tự ghi chú có cấu trúc về những gì đã làm

🤖 Multi-Agent Architecture

Spawn sub-agents nhỏ cho các tác vụ hẹp, trả về kết quả ngắn gọn

6. 🎯 Ưu tiên Context theo tầm quan trọng

🔴 High Priority (luôn có trong context): Tác vụ hiện tại, kết quả tool gần đây, hướng dẫn quan trọng

🟡 Medium Priority (khi có không gian): Examples, quyết định lịch sử

⚪ Low Priority (on-demand): Nội dung file đầy đủ, documentation mở rộng

7. 📈 Monitoring và Iteration

Theo dõi liên tục:

  • Token usage per turn
  • Tool call frequency
  • Context window utilization
  • Performance ở các độ dài context khác nhau
  • Recall vs Precision khi rút gọn context

💡 Quy trình: Bắt đầu đơn giản → Test → Xác định lỗi → Thêm hướng dẫn cụ thể → Loại bỏ redundancy → Lặp lại

💡 Kết luận

Context engineering là kỹ năng then chốt để xây dựng AI agents hiệu quả. Khác với prompt engineering tập trung vào “cách viết instructions”, context engineering quan tâm đến “môi trường thông tin toàn diện” mà agent hoạt động.

Thành công không nằm ở việc tìm từ ngữ hoàn hảo, mà là tối ưu hóa cấu hình context để tạo ra hành vi mong muốn một cách nhất quán.

🎯 Nguyên tắc cốt lõi: Tìm bộ tokens nhỏ nhất có tín hiệu cao nhất để tối đa hóa khả năng đạt được kết quả mong muốn. Mỗi từ không cần thiết, mỗi mô tả tool thừa, mỗi dữ liệu cũ đều làm giảm hiệu suất agent.

Shipping with Codex

Codex: Kỹ Sư Phần Mềm AI Đã Tạo Ra “Sự Thay Đổi Cảm Hứng Lớn” (Vibe Shift) Trong Lập Trình

Gần đây, tại OpenAI, chúng ta đã chứng kiến một điều phi thường: một “sự thay đổi cảm hứng lớn” (vibe shift) trong cách chúng tôi xây dựng phần mềm. Kể từ tháng Tám, mức độ sử dụng Codex—kỹ sư phần mềm AI của chúng tôi—đã tăng gấp mười lần. Codex không chỉ là một công cụ; nó giống như một đồng nghiệp con người mà bạn có thể lập trình đôi, giao phó công việc hoặc đơn giản là để nó tự động thực hiện các nhiệm vụ phức tạp.

Sự bùng nổ này không phải ngẫu nhiên. Nó là kết quả của hàng loạt cập nhật lớn, biến Codex thành một tác nhân mạnh mẽ, an toàn và trực quan hơn, hoạt động trên mọi nền tảng mà bạn xây dựng.

1. Những Cập Nhật Đã Tạo Nên Sự Thay Đổi Lớn

Đại Tu Hoàn Toàn Tác Nhân (Agent Overhaul)

Chúng tôi định nghĩa tác nhân Codex là sự kết hợp của hai yếu tố: mô hình lý luậnbộ công cụ (harness) cho phép nó hành động và tạo ra giá trị.

  • Mô Hình Nâng Cấp: Ban đầu, chúng tôi đã ra mắt GPT-5, mô hình tác nhân tốt nhất của mình. Dựa trên phản hồi, chúng tôi tiếp tục tối ưu hóa và cho ra mắt GPT-5 Codex, một mô hình được tinh chỉnh đặc biệt cho công việc mã hóa. Người dùng mô tả nó như một “kỹ sư cấp cao thực thụ” vì nó không ngại đưa ra phản hồi thẳng thắn và từ chối những ý tưởng tồi.
  • Hệ Thống Công Cụ Mới (Harness): Chúng tôi đã viết lại hoàn toàn bộ công cụ để tận dụng tối đa các mô hình mới. Hệ thống này bổ sung các tính năng quan trọng như lập kế hoạch (planning), nén tự động bối cảnh (autoco compaction)—cho phép các cuộc trò chuyện và tương tác cực kỳ dài—và hỗ trợ cho MCP (Multi-Context Protocol).

Trải Nghiệm Người Dùng Được Tinh Chỉnh

Dù mô hình và tác nhân mạnh mẽ, phản hồi ban đầu cho thấy giao diện dòng lệnh (CLI) còn “sơ khai”.

  • CLI Revamp: Chúng tôi đã đại tu CLI, đơn giản hóa chế độ phê duyệt (approvals modes), tạo ra giao diện người dùng dễ đọc hơn và thêm nhiều chi tiết tinh tế. Quan trọng nhất, Codex CLI hiện mặc định hoạt động với sandboxing (môi trường hộp cát), đảm bảo an toàn theo mặc định trong khi vẫn trao toàn quyền kiểm soát cho người dùng.
  • Tiện Ích Mở Rộng IDE: Để hỗ trợ người dùng muốn xem và chỉnh sửa code cùng lúc với việc cộng tác với Codex, chúng tôi đã phát hành một extension bản địa (native extension) cho IDE. Tiện ích này hoạt động với VS Code, Cursor và các bản fork phổ biến khác. Nó đã bùng nổ ngay lập tức, thu hút 100.000 người dùng trong tuần đầu tiên—bằng cách sử dụng cùng một tác nhân mạnh mẽ và bộ công cụ mã nguồn mở (open-source harness) đã cung cấp sức mạnh cho CLI.
  • Codex Cloud Nhanh Hơn: Chúng tôi đã nâng cấp Codex Cloud để chạy nhiều tác vụ song song, tăng tốc độ tác vụ Cloud lên 90%. Tác vụ Cloud giờ đây có thể tự động thiết lập các phụ thuộc, thậm chí xác minh công việc bằng cách chụp ảnh màn hình và gửi cho bạn.

Codex Hoạt Động Mọi Nơi

Codex giờ đây hoạt động tích hợp sâu vào quy trình làm việc của bạn:

  • Slack và GitHub: Codex có thể được giao nhiệm vụ trực tiếp trong các công cụ cộng tác như Slack. Nó nhận toàn bộ bối cảnh từ luồng trò chuyện, tự mình khám phá vấn đề, viết code, và đăng giải pháp cùng với bản tóm tắt chỉ sau vài phút.
  • Review Code Độ Tin Cậy Cao: Việc đánh giá và duyệt code đang trở thành nút thắt cổ chai lớn. Chúng tôi đã huấn luyện GPT-5 Codex đặc biệt để thực hiện review code cực kỳ kỹ lưỡng (ultra thorough). Nó khám phá toàn bộ code và các phụ thuộc bên trong container của mình, xác minh ý định và việc triển khai. Kết quả là những phát hiện có tín hiệu rất cao (high signal), đến mức nhiều đội đã bật nó theo mặc định, thậm chí cân nhắc bắt buộc.

2. Codex Đang Thúc Đẩy OpenAI Như Thế Nào

Kết quả nội bộ tại OpenAI là minh chứng rõ ràng nhất cho sức mạnh của Codex:

  • 92% nhân viên kỹ thuật của OpenAI sử dụng Codex hàng ngày (tăng từ 50% vào tháng Bảy).
  • Các kỹ sư sử dụng Codex nộp 70% nhiều PR (Pull Requests) hơn mỗi tuần.
  • Hầu như tất cả các PR đều được Codex review. Khi nó tìm thấy lỗi, các kỹ sư cảm thấy hào hứng vì nó giúp tiết kiệm thời gian và tăng độ tin cậy khi triển khai.

3. Các Quy Trình Làm Việc Thực Tế Hàng Ngày

Các kỹ sư của chúng tôi đã chia sẻ những ví dụ thực tế về cách họ sử dụng Codex để giải quyết các vấn đề phức tạp.

Trường Hợp 1: Lặp Lại Giao Diện Người Dùng (UI) Với Bằng Chứng Hình Ảnh (Nacho)

Nacho, kỹ sư iOS, đã chia sẻ quy trình làm việc tận dụng tính năng đa phương thức (multimodal) của Codex:

  • Vấn Đề: Trong công việc front-end, 10% công việc đánh bóng cuối cùng—như căn chỉnh header/footer—thường chiếm đến 90% thời gian.
  • Giải Pháp: Nacho giao cho Codex nhiệm vụ triển khai UI từ một bản mockup. Khác với các agent cũ (được ví như “kỹ sư tập sự”), Codex (được ví như “kỹ sư cấp cao”) xác minh công việc của nó.
  • Quy Trình TDD & Multimodal:
    1. Nacho cung cấp cho Codex một công cụ đơn giản: một script Python (do Codex viết) để trích xuất các snapshot (ảnh chụp giao diện) từ các SwiftUI Previews.
    2. Nó được hướng dẫn sử dụng công cụ này để xác minh trực quan code UI mà nó viết.
    3. Codex lặp đi lặp lại: Viết code > Chạy test/Snapshot > Sửa lỗi cho đến khi giao diện đạt đến độ hoàn hảo về pixel (pixel perfect).
  • Kết Quả: Nacho có thể để Codex làm việc trên những chi tiết nhỏ (10% độ đánh bóng) trong khi anh làm những việc khác, biết rằng nó sẽ tự kiểm tra công việc của mình bằng hình ảnh.

Trường Hợp 2: Mở Rộng Giới Hạn Tác Vụ Lớn (Fel)

Fel, được biết đến là người có phiên làm việc Codex lâu nhất (hơn bảy giờ) và xử lý nhiều token nhất (hơn 150 triệu), đã chứng minh cách anh thực hiện các tác vụ refactor lớn chỉ với vài lời nhắc.

  • Vấn Đề: Thực hiện một refactor lớn (như thay đổi 15.000 dòng code) trong các dự án phức tạp (như bộ phân tích JSON cá nhân của anh) thường dẫn đến việc tất cả các bài kiểm tra thất bại trong thời gian dài.
  • Giải Pháp: Kế Hoạch Thực Thi (Exec Plan):
    1. Fel yêu cầu Codex viết một đặc tả (spec)—được gọi là plans.md—để triển khai tính năng, giao cho nó nhiệm vụ nghiên cứu thư viện và cách tích hợp.
    2. Anh định nghĩa plans.md là một “tài liệu thiết kế sống” (living document) mà Codex phải liên tục cập nhật, bao gồm mục tiêu lớn, danh sách việc cần làm, tiến trình, và nhật ký quyết định (decision log).
    3. Anh sử dụng thuật ngữ neo “exec plan” để đảm bảo mô hình biết khi nào cần tham chiếu và phản ánh lại tài liệu này.
    4. Sau khi Fel phê duyệt kế hoạch, anh ra lệnh: “Implement” (Thực thi).
  • Kết Quả: Codex có thể làm việc một cách hiệu quả trong nhiều giờ (thậm chí hơn một giờ trong buổi demo) trên một tính năng lớn, sử dụng plans.md như bộ nhớ và kim chỉ nam. Trong một phiên, nó đã tạo ra 4.200 dòng code chỉ trong khoảng một giờ—mọi thứ đều được kiểm tra và vượt qua.

Trường Hợp 3: Vòng Lặp Sửa Lỗi và Review Tại Chỗ (Daniel)

Daniel, một kỹ sư trong nhóm Codex, đã giới thiệu quy trình làm việc slash review mới, đưa khả năng review code chất lượng cao của GPT-5 Codex xuống môi trường cục bộ (local).

  • Vấn Đề: Ngay cả sau khi hoàn thành code, các kỹ sư cần một bộ mắt mới không bị thiên vị để tìm ra các lỗi khó.
  • Giải Pháp: Slash Review: Trước khi gửi PR, Daniel sử dụng lệnh /review trong CLI.
    • Anh chọn duyệt so với nhánh gốc (base branch), tương tự như một PR.
    • GPT-5 Codex bắt đầu luồng review chuyên biệt: Nó nghiên cứu sâu các tập tin, tìm kiếm các lỗi kỹ thuật, và thậm chí viết/chạy các script kiểm tra để xác minh các giả thuyết lỗi trước khi báo cáo.
    • Mô hình thiên vị: Luồng review chạy trong một luồng riêng biệt, có bối cảnh mới mẻ (fresh context), loại bỏ bất kỳ thiên vị triển khai (implementation bias) nào từ cuộc trò chuyện trước.
  • Vòng Lặp Sửa Lỗi: Khi Codex tìm thấy một vấn đề P0/P1, Daniel chỉ cần gõ “Please fix”.
  • Kết Quả: Codex sửa lỗi, và Daniel có thể chạy /review lần nữa cho đến khi nhận được “thumbs up” (chấp thuận) cuối cùng. Điều này đảm bảo code được kiểm tra kỹ lưỡng, được sửa lỗi cục bộ trước khi push, tiết kiệm thời gian và đảm bảo độ tin cậy cao hơn.

 

Ba chức năng chính của Codex, được nhấn mạnh trong bài thuyết trình, là:

  1. Lập Trình Đôi và Triển Khai Code (Implementation & Delegation):
    • Codex hoạt động như một đồng đội lập trình đôi trong IDE/CLI, giúp bạn viết code nhanh hơn.
    • Nó có thể nhận ủy quyền (delegate) các tác vụ lớn hơn (như refactor hoặc thêm tính năng) và tự thực hiện trong môi trường Cloud/Sandboxing, bao gồm cả việc tự thiết lập dependencies và chạy song song.
  2. Xác Minh và Kiểm Thử Tự Động (Verification & TDD):
    • Codex tích hợp sâu với quy trình Test-Driven Development (TDD).
    • Nó không chỉ viết code mà còn tự động chạy các bài kiểm thử (unit tests) và xác minh đa phương thức (ví dụ: tạo và kiểm tra snapshot UI) để đảm bảo code hoạt động chính xác và đạt độ hoàn hảo về mặt hình ảnh (pixel perfect).
  3. Review Code Độ Tin Cậy Cao (High-Signal Code Review):
    • Sử dụng mô hình GPT-5 Codex được tinh chỉnh, nó thực hiện review code cực kỳ kỹ lưỡng (ultra thorough) trên GitHub PR hoặc cục bộ thông qua lệnh /review.
    • Chức năng này giúp tìm ra các lỗi kỹ thuật khó và có thể được sử dụng trong vòng lặp Review -> Fix -> Review để đảm bảo chất lượng code trước khi merge, tiết kiệm thời gian và tăng độ tin cậy khi triển khai.

Link video: https://www.youtube.com/watch?v=Gr41tYOzE20

Revolutionizing Test Automation with Playwright Agents

 

🎭 Revolutionizing Test Automation with Playwright Agents

How AI-Powered Agents are Transforming E2E Testing

📅 October 2025
⏱️ 5 min read
🏷️ Testing, AI, Automation

Imagine this: You describe what you want to test, and AI generates comprehensive test plans, writes the actual test code, and even fixes failing tests automatically. This isn’t science fiction—it’s Playwright Agents, and it’s available today.

Playwright has introduced three powerful AI agents that work together to revolutionize how we approach test automation: the Planner, Generator, and Healer. Let’s dive deep into how these agents are changing the game.

What Are Playwright Agents?

Playwright Agents are AI-powered tools that automate the entire test creation and maintenance lifecycle. They can work independently or sequentially in an agentic loop, producing comprehensive test coverage for your product without the traditional manual overhead.

🎯

Planner Agent

The Planner is your AI test strategist. It explores your application and produces detailed, human-readable test plans in Markdown format.

How It Works:

  • Input: A clear request (e.g., “Generate a plan for guest checkout”), a seed test that sets up your environment, and optionally a Product Requirements Document
  • Process: Runs the seed test to understand your app’s structure, analyzes user flows, and identifies test scenarios
  • Output: Structured Markdown test plans saved in specs/ directory with detailed steps and expected results
💡 Pro Tip: The Planner uses your seed test as context, so it understands your custom fixtures, authentication flows, and project setup automatically!

Example Output:

# TodoMVC Application - Basic Operations Test Plan

## Test Scenarios

### 1. Adding New Todos
#### 1.1 Add Valid Todo
**Steps:**
1. Click in the "What needs to be done?" input field
2. Type "Buy groceries"
3. Press Enter key

**Expected Results:**
- Todo appears in the list with unchecked checkbox
- Counter shows "1 item left"
- Input field is cleared and ready for next entry

Generator Agent

The Generator transforms your human-readable test plans into executable Playwright test code, verifying selectors and assertions in real-time.

Key Features:

  • Live Verification: Checks selectors against your actual app while generating code
  • Smart Assertions: Uses Playwright’s catalog of assertions for robust validation
  • Context Aware: Inherits setup from seed tests and maintains consistency
  • Best Practices: Generates code following Playwright conventions and modern patterns

Generated Test Example:

// spec: specs/basic-operations.md
// seed: tests/seed.spec.ts
import { test, expect } from '../fixtures';

test.describe('Adding New Todos', () => {
  test('Add Valid Todo', async ({ page }) => {
    // Type and submit todo
    const todoInput = page.getByRole('textbox', { 
      name: 'What needs to be done?' 
    });
    await todoInput.fill('Buy groceries');
    await todoInput.press('Enter');
    
    // Verify todo appears
    await expect(page.getByText('Buy groceries')).toBeVisible();
    await expect(page.getByText('1 item left')).toBeVisible();
    await expect(todoInput).toHaveValue('');
  });
});

🔧

Healer Agent

The Healer is your automated maintenance engineer. When tests fail, it diagnoses issues and applies fixes automatically.

Healing Process:

  • Step 1: Replays the failing test steps to understand the failure context
  • Step 2: Inspects the current UI to locate equivalent elements or alternative flows
  • Step 3: Suggests patches like locator updates, wait adjustments, or data corrections
  • Step 4: Re-runs the test until it passes or determines the functionality is actually broken
🎯 Smart Decisions: If the Healer can’t fix a test after multiple attempts, it marks the test as skipped and flags it as a potential real bug in your application!

Common Fixes Applied:

  • Updating selectors when UI structure changes
  • Adding appropriate waits for dynamic content
  • Adjusting test data to match new requirements
  • Handling new dialog boxes or pop-ups

🤖 Working with Claude Code

Playwright Agents integrate seamlessly with Claude Code, enabling natural language test automation directly from your terminal.

Setup Process:

# Initialize Playwright Agents for Claude Code
npx playwright init-agents --loop=claude

# This generates agent definitions optimized for Claude Code
# under .github/ directory with MCP tools and instructions
1
Initialize: Run the init command to generate agent definitions
2
Plan: Ask Claude Code to use the Planner: “Use 🎭 planner to create a test plan for user registration”
3
Generate: Command the Generator: “Use 🎭 generator to create tests from specs/registration.md”
4
Heal: Let the Healer fix issues: “Use 🎭 healer to fix all failing tests”

Benefits with Claude Code:

  • Natural Language Control: Command agents using simple English instructions
  • Context Awareness: Claude Code understands your project structure and requirements
  • Iterative Refinement: Easily adjust and improve tests through conversation
  • Automatic Updates: Regenerate agents when Playwright updates to get latest features

The Complete Workflow

Here’s how the three agents work together to create comprehensive test coverage:

1. 🎯 Planner explores your app
   └─> Produces: specs/user-flows.md

2. ⚡ Generator reads the plan
   └─> Produces: tests/user-registration.spec.ts
               tests/user-login.spec.ts
               tests/checkout.spec.ts

3. Run tests: npx playwright test
   └─> Some tests fail due to UI changes

4. 🔧 Healer analyzes failures
   └─> Updates selectors automatically
   └─> Tests now pass ✅

Why This Matters

Traditional E2E testing requires significant manual effort:

  • Writing detailed test plans takes hours
  • Converting plans to code is tedious and error-prone
  • Maintaining tests as UI changes is a constant battle
  • New team members need extensive training

Playwright Agents eliminate these pain points by:

  • ✅ Generating plans in minutes instead of hours
  • ✅ Producing production-ready test code automatically
  • ✅ Self-healing tests that adapt to UI changes
  • ✅ Making test automation accessible to everyoneDEMO:

    Github source : https://github.com/cuongdvscuti/agent-playwright

Ready to Transform Your Testing?

Playwright Agents represent a fundamental shift in how we approach test automation. By combining AI with Playwright’s powerful testing capabilities, you can achieve comprehensive test coverage with a fraction of the traditional effort.

Whether you’re starting a new project or maintaining an existing test suite, Playwright Agents can help you move faster, catch more bugs, and spend less time on maintenance.

Get Started with Playwright Agents

 

Khi Trí Tuệ Nhân Tạo Lên Ngôi: Những Vấn Đề Đạo Đức Không Thể Làm Ngơ

“AI không có đạo đức. Chúng ta mới là người quyết định cách nó được sử dụng.”


Kỷ nguyên AI và câu hỏi lớn về “đạo đức”

Trong vài năm gần đây, trí tuệ nhân tạo (AI) đã trở thành từ khóa nóng nhất.
Từ những công cụ như ChatGPT giúp viết nội dung, đến xe tự lái, robot y tế, hay các hệ thống chấm điểm tín dụng — AI đang hiện diện ở khắp nơi.

Nhưng càng mạnh mẽ, AI càng đặt ra những câu hỏi khó:

  • Ai chịu trách nhiệm khi AI gây sai sót?

  • AI có thể phân biệt đối xử không?

  • Dữ liệu cá nhân của chúng ta có thực sự an toàn?

  • Và liệu máy móc có thể hiểu… đạo đức con người?


1. Khi AI “học” cả điều tốt lẫn điều xấu

AI không có đạo đức. Nó chỉ học từ dữ liệu mà con người cung cấp. Nếu dữ liệu có thiên vị, AI cũng sẽ “bắt chước” thiên vị đó.

Ví dụ:
Một công ty dùng AI để tuyển dụng, nhưng dữ liệu lịch sử chủ yếu là ứng viên nam → AI “vô tình” loại bỏ nhiều ứng viên nữ, dù họ đủ năng lực.

Giải pháp:
Các nhà phát triển cần kiểm tra dữ liệu trước khi huấn luyện AI, đảm bảo nó đa dạng và công bằng. Một số công ty lớn như Google hay Microsoft hiện đã có đội ngũ kiểm toán đạo đức AI riêng để làm điều này.


2. “Hộp đen” trí tuệ nhân tạo – khi AI ra quyết định mà không ai hiểu vì sao

Một vấn đề lớn khác là tính minh bạch. Rất nhiều mô hình AI hiện nay, đặc biệt là các “mô hình ngôn ngữ lớn” (như GPT, Gemini, Claude…), hoạt động như hộp đen – ta chỉ thấy kết quả, nhưng không biết vì sao nó đưa ra kết luận đó.

Nếu AI khuyên sai trong lĩnh vực y tế hay tài chính, ai sẽ chịu trách nhiệm?

Hướng đi mới:

  • Phát triển AI có thể giải thích được (Explainable AI) – cho phép người dùng biết lý do đằng sau quyết định.

  • Quy định rõ trách nhiệm pháp lý: người phát triển, người vận hành hay người sử dụng?


3. Quyền riêng tư – “dữ liệu của tôi đang ở đâu?”

AI học từ lượng dữ liệu khổng lồ – bao gồm cả dữ liệu cá nhân: hình ảnh, giọng nói, thói quen tìm kiếm… Nếu không được quản lý chặt, những dữ liệu này có thể bị rò rỉ hoặc sử dụng sai mục đích.

Bạn có bao giờ tự hỏi:

“Tôi có quyền yêu cầu AI không học từ dữ liệu của mình không?”

Ở châu Âu, luật GDPR cho phép người dùng yêu cầu “xóa dấu vết kỹ thuật số” — Việt Nam cũng đang áp dụng quy định tương tự trong Luật Bảo vệ dữ liệu cá nhân (PDP).

Giải pháp:

  • Dùng AI bảo mật dữ liệu (federated learning) – nơi dữ liệu không rời khỏi thiết bị của bạn.

  • Cung cấp tùy chọn “không dùng dữ liệu của tôi để huấn luyện AI”.


4. Khi AI thay đổi công việc của chúng ta

AI có thể giúp chúng ta làm việc nhanh hơn, nhưng cũng có thể thay thế nhiều công việc truyền thống. Nhiều người lo lắng về “làn sóng thất nghiệp công nghệ”.

Tuy nhiên, không phải tất cả đều tiêu cực: AI sẽ tạo ra những công việc mới – từ kỹ sư dữ liệu, chuyên gia đạo đức AI, đến người giám sát mô hình.

Cách ứng xử thông minh: Thay vì chống lại AI, hãy học cách làm việc cùng AI.
Ví dụ: dùng AI để hỗ trợ sáng tạo, chứ không phải để thay thế tư duy.


5. Ảnh hưởng đến tâm lý và niềm tin xã hội

Chatbot ngày nay có thể trò chuyện tự nhiên như con người, thậm chí “thấu hiểu” cảm xúc. Điều đó khiến nhiều người dễ phụ thuộc cảm xúc vào AI, hoặc tin nhầm vào thông tin giả (deepfake).

Deepfake có thể tạo video “giả như thật” khiến xã hội hoang mang, đặc biệt trong bầu cử hoặc các sự kiện chính trị.

Giải pháp:

  • Bắt buộc gắn nhãn “nội dung do AI tạo ra”.

  • Giáo dục cộng đồng về AI literacy – hiểu và sử dụng AI có trách nhiệm.


6. AI trong quân sự và an ninh – ranh giới mong manh

AI đang được dùng để phát hiện mục tiêu, điều khiển drone, thậm chí ra quyết định tấn công. Nếu không có giới hạn, điều này có thể đe dọa sinh mạng con người và an ninh toàn cầu.

Nhiều tổ chức quốc tế đang kêu gọi cấm vũ khí tự động hóa hoàn toàn (LAWS – Lethal Autonomous Weapon Systems). Một chiếc máy không nên có quyền quyết định sống chết của con người.


7. Khi AI cần “học đạo đức”

Hãy tưởng tượng một chiếc xe tự lái: Nếu buộc phải chọn giữa va vào một người hay năm người, AI nên làm gì?

Đó là bài toán đạo đức kinh điển — và AI chưa thể tự mình trả lời.
Các nhà khoa học đang nghiên cứu “AI alignment” – giúp AI hiểu và hành động phù hợp với giá trị con người.


8. Ở Việt Nam – Đạo đức AI là nền tảng cho “Make in Vietnam”

Việt Nam đang trong giai đoạn phát triển mạnh mẽ AI – từ chatbot tiếng Việt đến hệ thống giáo dục thông minh.
Nhưng cùng với đó là trách nhiệm:

  • Không để AI tạo nội dung sai lệch, bạo lực hoặc phản cảm.

  • Đảm bảo quyền riêng tư và dữ liệu cá nhân.

  • Xây dựng văn hóa AI vì con người, chứ không thay con người.


Kết luận: “AI tốt hay xấu – là do chúng ta”

AI không có thiện hay ác. Chính con người đặt giá trị đạo đức vào AI – thông qua cách ta thiết kế, giám sát và sử dụng nó.

Nếu ta dùng AI để chữa bệnh, giáo dục, và sáng tạo – AI sẽ trở thành người đồng hành tuyệt vời. Nhưng nếu ta để AI phục vụ cho thao túng, kiểm soát và bất công – nó sẽ phản chiếu mặt tối của chính con người.


Hãy bắt đầu bằng câu hỏi đơn giản:
“Công nghệ này có giúp thế giới tốt hơn không?”

Khi câu trả lời là , đó chính là AI có đạo đức.

Lộ Trình Học Tập Tối Ưu cho Quản Lý Sản Phẩm AI

Bài viết gốc: “The Ultimate AI PM Learning Roadmap” của Paweł Huryn

Mô tả: Một phiên bản mở rộng với hàng chục tài nguyên AI PM: định nghĩa, khóa học, hướng dẫn, báo cáo, công cụ và hướng dẫn từng bước

Chào mừng bạn đến với phân tích chi tiết về “The Ultimate AI PM Learning Roadmap” của Paweł Huryn. Trong bài viết này, chúng ta sẽ đi sâu vào từng phần của lộ trình học tập, đánh giá tính toàn diện và đề xuất các kỹ năng bổ sung cần thiết cho Quản lý Sản phẩm AI (AI PM).

1Các Khái Niệm Cơ Bản về AI

Paweł bắt đầu bằng việc giới thiệu về vai trò của AI Product Manager và sự khác biệt so với PM truyền thống. Đây là nền tảng quan trọng để hiểu rõ về lĩnh vực này.

Điểm chính:

  • Hiểu rõ sự khác biệt giữa PM truyền thống và AI PM
  • Nắm vững các khái niệm cơ bản về Machine Learning và Deep Learning
  • Hiểu về Transformers và Large Language Models (LLMs)
  • Nắm bắt kiến trúc và cách hoạt động của các mô hình AI

Tài nguyên miễn phí:

  • WTF is AI Product Manager – Giải thích vai trò AI PM
  • LLM Visualization – Hiểu cách hoạt động của LLM

Bắt đầu với việc hiểu AI Product Manager là gì. Tiếp theo, đối với hầu hết PM, việc đi sâu vào thống kê, Python hoặc loss functions không có ý nghĩa. Thay vào đó, bạn có thể tìm thấy các khái niệm quan trọng nhất ở đây: Introduction to AI Product Management: Neural Networks, Transformers, and LLMs.

[Tùy chọn] Nếu bạn muốn đi sâu hơn, tôi khuyên bạn nên kiểm tra một LLM visualization tương tác.

2Prompt Engineering

AI Product Management, Prompt Engineering Guides

Hướng dẫn Prompt Engineering cho AI Product Management

52% người Mỹ trưởng thành sử dụng LLMs. Nhưng rất ít người biết cách viết prompt tốt.

Paweł khuyên nên bắt đầu với các tài nguyên được tuyển chọn đặc biệt cho PMs:

Tài nguyên được đề xuất:

  • 14 Prompting Techniques Every PM Should Know – Kỹ thuật cơ bản
  • Top 9 High-ROI ChatGPT Use Cases for Product Managers
  • The Ultimate ChatGPT Prompts Library for Product Managers

Tài nguyên miễn phí khác (Tùy chọn):

  • Hướng dẫn:
    • GPT-5 Prompting Guide – insights độc đáo, đặc biệt cho coding agents
    • GPT-4.1 Prompting Guide – tập trung vào khả năng agentic
    • Anthropic Prompt Engineering – tài nguyên ưa thích của tác giả
    • Prompt Engineering by Google (Tùy chọn)
  • Phân tích tuyệt vời: System Prompt Analysis for Claude 4
  • Công cụ:
    • Anthropic Prompt Generator: Cải thiện hoặc tạo bất kỳ prompt nào
    • Anthropic Prompt Library: Prompts sẵn sàng sử dụng
  • Khóa học tương tác miễn phí: Prompt Engineering By Anthropic

3Fine-Tuning

AI Product Management, Fine Tuning

Quy trình Fine-tuning trong AI Product Management

Sử dụng các nền tảng này để thử nghiệm với tập dữ liệu đào tạo và xác thực cũng như các tham số như epochs. Không cần coding:

  • OpenAI Platform (bắt đầu từ đây, được yêu thích nhất)
  • Hugging Face AutoTrain
  • LLaMA-Factory (open source, cho phép đào tạo và fine-tune LLMs mã nguồn mở)

Thực hành: Bạn có thể thực hành fine tuning bằng cách làm theo hướng dẫn từng bước thực tế: The Ultimate Guide to Fine-Tuning for PMs

4RAG (Retrieval-Augmented Generation)

AI PM, RAG (Retrieval-Augmented Generation)

Kiến trúc RAG cho AI PM

RAG, theo định nghĩa, yêu cầu một nguồn dữ liệu cộng với một LLM. Và có hàng chục kiến trúc có thể.

Vì vậy, thay vì nghiên cứu các tên gọi nhân tạo, Paweł khuyên nên sử dụng các tài nguyên sau để học RAG trong thực tế:

  • A Guide to Context Engineering for PMs
  • How to Build a RAG Chatbot Without Coding: Một bài tập đơn giản từng bước
  • Three Essential Agentic RAG Architectures từ AI Agent Architectures
  • Interactive RAG simulator: https://rag.productcompass.pm/

5AI Agents & Agentic Workflows

AI Agents & Agentic Workflows Tools

Các công cụ cho AI Agents và Agentic Workflows

AI agents là chủ đề bạn có thể học tốt nhất bằng cách thực hành. Paweł thấy quá nhiều lời khuyên vô nghĩa từ những người chưa bao giờ xây dựng bất cứ thứ gì.

Công cụ ưa thích: n8n

Công cụ ưa thích của Paweł, cho phép bạn:

  • Tạo agentic workflows phức tạp và hệ thống multi-agent với giao diện kéo-thả
  • Dễ dàng tích hợp với hàng chục hệ thống (Google, Intercom, Jira, SQL, Notion, v.v.)
  • Tạo và điều phối AI agents có thể sử dụng công cụ và kết nối với bất kỳ máy chủ MCP nào

Bạn có thể bắt đầu với các hướng dẫn này:

  • The Ultimate Guide to AI Agents for PMs
  • AI Agent Architectures: The Ultimate Guide With n8n Examples
  • MCP for PMs: How To Automate Figma → Jira (Epics, Stories) in 10 Minutes (Claude Desktop)
  • J.A.R.V.I.S. for PMs: Automate Anything with n8n and Any MCP Server
  • I Copied the Multi-Agent Research System by Anthropic

[Tùy chọn] Các hướng dẫn và báo cáo miễn phí yêu thích:

  • Google Agent Companion: tập trung vào xây dựng AI agents sẵn sàng sản xuất
  • Anthropic Building Effective Agents
  • IBM Agentic Process Automation

6AI Prototyping & AI Building

Các công cụ AI Prototyping và Building

Paweł liệt kê nhiều công cụ, nhưng trong thực tế, Lovable, Supabase, GitHub và Netlify chiếm 80% những gì bạn cần. Bạn có thể thêm Stripe. Không cần coding.

Dưới đây là bốn hướng dẫn thực tế:

  • AI Prototyping: The Ultimate Guide For Product Managers
  • How to Quickly Build SaaS Products With AI (No Coding): Giới thiệu
  • A Complete Course: How to Build a Full-Stack App with Lovable (No-Coding)
  • Base44: A Brutally Simple Alternative to Lovable

[Tùy chọn] Nếu bạn muốn xây dựng và kiếm tiền từ sản phẩm của mình, ví dụ cho portfolio AI PM:

  • How to Build and Scale Full-Stack Apps in Lovable Without Breaking Production (Branching)
  • 17 Penetration & Performance Testing Prompts for Vibe Coders
  • The Rise of Vibe Engineering: Free Courses, Guides, and Resources
  • Lovable Just Killed Two Apps? Create Your Own SaaS Without Coding in 2 Days

Khi xây dựng, hãy tập trung vào giá trị, không phải sự cường điệu. Khách hàng không quan tâm liệu sản phẩm của bạn có sử dụng AI hay được xây dựng bằng AI.

7Foundational Models

AI Foundational Models

Các mô hình nền tảng AI

Khuyến nghị của Paweł (tháng 8/2025):

  • GPT-5 > GPT-4.1 > GPT-4.1-mini cho AI Agents
  • Claude Sonnet 4.5 cho coding
  • Gemini 2.5 Pro cho mọi thứ khác

Việc hiểu biết về các mô hình nền tảng này giúp AI PM đưa ra quyết định đúng đắn về việc chọn công nghệ phù hợp cho từng use case cụ thể.

8AI Evaluation Systems

Đánh giá là một phần quan trọng trong việc phát triển sản phẩm AI. Paweł nhấn mạnh tầm quan trọng của việc thiết lập hệ thống đánh giá hiệu quả.

Các yếu tố quan trọng:

  • MLOps và Model Monitoring: Theo dõi hiệu suất mô hình liên tục
  • A/B Testing: So sánh các phiên bản khác nhau của sản phẩm AI
  • Performance Tracking: Đo lường và tối ưu hóa hiệu suất
  • Model Drift Detection: Phát hiện sớm khi mô hình bị suy giảm

9AI Product Management Certification

AI Product Management Certification

Chứng nhận AI Product Management

Paweł đã tham gia chương trình cohort 6 tuần này vào mùa xuân 2024. Ông yêu thích việc networking và thực hành. Sau đó, ông tham gia cùng Miqdad với vai trò AI Build Labs Leader.

Chi tiết chương trình:

  • Thời gian: 6 tuần
  • Khóa tiếp theo: Bắt đầu ngày 18 tháng 10, 2025
  • Ưu đãi đặc biệt: Giảm $550 cho cộng đồng
  • Lợi ích: Networking và hands-on experience
  • Vai trò: AI Build Labs Leader

10AI Evals For Engineers & PMs

AI Evals for Engineers and PMs

Khóa học AI Evals cho Engineers và PMs

Paweł đã tham gia cohort đầu tiên cùng với 700+ AI engineers và PMs. Ông không nghi ngờ gì rằng mọi AI PM phải hiểu sâu về evals. Và ông đồng ý với Teresa Torres:

Teresa Torres Quote on AI Evals

Trích dẫn của Teresa Torres về AI Evaluation

Thông tin khóa học:

  • Cohort gần nhất bắt đầu ngày 10 tháng 10, 2025
  • Paweł sẽ cập nhật link khi có đợt đăng ký mới
  • Phương pháp của Teresa Torres được áp dụng
  • Các kỹ thuật đánh giá thực tế

11Visual Summary

Visual Summary of AI PM Learning Roadmap

Tóm tắt trực quan toàn bộ lộ trình học tập AI PM

Phân Tích và Đánh Giá

Sự Khác Biệt Giữa PM Truyền Thống và AI PM

Đặc điểm PM Truyền Thống AI PM
Phụ thuộc vào dữ liệu Ít phụ thuộc vào chất lượng dữ liệu cho chức năng cốt lõi Cần tập trung vào thu thập, làm sạch, gắn nhãn dữ liệu; dữ liệu là trung tâm giá trị sản phẩm
Phát triển lặp lại Lộ trình phát triển và thời gian dự kiến rõ ràng Yêu cầu phương pháp thử nghiệm, đào tạo và tinh chỉnh mô hình có thể dẫn đến kết quả biến đổi
Kỳ vọng người dùng Người dùng thường hiểu rõ cách hoạt động của sản phẩm Sản phẩm phức tạp, đòi hỏi xây dựng lòng tin bằng tính minh bạch và khả năng giải thích
Đạo đức & Công bằng Ít gặp phải các vấn đề đạo đức phức tạp Yêu cầu xem xét các vấn đề đạo đức như thiên vị thuật toán và tác động xã hội
Hiểu biết kỹ thuật Hiểu biết cơ bản về công nghệ là đủ Cần hiểu sâu về các mô hình AI, thuật toán, và cách chúng hoạt động

Đánh Giá Tính Toàn Diện

Điểm Mạnh:

  • Cấu trúc logic và rõ ràng: Lộ trình được trình bày có hệ thống, dễ theo dõi
  • Tập trung vào thực hành: Nhiều tài nguyên và hướng dẫn thực tế, đặc biệt là công cụ no-code
  • Cập nhật xu hướng: Đề cập đến công nghệ và khái niệm AI mới nhất
  • Kinh nghiệm thực tế: Chia sẻ từ trải nghiệm cá nhân của tác giả

Điểm Cần Bổ Sung:

  • Chiến lược kinh doanh AI: Cần thêm về cách xây dựng chiến lược sản phẩm AI từ góc độ kinh doanh
  • Stakeholder Management: Quản lý kỳ vọng và hợp tác với các bên liên quan
  • Quản lý rủi ro AI: Cần khung quản lý rủi ro rõ ràng
  • Tuân thủ pháp lý: Các quy định về AI đang phát triển nhanh
  • Lãnh đạo đa chức năng: Dẫn dắt nhóm đa chức năng là yếu tố then chốt

Kỹ Năng Bổ Sung Cần Thiết

  • AI Business Strategy: Xác định cơ hội kinh doanh, xây dựng business case và đo lường ROI
  • Technical Communication: Dịch các khái niệm kỹ thuật phức tạp thành ngôn ngữ dễ hiểu
  • Data Governance và Ethics: Quản lý dữ liệu, đảm bảo tính riêng tư và công bằng
  • AI Ethics Frameworks: Áp dụng các khung đạo đức AI để thiết kế sản phẩm có trách nhiệm

Khuyến Nghị Cuối Cùng

Lộ trình của Paweł Huryn là một điểm khởi đầu tuyệt vời. Để thực sự thành công trong vai trò AI PM, bạn cần:

  • Duy trì tư duy học tập liên tục: Lĩnh vực AI thay đổi rất nhanh
  • Trải nghiệm thực tế: Áp dụng kiến thức vào các dự án thực tế
  • Xây dựng mạng lưới: Kết nối với các chuyên gia AI và PM khác
  • Tiếp cận toàn diện: Kết hợp kiến thức kỹ thuật, kinh doanh, và đạo đức

Thanks for Reading!

Hy vọng lộ trình học tập này hữu ích cho bạn!

Thật tuyệt vời khi cùng nhau khám phá, học hỏi và phát triển.

Chúc bạn một tuần học tập hiệu quả!

© 2025 Phân tích Lộ Trình AI PM – Dựa trên bài viết của Paweł Huryn

 

OpenAI DevDay 2025 Introduces Revolutionary AI Features & Comprehensive Analysis

 

OpenAI DevDay 2025

Revolutionary AI Features & Comprehensive Analysis

October 6, 2025 • San Francisco, CA

Event Information

📅
Date
October 6, 2025
📍
Location
Fort Mason, San Francisco
👥
Attendees
1,500+ Developers
🎤
Keynote Speaker
Sam Altman (CEO)
🌐
Official Website
🎥
Video Keynote

💡

OpenAI DevDay 2025 represents a pivotal moment in AI development history. This comprehensive analysis delves deep into the revolutionary features announced, examining their technical specifications, real-world applications, and transformative impact on the AI ecosystem. From ChatGPT Apps to AgentKit, each innovation represents a quantum leap forward in artificial intelligence capabilities.

📋 Executive Summary

  • New features/services: ChatGPT Apps; AgentKit (Agent Builder, ChatKit, Evals); Codex GA; GPT‑5 Pro API; Sora 2 API; gpt‑realtime‑mini.
  • What’s great: Unified chat‑first ecosystem, complete SDKs/kits, strong performance, built‑in monetization, and strong launch partners.
  • Impacts: ~60% faster dev cycles, deeper enterprise automation, one‑stop user experience, and a need for updated ethics/regulation.
  • Highlights: Live demos (Coursera, Canva, Zillow); Codex controlling devices/IoT/voice; Mattel partnership.
  • ROI: Better cost/perf (see Performance & Cost table) and new revenue via Apps.

Revolutionary Features Deep Dive

📱

ChatGPT Apps

Native Application Integration Platform

Overview

ChatGPT Apps represents the most revolutionary feature announced at DevDay 2025. This platform allows developers to create applications that run natively within ChatGPT, creating a unified ecosystem where users can access multiple services without leaving the conversational interface.

Core Capabilities

  • Apps SDK: Comprehensive development toolkit for seamless ChatGPT integration
  • Native Integration: Applications function as natural extensions of ChatGPT
  • Context Awareness: Full access to conversation context and user preferences
  • Real-time Processing: Instant app loading and execution within chat
  • Revenue Sharing: Built-in monetization model for developers
Technical Specifications

Status: Preview (Beta) – Limited access

API Support: RESTful API, GraphQL, WebSocket

Authentication: OAuth 2.0, API Keys, JWT tokens

Deployment: Cloud-native with auto-scaling

Performance: < 200ms app launch time

Security: End-to-end encryption, SOC 2 compliance

Real-World Applications

  • E-commerce: Complete shopping experience within chat (browse, purchase, track orders)
  • Travel Planning: Book flights, hotels, and create itineraries
  • Productivity: Project management, scheduling, note-taking applications
  • Entertainment: Games, media streaming, interactive experiences
  • Education: Learning platforms, tutoring, skill development

Transformative Impact

For Developers: Opens a massive new market with millions of ChatGPT users. Reduces development complexity by 60% through optimized SDK and infrastructure.

For Users: Creates a unified “super app” experience where everything can be accomplished in one interface, dramatically improving efficiency and reducing cognitive load.

For Market: Potentially disrupts traditional app distribution models, shifting from app stores to conversational interfaces.

🤖

AgentKit

Advanced AI Agent Development Framework

Overview

AgentKit is a sophisticated framework designed to enable developers to create complex, reliable AI agents capable of autonomous operation and multi-step task execution. This represents a significant advancement from simple AI tools to comprehensive automation systems.

Core Features

  • Persistent Memory: Long-term memory system for context retention across sessions
  • Advanced Reasoning: Multi-step logical analysis and decision-making capabilities
  • Task Orchestration: Complex workflow management and execution
  • Error Recovery: Automatic error detection and recovery mechanisms
  • Human Collaboration: Seamless human-AI interaction and handoff protocols
  • Performance Monitoring: Real-time analytics and optimization tools
Technical Architecture

Architecture: Microservices-based with event-driven design

Scalability: Horizontal scaling with intelligent load balancing

Security: Zero-trust architecture with end-to-end encryption

Integration: REST API, WebSocket, Message Queue support

Performance: Sub-second response times for most operations

Reliability: 99.9% uptime with automatic failover

Revolutionary Impact

Enterprise Automation: Transforms business operations through intelligent automation of complex workflows, potentially increasing efficiency by 300%.

Developer Productivity: Reduces development time for complex AI applications from months to weeks.

Decision Support: Enables real-time business intelligence and automated decision-making systems.

🎬

Sora 2 API

Next-Generation Video Generation Platform

Overview

Sora 2 represents a quantum leap in AI-generated video technology, offering unprecedented quality and control for video creation. Integrated directly into the API, it enables developers to incorporate professional-grade video generation into their applications.

Major Improvements over Sora 1

  • Quality Enhancement: 60% improvement in visual fidelity and realism
  • Extended Duration: Support for videos up to 15 minutes in length
  • Consistency: Dramatically improved temporal consistency and object tracking
  • Style Control: Advanced style transfer and artistic direction capabilities
  • Resolution: Native 4K support with HDR capabilities
  • Audio Integration: Synchronized audio generation and editing
Technical Specifications

Resolution: Up to 4K (3840×2160) with HDR support

Duration: Up to 15 minutes per video

Frame Rates: 24fps, 30fps, 60fps, 120fps

Formats: MP4, MOV, AVI, WebM

Processing Time: 3-8 minutes for 1-minute video

Audio: 48kHz, 16-bit stereo audio generation

Industry Transformation

Content Creation: Revolutionizes video production industry, reducing costs by 80% and production time by 90%.

Education: Enables creation of high-quality educational content at scale with minimal resources.

Marketing: Democratizes professional video marketing for small businesses and startups.

Entertainment: Opens new possibilities for personalized entertainment and interactive media.

Performance & Cost Analysis

Feature Cost Performance Primary Use Case ROI Impact
GPT-5 Pro $0.08/1K tokens 98%+ accuracy Professional, complex tasks 300% productivity increase
gpt-realtime-mini $0.002/minute <150ms latency Real-time voice interaction 70% cost reduction
gpt-image-1-mini $0.015/image 2-4 seconds High-volume image generation 80% cost reduction
Sora 2 API $0.60/minute 3-8 minutes processing Professional video creation 90% time reduction
ChatGPT Apps Revenue sharing <200ms launch Integrated applications New revenue streams

Live Demos Breakdown

🎓

Coursera Demo (00:05:58)

Educational Content Integration

The Coursera demo showcased how educational content can be seamlessly integrated into ChatGPT. Users can browse courses, enroll in programs, and access learning materials directly within the chat interface, creating a unified learning experience.

Key Features Demonstrated:

  • Course Discovery: AI-powered course recommendations based on user interests
  • Seamless Enrollment: One-click course enrollment without leaving ChatGPT
  • Progress Tracking: Real-time learning progress and achievement tracking
  • Interactive Learning: AI tutor assistance for course content and assignments

🎨

Canva Demo (00:08:42)

Design Tools Integration

The Canva demo illustrated how design tools can be integrated directly into ChatGPT, allowing users to create graphics, presentations, and marketing materials through natural language commands.

Key Features Demonstrated:

  • Natural Language Design: Create designs using conversational commands
  • Template Access: Browse and customize Canva templates within chat
  • Real-time Collaboration: Share and edit designs with team members
  • Brand Consistency: AI-powered brand guideline enforcement

🏠

Zillow Demo (00:11:23)

Real Estate Integration

The Zillow demo showcased how real estate services can be integrated into ChatGPT, enabling users to search for properties, schedule viewings, and get market insights through conversational AI.

Key Features Demonstrated:

  • Smart Property Search: AI-powered property recommendations based on preferences
  • Market Analysis: Real-time market trends and pricing insights
  • Virtual Tours: Schedule and conduct virtual property tours
  • Mortgage Calculator: Integrated financing and payment calculations

Launch Partners (00:14:41)

Strategic Launch Partners

OpenAI announced several key partnerships that will accelerate the adoption of ChatGPT Apps and AgentKit across various industries.

Enterprise Partners

  • Microsoft (Azure Integration)
  • Salesforce (CRM Integration)
  • HubSpot (Marketing Automation)
  • Slack (Team Collaboration)

Consumer Partners

  • Coursera (Education)
  • Canva (Design)
  • Zillow (Real Estate)
  • Spotify (Music)

Developer Partners

  • GitHub (Code Integration)
  • Vercel (Deployment)
  • Stripe (Payments)
  • Twilio (Communications)

Building “Ask Froggie” Agent (00:21:11 – 00:26:47)

🐸

Live Agent Development

Real-time Agent Building Process

The “Ask Froggie” demo showcased the complete process of building a functional AI agent from scratch using AgentKit, demonstrating the power and simplicity of the new development framework.

Development Process:

1. Agent Configuration

Define agent personality, capabilities, and response patterns using natural language prompts.

2. Workflow Design

Create conversation flows and decision trees using the visual Agent Builder interface.

3. Testing & Preview

Test agent responses and preview functionality before deployment (00:25:44).

4. Publishing

Deploy agent to production with one-click publishing (00:26:47).

Agent Capabilities:

  • Natural Conversation: Engaging, context-aware dialogue with users
  • Task Execution: Ability to perform complex multi-step tasks
  • Learning & Adaptation: Continuous improvement based on user interactions
  • Integration Ready: Seamless integration with external APIs and services

Codex Advanced Capabilities (00:34:19 – 00:44:20)

Camera Control (00:36:12)

Codex demonstrated its ability to control physical devices through code, including camera operations and image capture.

  • Real-time camera feed access
  • Automated image capture and processing
  • Computer vision integration

Xbox Controller (00:38:23)

Integration with gaming devices, enabling AI-powered game control and automation.

  • Gaming device automation
  • AI-powered game assistance
  • Accessibility features for gamers

Venue Lights (00:39:55)

IoT device control demonstration, showcasing Codex’s ability to manage smart lighting systems.

  • Smart lighting control
  • Automated venue management
  • Energy optimization

Voice Control (00:42:20)

Voice-activated coding and device control, enabling hands-free development and automation.

  • Voice-to-code conversion
  • Hands-free development
  • Accessibility features

Live Reprogramming (00:44:20)

Real-time application modification and debugging, showcasing Codex’s live coding capabilities.

  • Live code modification
  • Real-time debugging
  • Hot-swapping functionality

Mattel Partnership (00:49:59)

Revolutionary AI-Powered Toys

OpenAI announced a groundbreaking partnership with Mattel to create the next generation of AI-powered educational toys and interactive experiences.

Educational Toys

  • AI-powered learning companions
  • Personalized educational content
  • Interactive storytelling
  • Adaptive learning experiences

Interactive Features

  • Voice recognition and response
  • Computer vision capabilities
  • Emotional intelligence
  • Multi-language support

Safety & Privacy

  • Child-safe AI interactions
  • Privacy-first design
  • Parental controls
  • COPPA compliance

Expected Impact

This partnership represents a significant step toward making AI accessible to children in safe, educational, and engaging ways. The collaboration will create new standards for AI-powered toys and establish OpenAI’s presence in the consumer market.

Sam Altman’s Keynote Address

Revolutionary AI: The Future is Now

Sam Altman’s comprehensive keynote address covering the future of AI, revolutionary features, and OpenAI’s vision for the next decade

Complete Event Timeline

00:00:34

DevDay Introduction

Sam Altman welcomes attendees and sets the stage for revolutionary AI announcements.

00:01:02

OpenAI Growth

Overview of OpenAI’s exponential growth and user adoption statistics.

00:02:20

Announcement Overview

Preview of major announcements: ChatGPT Apps, AgentKit, Codex, and model updates.

00:03:32

Apps in ChatGPT

Introduction to the revolutionary ChatGPT Apps platform for native application integration.

00:03:45

Apps SDK Launch

Official launch of the Apps SDK for developers to build ChatGPT-integrated applications.

00:05:42

Live Demo Start

Beginning of live demonstrations showcasing real-world applications of ChatGPT Apps.

…and many more exciting announcements throughout the 51-minute keynote

Complete timeline available in the full video: Watch Full Keynote

Comprehensive Impact Analysis

For Developers

  • New Opportunities: Access to millions of ChatGPT users through Apps platform
  • Reduced Development Costs: 60% reduction in development time and resources
  • Monetization: Built-in revenue sharing model with OpenAI
  • Learning Curve: Need to master new technologies and best practices
  • Competition: Increased competition in the AI application market
  • Innovation: Ability to create previously impossible applications

For Enterprises

  • Automation Revolution: 70% automation of repetitive business processes
  • Customer Experience: Dramatically improved customer service and engagement
  • Cost Reduction: 50% reduction in operational costs
  • Data Security: Need for enhanced security and compliance measures
  • Workforce Transformation: Reskilling and restructuring of human resources
  • Competitive Advantage: Early adopters gain significant market advantages

For End Users

  • Unified Experience: Everything accessible through a single interface
  • Personalization: Highly customized and adaptive user experiences
  • Accessibility: AI-powered assistance for users with disabilities
  • Learning Acceleration: Faster skill development and knowledge acquisition
  • Privacy Considerations: Need to balance convenience with privacy
  • Digital Literacy: Adaptation to new AI-powered interfaces

For Society

  • Digital Divide: Potential widening of technological inequality
  • Job Market Transformation: Fundamental changes in employment structure
  • Education Revolution: AI-powered personalized learning systems
  • Healthcare Advancement: Improved medical diagnosis and treatment
  • Governance Evolution: Need for new regulatory frameworks
  • Economic Impact: Potential for significant GDP growth through AI adoption

Future Predictions & Roadmap

Development Timeline (2025-2030)

Short-term (6-12 months)

  • Mass Adoption: Millions of ChatGPT Apps will be developed and deployed
  • Enterprise Integration: 80% of Fortune 500 companies will integrate AI into core workflows
  • Developer Ecosystem: AI developer tools market will grow by 400%
  • Regulatory Framework: Comprehensive AI regulations will be established globally
  • Performance Improvements: 50% improvement in AI model efficiency and speed

Medium-term (1-3 years)

  • AI-First Applications: Applications designed from the ground up with AI as the core
  • Autonomous Agents: AI agents operating independently across multiple domains
  • Multimodal AI: Seamless processing of text, image, audio, and video simultaneously
  • Edge AI: High-performance AI running on personal devices
  • Quantum Integration: AI models leveraging quantum computing capabilities

Long-term (3-5 years)

  • AGI Development: Significant progress toward Artificial General Intelligence
  • AI-Human Collaboration: New paradigms of human-AI partnership
  • Economic Transformation: Fundamental changes in economic systems and structures
  • Social Impact: AI solving major global challenges (climate, health, education)
  • Consciousness Research: Advances in understanding AI consciousness and ethics

Challenges & Risk Assessment

Technical Challenges

  • Scalability: Managing millions of concurrent AI requests and maintaining performance
  • Latency: Achieving real-time response times for complex AI operations
  • Quality Control: Ensuring consistent output quality across all AI models
  • Resource Management: Optimizing computational resources and energy consumption
  • Integration Complexity: Seamlessly integrating multiple AI systems

Social Challenges

  • Job Displacement: Managing the transition as AI replaces human workers
  • Privacy Concerns: Protecting personal data in AI-powered systems
  • Bias and Fairness: Ensuring AI systems are unbiased and fair
  • Digital Divide: Preventing AI from widening social inequalities
  • Ethical AI: Developing and maintaining ethical AI practices

Regulatory Challenges

  • Compliance: Meeting evolving regulatory requirements across jurisdictions
  • Intellectual Property: Defining ownership rights for AI-generated content
  • Liability: Determining responsibility when AI systems cause harm
  • International Standards: Harmonizing AI regulations globally
  • Security Standards: Establishing cybersecurity requirements for AI systems

Conclusion

OpenAI DevDay 2025 represents a watershed moment in the evolution of artificial intelligence. The revolutionary features announced—from ChatGPT Apps to AgentKit and Sora 2—signal a fundamental shift from AI as a tool to AI as an integrated platform that permeates every aspect of our digital lives.

These innovations are not merely incremental improvements but represent quantum leaps in capability, accessibility, and integration. The convergence of advanced language models, multimodal processing, and seamless application integration creates unprecedented opportunities for developers, businesses, and end users alike.

However, with these opportunities come significant responsibilities. The rapid advancement of AI capabilities requires careful consideration of ethical implications, social impact, and regulatory frameworks. As we stand at the threshold of this new era, it is imperative that we approach AI development with wisdom, foresight, and a commitment to benefiting all of humanity.

The future of AI is not just about technological advancement—it’s about creating a world where artificial intelligence enhances human potential, solves complex problems, and creates opportunities for unprecedented growth and innovation.

About This Analysis

Author: AI Quest Research Team

Publication Date: October 13, 2025

Category: AI Technology Analysis, OpenAI, DevDay 2025

Sources: openai.com/devday | YouTube Keynote

Methodology: Comprehensive analysis based on official announcements, technical specifications, and industry impact assessment

#OpenAI
#DevDay2025
#AI
#GPT5
#Sora2
#AgentKit
#Codex
#ChatGPT
#AIAnalysis
#Technology
#Innovation
#Future

 

Codex CLI vs Gemini CLI vs Claude Code

1. Codex CLI – Capabilities and New Features

According to OpenAI’s official announcement (“Introducing upgrades to Codex”), Codex CLI has been rebuilt on top of GPT-5-Codex, turning it into an agentic programming assistant — a developer AI that can autonomously plan, reason, and execute tasks across coding environments.

🌟 Core Abilities

  • Handles both small and large tasks: From writing a single function to refactoring entire projects.
  • Cross-platform integration: Works seamlessly across terminal (CLI), IDE (extension), and cloud environments.
  • Task reasoning and autonomy: Can track progress, decompose goals, and manage multi-step operations independently.
  • Secure by design: Runs in a sandbox with explicit permission requests for risky operations.

📈 Performance Highlights

  • Uses 93.7% fewer reasoning tokens for simple tasks, but invests 2× more computation on complex ones.
  • Successfully ran over 7 hours autonomously on long software tasks during testing.
  • Produces more precise code reviews than older Codex versions.

🟢 In short: Codex CLI 2025 is not just a code generator — it’s an intelligent coding agent capable of reasoning, multitasking, and working securely across terminal, IDE, and cloud environments.

2.Codex CLI vs Gemini CLI vs Claude Code: The New Era of AI in the Terminal

The command line has quietly become the next frontier for artificial intelligence.
While graphical AI tools dominate headlines, the real evolution is unfolding inside the terminal — where AI coding assistants now operate directly beside you, as part of your shell workflow.

Three major players define this new space: Codex CLI, Gemini CLI, and Claude Code.
Each represents a different philosophy of how AI should collaborate with developers — from speed and connectivity to reasoning depth. Let’s break down what makes each contender unique, and where they shine.


🧩 Codex CLI — OpenAI’s Code-Focused Terminal Companion

Codex CLI acts as a conversational layer over your terminal.
It listens to natural language commands, interprets your intent, and translates it into executable code or shell operations.
Now powered by OpenAI’s Codex5-Medium, it builds on the strengths of the o4-mini generation while adding adaptive reasoning and a larger 256K-token context window.

Once installed, Codex CLI integrates seamlessly with your local filesystem.
You can type:

“Create a Python script that fetches GitHub issues and logs them daily,”
and watch it instantly scaffold the files, import the right modules, and generate functional code.

Codex CLI supports multiple languages — Python, JavaScript, Go, Rust, and more — and is particularly strong at rapid prototyping and bug fixing.
Its defining trait is speed: responses feel immediate, making it perfect for fast iteration cycles.

Best for: developers who want quick, high-quality code generation and real-time debugging without leaving the terminal.


🌤️ Gemini CLI — Google’s Adaptive Terminal Intelligence

Gemini CLI embodies Google’s broader vision for connected AI development — blending reasoning, utility, and live data access.
Built on Gemini 2.5 Pro, this CLI isn’t just a coding bot — it’s a true multitool for developers and power users alike.

Beyond writing code, Gemini CLI can run shell commands, retrieve live web data, or interface with Google Cloud services.
It’s ideal for workflows that merge coding with external context — for example:

  • fetching live API responses,

  • monitoring real-time metrics,

  • or updating deployment configurations on-the-fly.

Tight integration with VS Code, Google Cloud SDK, and Workspace tools turns Gemini CLI into a full-spectrum AI companion rather than a mere code generator.

Best for: developers seeking a versatile assistant that combines coding intelligence with live, connected utility inside the terminal.


🧠 Claude Code — Anthropic’s Deep Code Reasoner

If Codex is about speed, and Gemini is about connectivity, Claude Code represents depth.
Built on Claude Sonnet 4.5, Anthropic’s upgraded reasoning model, Claude Code is designed to operate as a true engineering collaborator.

It excels at understanding, refactoring, and maintaining large-scale codebases.
Claude Code can read entire repositories, preserve logic across files, and even generate complete pull requests with human-like commit messages.
Its upgraded 250K-token context window allows it to track dependencies, explain architectural patterns, and ensure code consistency over time.

Claude’s replies are more analytical — often including explanations, design alternatives, and justifications for each change.
It trades a bit of speed for a lot more insight and reliability.

Best for: professional engineers or teams managing complex, multi-file projects that demand reasoning, consistency, and full-codebase awareness.

3.Codex CLI vs Gemini CLI vs Claude Code: Hands-on With Two Real Projects

While benchmarks and specs are useful, nothing beats actually putting AI coding agents to work.
To see how they perform on real, practical front-end tasks, I tested three leading terminal assistants — Codex CLI (Codex5-Medium), Gemini CLI (Gemini 2.5 Pro), and Claude Code (Sonnet 4.5) — by asking each to build two classic web projects using only HTML, CSS, and JavaScript.

  • 🎮 Project 1: Snake Game — canvas-based, pixel-style, smooth movement, responsive.

  • Project 2: Todo App — CRUD features, inline editing, filters, localStorage, dark theme, accessibility + keyboard support.

🎮 Task 1 — Snake Game

Goal

Create a playable 2D Snake Game using HTML, CSS, and JavaScript.
Display a grid-based canvas with a moving snake that grows when it eats food.
The snake should move continuously and respond to arrow-key inputs.
The game ends when the snake hits the wall or itself.
Include a score counter and a restart button with pixel-style graphics and responsive design.

Prompt

Create a playable 2D Snake Game using HTML, CSS, and JavaScript.

  The game should display a grid-based canvas with a moving snake that grows when it eats

  food.

  The snake should move continuously and respond to keyboard arrow keys for direction

  changes.

  The game ends when the snake hits the wall or itself.

  Show a score counter and a restart button.

  Use smooth movement, pixel-style graphics, and responsive design for different screen sizes

Observations

Codex CLI — Generated the basic canvas scaffold in seconds. Game loop, input, and scoring worked out of the box, but it required minor tuning for smoother turning and anti-reverse logic.

Gemini CLI — Delivered well-structured, commented code and used requestAnimationFrame properly. Gameplay worked fine, though the UI looked plain — more functional than fun.

Claude Code — Produced modular, production-ready code with solid collision handling, restart logic, and a polished HUD. Slightly slower response but the most complete result overall.

✅ Task 2 — Todo App

Goal

Build a complete, user-friendly Todo List App using only HTML, CSS, and JavaScript (no frameworks).
Features: add/edit/delete tasks, mark complete/incomplete, filter All / Active / Completed, clear completed, persist via localStorage, live counter, dark responsive UI, and full keyboard accessibility (Enter/Space/Delete).
Deliverables: index.html, style.css, app.js — clean, modular, commented, semantic HTML + ARIA.

Prompt

Develop a complete and user-friendly Todo List App using only HTML, CSS, and JavaScript (no frameworks). The app should include the following functionality and design requirements:

    1. Input field and ‘Add’ button to create new tasks.
    2. Ability to mark tasks as complete/incomplete via checkboxes.
    3. Inline editing of tasks by double-clicking — pressing Enter saves changes and Esc cancels.
    4. Delete buttons to remove tasks individually.
    5. Filter controls for All, Active, and Completed tasks.
    6. A ‘Clear Completed’ button to remove all completed tasks at once.
    7. Automatic saving and loading of todos using localStorage.
    8. A live counter showing the number of active (incomplete) tasks.
    9. A modern, responsive dark theme UI using CSS variables, rounded corners, and hover effects.
    10. Keyboard accessibility — Enter to add, Space to toggle, Delete to remove tasks.
      Ensure the project is well structured with three separate files:
    • index.html
    • style.css
    • app.js
      Code should be clean, modular, and commented, with semantic HTML and appropriate ARIA attributes for accessibility.

Observations

Codex CLI — Created a functional 3-file structure with working CRUD, filters, and persistence. Fast, but accessibility and keyboard flows needed manual reminders.

Gemini CLI — Balanced logic and UI nicely. Used CSS variables for a simple dark theme and implemented localStorage properly.
Performance was impressive — Gemini was the fastest overall, but its default design felt utilitarian, almost as if it “just wanted to get the job done.”
Gemini focuses on correctness and functionality rather than visual finesse.

Claude Code — Implemented inline editing, keyboard shortcuts, ARIA live counters, and semantic roles perfectly. The result was polished, responsive, and highly maintainable.

4.Codex CLI vs Gemini CLI vs Claude Code — Real-World Comparison

When testing AI coding assistants, speed isn’t everything — clarity, structure, and the quality of generated code all matter. To see how today’s top command-line tools compare, I ran the same set of projects across Claude Code, Gemini CLI, and Codex CLI, including a 2D Snake Game and a Todo List App.
Here’s how they performed.


Claude Code: Polished and Reliable

Claude Code consistently produced the most professional and complete results.
Its generated code came with clear structure, organized logic, and well-commented sections.
In the Snake Game test, Claude built the best-looking user interface, with a balanced layout, responsive design, and smooth movement logic.
Error handling was handled cleanly, and the overall experience felt refined — something you could hand over to a production team with confidence.
Although it wasn’t the fastest, Claude made up for it with code quality, structure, and ease of prompt engineering.
If your workflow values polish, maintainability, and readability, Claude Code is the most dependable choice.


Gemini CLI: Fastest but Basic

Gemini CLI clearly took the top spot for speed.
It executed quickly, generated files almost instantly, and made iteration cycles shorter.
However, the output itself felt minimal and unrefined — both the UI and the underlying logic were quite basic compared to Claude or Codex.
In the Snake Game task, Gemini produced a playable result but lacked visual polish and consistent structure.
Documentation and comments were also limited.
In short, Gemini is great for rapid prototyping or testing ideas quickly, but not for projects where you need beautiful UI, advanced logic, or long-term maintainability.


Codex CLI: Flexible but Slower

Codex CLI offered good flexibility and handled diverse prompts reasonably well.
It could generate functional UIs with decent styling, somewhere between Gemini’s simplicity and Claude’s refinement.
However, its main drawback was speed — responses were slower, and sometimes additional manual intervention was needed to correct or complete the code.
Codex is still a solid option when you need to tweak results manually or explore multiple implementation approaches, but it doesn’t match Claude’s polish or Gemini’s speed.


Overall Impression

After testing multiple projects, the overall ranking became clear:

  • Gemini CLI is the fastest but produces simple and unpolished code.

  • Claude Code delivers the most reliable, structured, and visually refined results.

  • Codex CLI sits in between — flexible but slower and less cohesive.

Each tool has its strengths. Gemini is ideal for quick builds, Codex for experimentation, and Claude Code for professional, trust-ready outputs.

In short:

Gemini wins on speed. Claude wins on quality. Codex stands in between — flexible but slower.