กลับหน้าแรกOpenClaw

สร้าง Agent Team ตัวแรกของคุณ! (Step-by-Step) | LeafBox Digest

N
Nattawut Ruangvivattanaroj (New)
11 มีนาคม 2569
อ่าน 5 นาที
สร้าง Agent Team ตัวแรกของคุณ! (Step-by-Step) | LeafBox Digest

จาก Agent ตัวเดียว สู่ Multi-Agent Routing

ตอนแรกที่นิวเริ่มใช้ OpenClaw ก็ใช้ Agent ตัวเดียวทำทุกอย่างเลยครับ... เขียนโค้ด, research, เขียนบทความ, ตอบอีเมล... ปรากฏว่ามันเริ่มมั่ว! บางทีสั่งให้เขียนโค้ด แต่ดันติดสไตล์การเขียนบทความมาด้วยซะงั้น เลยต้องหาทางแก้ จนมาเจอ Multi-Agent Routing นี่แหละครับ ปังมาก!

แนวคิดมันง่ายมากครับ: แทนที่จะมี Agent คนเดียวที่ทำทุกอย่าง (แล้วก็ไม่เก่งซักอย่าง) เราสร้าง "ทีม" Agent ที่แต่ละตัวมีหน้าที่ของตัวเองชัดเจน เหมือนทีมในสตาร์ทอัพเลยครับ มี dev, มี content writer, มี marketing... พอแยกหน้าที่กันแล้ว ทุกอย่างมีประสิทธิภาพขึ้นเยอะ!

Step 1: สร้าง Agent Workspaces

ก่อนอื่น เปิด terminal ขึ้นมาแล้วสร้าง workspace ให้ Agent 2 ตัวของเราก่อนเลยครับ: coder-agent สำหรับงานโค้ด และ writer-agent สำหรับงานเขียน

openclaw agents add coder-agent
openclaw agents add writer-agent

คำสั่งนี้จะสร้างโฟลเดอร์แยกให้แต่ละ Agent เลยครับ ง่ายแบบไม่ต้องคิดเลย 555+

Step 2: กำหนด "ตัวตน" ให้แต่ละ Agent (SOUL.md, AGENTS.md)

เข้าไปในโฟลเดอร์ของแต่ละ agent แล้วสร้างไฟล์ SOUL.md เพื่อบอกว่าเขาเป็นใคร

SOUL.md ของ coder-agent:

  • Core Truths: You are a world-class software engineer. You think in logic, algorithms, and clean code.
  • Boundaries: You do not write marketing copy or long-form articles.

SOUL.md ของ writer-agent:

  • Core Truths: You are a creative and engaging writer. You think in stories, hooks, and clear communication.
  • Boundaries: You do not write complex code.

แค่นี้ Agent ของเราก็มี "ตัวตน" ที่แตกต่างกันแล้วครับ Vibe ดีย์มากครับ

Step 3: หัวใจของระบบ - ตั้งค่า Routing ใน openclaw.json

เปิดไฟล์ openclaw.json ขึ้นมาครับ นี่คือศูนย์กลางการควบคุมของ OpenClaw เราจะเพิ่ม agents.list และ bindings เข้าไป

ส่วนที่สำคัญคือ bindings ครับ เรากำลังบอก OpenClaw ว่า:

  • ถ้าใน prompt มีคำว่า "code", "โค้ด" → ส่งไปที่ coder-agent
  • ถ้าใน prompt มีคำว่า "article", "บทความ" → ส่งไปที่ writer-agent

Step 4: Restart และ Verify

สุดท้าย, restart gateway เพื่อให้ config ใหม่ทำงาน แล้วเช็คสถานะ bindings ของเราครับ

openclaw gateway restart
openclaw agents list --bindings

ถ้าทุกอย่างถูกต้อง คุณจะเห็นว่า Agent ทั้งสองตัวของคุณพร้อมทำงานแล้ว!

สรุป

ส่วนตัวนิวว่า... นี่คือพื้นฐานที่ทรงพลังมากครับ การแยก Agent ทำให้แต่ละตัวเก่งเฉพาะด้านจริงๆ context ไม่ปนกันมั่ว, API call ก็ตรงเป้าขึ้นเยอะ ประหยัด cost ไปอีก! ตอนต่อไปเราจะมาดูกันว่ามี Agent Roles อะไรบ้างที่ทุกทีมต้องมี!

ไปด้วยกันครับ


โพสต์ต้นฉบับ: Facebook

#OpenClaw#Agent Team#AI#Automation#VibeCoder#LeafBox
N

Nattawut Ruangvivattanaroj (New)

CEO & Founder • LeafBox Technologies

CEO ของ LeafBox Technologies ผู้เชี่ยวชาญด้าน AI Agent, Vibe Coding และ AI Solutions สำหรับธุรกิจไทย