Day 01 Foundations

What Are Multi-Agent Systems and When to Use Them

Multi-agent systems use multiple AI models working together — each handling different parts of a complex task. Day 1 explains the core patterns and when th

~1 hour Hands-on Precision AI Academy

Today's Objective

Learn the core concepts of What Are Multi-Agent Systems and When to Use Them and apply them in practical exercises.

01

Why Multiple Agents?

A single AI model call works for simple tasks. But complex tasks benefit from multiple specialized agents for three reasons:

02

The Three Core Patterns

PatternWhen to UseExample
OrchestratorSequential, dependent tasksPlan → Research → Write → Edit
DebateWhen you need verificationDraft → Critique → Improve
PipelineParallel processingAnalyze 5 documents simultaneously
03

Your First Multi-Agent System

basic-agents.js
basic-agents.js
import Anthropic from '@anthropic-ai/sdk';
import * as dotenv from 'dotenv';
dotenv.config();

const client = new Anthropic();

// Agent factory: creates a specialized agent with a role
function createAgent(systemPrompt) {
  return async function(userMessage, history = []) {
    const messages = [...history, { role: 'user', content: userMessage }];
    
    const response = await client.messages.create({
      model: 'claude-opus-4-5',
      max_tokens: 2048,
      system: systemPrompt,
      messages
    });
    
    return response.content[0].text;
  };
}

// Create specialized agents
const researcher = createAgent(
  'You are a thorough researcher. Given a topic, produce a structured research summary with key facts, data points, and open questions.'
);

const writer = createAgent(
  'You are a skilled writer. Given research notes, write clear, engaging prose. No jargon. Concrete examples.'
);

const editor = createAgent(
  'You are a sharp editor. Review text for clarity, accuracy, and conciseness. Flag weak arguments and vague language. Return the improved version.'
);

// Simple sequential pipeline
async function researchAndWrite(topic) {
  console.log('Step 1: Researching...');
  const research = await researcher(`Research this topic: ${topic}`);
  
  console.log('Step 2: Writing...');
  const draft = await writer(`Write an article based on this research:

${research}`);
  
  console.log('Step 3: Editing...');
  const final = await editor(`Edit and improve this article:

${draft}`);
  
  return { research, draft, final };
}

const result = await researchAndWrite('The impact of AI on knowledge work');
console.log('FINAL:
', result.final);

Supporting References & Reading

Go deeper with these external resources.

Docs
What Are Multi-Agent Systems and When to Use Them Official documentation for multi agent.
GitHub
What Are Multi-Agent Systems and When to Use Them Open source examples and projects for What Are Multi-Agent Systems and When to Use Them
MDN
MDN Web Docs Comprehensive web technology reference

Day 1 Checkpoint

Before moving on, confirm understanding of these key concepts:

Continue To Day 2
Day 2 of the Multi-Agent Systems course