Introduction to Multi-Agent Systems

AI Agents with Hugging Face smolagents

Adel Nehme

VP of AI Curriculum, DataCamp

Scenario: Career Advisor Agent

The request involves many tasks:

  • Updating resumes
  • Job searching
  • Interview prep
  • Salary research

Each task needs different tools and workflows!

AI Agents with Hugging Face smolagents

Why Use Multi-Agent Systems?

  • Use a team of specialized agents
  • Each agent stays focused on one task or domain
  • Prevents overload and confusion

AI Agents with Hugging Face smolagents

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

A 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"
)
  • Create additional specialized agents using the same pattern.
AI Agents with Hugging Face smolagents

The 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]
)
  • Delegates tasks to the appropriate specialists based on their descriptions.
  • Coordinates four specialist agents using the managed_agents parameter.
  • Benefit from models with strong reasoning and coordination capabilities.
AI Agents with 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 with Hugging Face smolagents

Let's practice!

AI Agents with Hugging Face smolagents

Preparing Video For Download...