Amazon Nova Act
Amazon Nova Act คือ AI agent SDK ที่ออกแบบมาสำหรับ web browser automation โดยเฉพาะ สามารถควบคุม web browser ด้วยภาษาธรรมชาติ ทำงานหลายขั้นตอนบนเว็บได้เหมือนมนุษย์ Nova Act รวม visual understanding เข้ากับ action execution ทำให้ agent เข้าใจ UI ที่ซับซ้อนและ dynamic ได้ดีกว่า traditional Selenium-based automation
Nova Act อยู่ในช่วง research preview และพัฒนาต่อเนื่อง บริการนี้ integrate กับ Amazon Bedrock และใช้ Playwright เป็น browser automation layer ทำให้ developers ควบคุมการทำงานของ agent ได้ทั้งแบบ high-level (บอก task เป็น natural language) และ low-level (ควบคุมแต่ละ action) เหมาะสำหรับ web task automation, RPA modernization และ browser-based testing
AWS Docs: https://nova.amazon.com/act (research preview)
สถาปัตยกรรม
ฟีเจอร์หลัก
Control Web Browsers with Natural Language
สั่งให้ agent ทำงานบนเว็บด้วยภาษาธรรมชาติ เช่น "ค้นหาบน Google แล้วสรุปผล 5 อันดับแรก" หรือ "Login เข้าระบบแล้วดาวน์โหลด report เดือนที่แล้ว" โดยไม่ต้องเขียน CSS selectors หรือ XPath
Multi-Step Web Tasks
จัดการ tasks ที่ต้องทำหลายขั้นตอนต่อเนื่องกัน เช่น login, navigate, fill form, submit, ดึงผลลัพธ์ และ logout agent จัดการ page transitions, loading states และ dynamic content ได้อัตโนมัติ
Form Filling
กรอกฟอร์มที่ซับซ้อนได้อัตโนมัติ รองรับ text fields, dropdowns, checkboxes, radio buttons, date pickers และ file uploads โดยเข้าใจ context ว่าแต่ละ field ต้องการข้อมูลอะไร
Data Extraction
ดึงข้อมูลจากหน้าเว็บ เช่น ตาราง, รายการราคา, ผลการค้นหา หรือข้อมูลที่กระจายอยู่หลายหน้า แปลงเป็น structured data (JSON, CSV) ได้โดยตรง
Screenshot and Visual Understanding
ถ่าย screenshots และวิเคราะห์ visual content ของหน้าเว็บเพื่อเข้าใจ layout, navigation structure และ state ปัจจุบัน ทำให้จัดการกับ UI ที่เปลี่ยนแปลงบ่อยได้โดยไม่ต้อง update scripts
Playwright Integration
ใช้ Playwright เป็น browser automation engine ทำให้ developers ที่คุ้นเคยกับ Playwright สามารถ mix Nova Act high-level commands กับ low-level Playwright operations ได้ใน workflow เดียว
Python SDK
SDK สำหรับ Python ที่ใช้งานง่าย รองรับ async/await, context managers และ error handling ที่ดี มี type hints สำหรับ IDE support
Headless and Headed Browser Support
รัน browser แบบ headless (ไม่มี UI) สำหรับ production automation หรือแบบ headed (มีหน้าจอ) สำหรับ development/debugging และ tasks ที่ต้องการ visual verification
Works with Amazon Bedrock
ใช้ Amazon Nova models ผ่าน Amazon Bedrock เป็น reasoning engine ทำให้ agent มีความสามารถด้าน reasoning, visual understanding และ language comprehension ที่แข็งแกร่ง
การติดตั้งและการตั้งค่า
ติดตั้ง Nova Act SDK
# ติดตั้ง nova-act SDK (research preview)
pip install nova-act
# ติดตั้ง dependencies
pip install playwright
playwright install chromium
# ตรวจสอบ AWS credentials
aws configure
ขอ Preview Access
- ไปที่ https://nova.amazon.com/act
- กรอกฟอร์มขอ access
- รับ API key ผ่านอีเมล
- ตั้งค่า environment variable:
NOVA_ACT_API_KEY=your-key
IAM Permissions ที่จำเป็น
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": "arn:aws:bedrock:*::foundation-model/amazon.nova-*"
}
]
}
วิธีใช้งาน
Basic Usage: Simple Web Task
from nova_act import NovaAct
# เปิด browser และทำ task
with NovaAct(
starting_page="https://www.google.com",
headless=False # ตั้งเป็น True สำหรับ production
) as agent:
# ค้นหาข้อมูลและดึงผลลัพธ์
result = agent.act("ค้นหา 'AWS re:Invent 2024 highlights' และบอกว่า top 3 ข่าวคืออะไร")
print(result.response)
Multi-Step Task: Login และ Extract Data
from nova_act import NovaAct
import json
def extract_monthly_report(username, password, month):
"""Login เข้าระบบและดาวน์โหลด monthly report"""
with NovaAct(
starting_page="https://internal-portal.company.com/login",
headless=True
) as agent:
# Step 1: Login
agent.act(f"กรอก username '{username}' และ password แล้วกด login")
# Step 2: Navigate to reports
agent.act("ไปที่เมนู Reports > Financial Reports")
# Step 3: เลือกเดือน
agent.act(f"เลือก month filter เป็น '{month}' แล้วกด Generate Report")
# Step 4: ดึงข้อมูลจากตาราง
result = agent.act(
"ดึงข้อมูลจากตารางรายงานทั้งหมดเป็น JSON โดยมี fields: date, description, amount, category"
)
# Step 5: Download
agent.act("กดปุ่ม Download CSV")
return json.loads(result.response)
# ใช้งาน
report_data = extract_monthly_report(
username="[email protected]",
password="secure_password",
month="December 2024"
)
print(f"Found {len(report_data)} records")
Web Scraping ที่ Dynamic
from nova_act import NovaAct
def scrape_product_listings(search_term, max_pages=5):
"""ดึงข้อมูลสินค้าจาก e-commerce platform"""
all_products = []
with NovaAct(
starting_page="https://www.lazada.co.th",
headless=True
) as agent:
# ค้นหาสินค้า
agent.act(f"ค้นหาสินค้า '{search_term}' และรอให้ผลการค้นหาโหลดเสร็จ")
for page in range(max_pages):
# ดึงข้อมูลสินค้าในหน้าปัจจุบัน
result = agent.act(
"ดึงข้อมูลสินค้าทุกรายการในหน้านี้เป็น JSON array "
"โดยมี fields: name, price, seller, rating, sold_count"
)
try:
import json
products = json.loads(result.response)
all_products.extend(products)
print(f"Page {page+1}: Found {len(products)} products")
except:
print(f"Could not parse page {page+1}")
# ไปหน้าถัดไป
has_next = agent.act("มีปุ่ม Next page ไหม? ถ้ามีให้คลิก ถ้าไม่มีให้ตอบว่า 'no more pages'")
if 'no more pages' in has_next.response.lower():
break
return all_products
products = scrape_product_listings("laptop gaming", max_pages=3)
print(f"Total products scraped: {len(products)}")
Form Automation
from nova_act import NovaAct
def submit_expense_report(expenses):
"""ส่งใบเบิกค่าใช้จ่ายอัตโนมัติ"""
with NovaAct(
starting_page="https://expense.company.com",
headless=False
) as agent:
agent.act("Login ด้วย SSO credentials")
agent.act("คลิก 'New Expense Report' เพื่อสร้างรายการใหม่")
agent.act(f"กรอกชื่อรายงานว่า 'Business Travel - January 2024'")
for expense in expenses:
agent.act("คลิก 'Add Item' เพื่อเพิ่มรายการ")
agent.act(f"กรอก Date เป็น '{expense['date']}'")
agent.act(f"เลือก Category เป็น '{expense['category']}'")
agent.act(f"กรอก Description เป็น '{expense['description']}'")
agent.act(f"กรอก Amount เป็น '{expense['amount']}'")
if expense.get('receipt'):
agent.act(f"upload ไฟล์ receipt จาก path '{expense['receipt']}'")
agent.act("คลิก Save เพื่อบันทึกรายการนี้")
# Submit for approval
result = agent.act("คลิก Submit for Approval และยืนยัน กลับบอกหมายเลข report number")
print(f"Submitted: {result.response}")
expenses = [
{'date': '2024-01-10', 'category': 'Travel', 'description': 'ตั๋วเครื่องบิน BKK-SIN', 'amount': '8500', 'receipt': '/receipts/flight.pdf'},
{'date': '2024-01-11', 'category': 'Hotel', 'description': 'Marina Bay Sands 2 คืน', 'amount': '15000', 'receipt': '/receipts/hotel.pdf'},
]
submit_expense_report(expenses)
Combining with Playwright
from nova_act import NovaAct
from playwright.sync_api import Page
def complex_workflow():
"""ผสม Nova Act กับ Playwright สำหรับ complex scenarios"""
with NovaAct(starting_page="https://app.example.com") as agent:
# ใช้ Nova Act สำหรับ high-level tasks
agent.act("Login และไปที่ Dashboard")
# ดึง underlying Playwright page object
page: Page = agent.page
# ใช้ Playwright โดยตรงสำหรับ performance-critical operations
# เช่น ดึง network requests หรือ intercept APIs
page.on("response", lambda response: print(f"Response: {response.url}"))
# กลับมาใช้ Nova Act
result = agent.act("คลิก Export Data และรอให้ download เสร็จ")
# Screenshot สำหรับ debugging
page.screenshot(path="debug_screenshot.png")
return result
ราคา (ประมาณการในบาท)
| รายการ | ราคา USD | ราคา THB (1 USD = 35 บาท) |
|---|---|---|
| Nova Act SDK | Research Preview - ฟรีในช่วง beta | ฟรีในช่วง preview |
| Amazon Bedrock (Nova models) | ~$0.002-0.008/1K tokens | ~0.07-0.28 บาท/1K tokens |
| คาดการณ์ราคา production | ~$0.10-0.50/task | ~3.50-17.50 บาท/task |
หมายเหตุ: ราคาอาจเปลี่ยนแปลงเมื่อออก GA (General Availability) ราคาจะขึ้นอยู่กับ:
- จำนวน LLM tokens ที่ใช้ต่อ task
- Compute time ของ browser session
- จำนวน steps และ screenshots ที่ใช้
เหมาะสำหรับ
- ทีม QA ที่ต้องการ automated browser testing ที่ยืดหยุ่นกว่า Selenium และ Cypress
- นักพัฒนาที่ต้องการ automate web-based repetitive tasks โดยไม่ต้องดูแล selectors
- บริษัทที่ต้องการ modernize RPA (Robotic Process Automation) ให้ใช้ AI
- ทีมที่ต้องการ web scraping จากเว็บที่ไม่มี API และมี dynamic content
- Operations teams ที่ต้องการ automate multi-step workflows บน web portals
- QA engineers ที่ต้องการ test flows ที่ซับซ้อนด้วย natural language specs
ใช้ร่วมกับ AWS Services
- Amazon Bedrock - Nova models สำหรับ reasoning และ visual understanding
- AWS Lambda - รัน Nova Act tasks แบบ serverless
- Amazon S3 - เก็บ screenshots, downloaded files และ task outputs
- Amazon DynamoDB - บันทึก task results และ execution history
- Amazon EventBridge - trigger automation tasks ตาม schedule หรือ events
- AWS Step Functions - orchestrate complex multi-step automation workflows
- Amazon CloudWatch - monitor task success/failure rates และ latency
- Amazon SNS - แจ้งเตือนเมื่อ automation tasks ล้มเหลวหรือเสร็จสิ้น
Use Case ตัวอย่าง
1. Logistics Company Automate Shipment Tracking
บริษัท logistics ใช้ Nova Act สร้าง agent ที่ login ไปยัง portals ของ shipping carriers 8 แห่ง (DHL, FedEx, Ninja Van, Kerry, Flash, J&T, SPX, Thailand Post) เพื่อดึงข้อมูล tracking status และ invoice อัตโนมัติทุก 2 ชั่วโมง ข้อมูลถูก normalize และบันทึกใน DynamoDB Agent จัดการกับ captcha บางแห่งและ UI ที่เปลี่ยนเป็นครั้งคราวโดยไม่ต้อง update code ลดงาน manual data entry ได้ 95% และลด errors จากการพิมพ์ข้อมูลผิด
2. Finance Team Automate Monthly Reporting
ทีม finance ของบริษัท FMCG ใช้ Nova Act สร้าง automation ที่ login เข้าระบบ ERP, CRM และ banking portals หลายแห่ง ดึงข้อมูล sales, expenses, bank statements รวมเข้า Google Sheets และสร้าง management report อัตโนมัติทุกต้นเดือน process ที่เคยใช้เวลา 2 วันเหลือเพียง 3 ชั่วโมง CFO ได้รับ report พร้อมวิเคราะห์ภายในเช้าวันที่ 2 ของเดือน
3. E-Commerce Price Monitoring
ทีม pricing ของ retailer ออนไลน์ใช้ Nova Act monitor ราคาสินค้าจาก competitors เช่น Shopee, Lazada, JD Central, Central Online สำหรับสินค้า top 500 SKU ทุกวัน agent เข้าไปค้นหาแต่ละสินค้า ดึงราคา, โปรโมชั่น, stock status และ seller information บันทึกใน S3 และ analyze ด้วย Athena ทีม pricing ใช้ข้อมูลนี้ adjust ราคาได้รวดเร็วขึ้น เพิ่ม competitiveness และรักษา margin