บทนำสู่ระบบ Multi-Agent

AI Agents ด้วย Hugging Face smolagents

Adel Nehme

VP of AI Curriculum, DataCamp

สถานการณ์: Career Advisor Agent

คำขอนี้ประกอบด้วยหลายงาน:

  • อัปเดต Resume
  • ค้นหางาน
  • เตรียมตัวสัมภาษณ์
  • วิจัยเงินเดือน

แต่ละงานต้องการเครื่องมือและ workflow ที่แตกต่างกัน!

AI Agents ด้วย Hugging Face smolagents

ทำไมต้องใช้ระบบ Multi-Agent?

  • ใช้ทีม agent ที่เชี่ยวชาญเฉพาะด้าน
  • แต่ละ agent มุ่งเน้นงานหรือโดเมนเดียว
  • ลดภาระและความสับสน

AI Agents ด้วย Hugging Face smolagents

Specialized Resume Agent

resume_agent = CodeAgent(
    tools=[WebSearchTool(), skill_translator, layout_generator],
    model=InferenceClientModel(),
    instructions="You are an expert in everything related to resumes.",
    name="resume_agent",
    description="Expert in resume writing and skill translation for career transitions"
)
AI Agents ด้วย Hugging Face smolagents

Company Research Specialist

company_agent = CodeAgent(
    tools=[WebSearchTool(), background_compatibility_checker],
    model=InferenceClientModel(),
    instructions="You are an expert in everything related to company research",
    name="company_agent",
    description="Expert in researching companies, culture, and hiring practices for job seekers"
)
  • สร้าง specialized agent เพิ่มเติมด้วยรูปแบบเดียวกัน
AI Agents ด้วย Hugging Face smolagents

Manager Agent

career_manager = CodeAgent(
    tools=[],
    model=InferenceClientModel(model_id="deepseek-ai/DeepSeek-R1"), # Reasoning model
    instructions="You are an advisory agent to help professionals build stellar careers",
    managed_agents=[resume_agent, company_agent, interview_agent, salary_agent]
)
  • มอบหมายงานให้ผู้เชี่ยวชาญที่เหมาะสมตามคำอธิบายของแต่ละ agent
  • ประสานงาน specialist agent 4 ตัวผ่านพารามิเตอร์ managed_agents
  • ได้ประโยชน์จากโมเดลที่มีความสามารถด้าน reasoning และการประสานงานสูง
AI Agents ด้วย Hugging Face smolagents

Multi-Agent Orchestration

result = career_manager.run("I want to switch from marketing to data science. 
Help me update my resume, find companies hiring, prepare for interviews, and understand salaries.")

AI Agents ด้วย Hugging Face smolagents

มาฝึกกันเถอะ!

AI Agents ด้วย Hugging Face smolagents

Preparing Video For Download...