Úvod do multi-agentních systémů

AI Agents with Hugging Face smolagents

Adel Nehme

VP of AI Curriculum, DataCamp

Scénář: Agent kariérního poradce

Požadavek zahrnuje mnoho úkolů:

  • Aktualizace životopisu
  • Hledání práce
  • Příprava na pohovor
  • Průzkum platů

Každý úkol vyžaduje jiné nástroje a postupy!

AI Agents with Hugging Face smolagents

Proč používat multi-agentní systémy?

  • Použijte tým specializovaných agentů
  • Každý agent se soustředí na jeden úkol nebo oblast
  • Zabraňuje přetížení a nejasnostem

AI Agents with Hugging Face smolagents

Specializovaný agent pro životopis

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 with Hugging Face smolagents

Specialista na průzkum firem

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"
)
  • Vytvořte další specializované agenty pomocí stejného vzoru.
AI Agents with Hugging Face smolagents

Agent manažer

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]
)
  • Deleguje úkoly příslušným specialistům na základě jejich popisů.
  • Koordinuje čtyři specializované agenty pomocí parametru managed_agents.
  • Těží z modelů se silnými schopnostmi uvažování a koordinace.
AI Agents with Hugging Face smolagents

Orchestrace multi-agentního systému

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 with Hugging Face smolagents

Pojďme procvičovat!

AI Agents with Hugging Face smolagents

Preparing Video For Download...