Inference Logoinference.sh

Multi-Agent System

Build agents that work together.


The Concept

Complex tasks benefit from specialization. Instead of one agent doing everything, create specialists that delegate to each other.


Example: Content Team

A content creation team with three agents:

code
1Content Director (main)2 Research Agent3 Writer Agent4 Editor Agent

Step 1: Create Research Agent

Name: research-agent

System Prompt:

code
1You are a research specialist. When asked about a topic:2 31. Search for relevant information42. Gather key facts and statistics53. Identify authoritative sources64. Summarize findings clearly7 8Return structured research notes, not final content.

Tools: web-search, summarize


Step 2: Create Writer Agent

Name: writer-agent

System Prompt:

code
1You are a content writer. When given research notes:2 31. Create engaging, well-structured content42. Use clear, accessible language53. Include relevant examples64. Format appropriately for the medium7 8Focus on quality writing, not research.

Tools: gpt-4 (for writing assistance)


Step 3: Create Editor Agent

Name: editor-agent

System Prompt:

code
1You are an editor. When given a draft:2 31. Check for clarity and flow42. Fix grammar and style issues53. Ensure consistency64. Suggest improvements7 8Return the polished version with change notes.

Tools: grammar-check


Step 4: Create Director Agent

Name: content-director

System Prompt:

code
1You are a content director managing a team.2 3When asked to create content:41. Send the topic to research-agent for research52. Send research to writer-agent for drafting63. Send draft to editor-agent for polishing74. Review and deliver final content8 9Coordinate the team, don't do their work.

Sub-Agents: research-agent, writer-agent, editor-agent


How It Works

code
1You: Write a blog post about AI agents in 20252 3Director: I'll coordinate the team on this.4          5          [Calling research-agent: "Research AI agents 2025 trends"]6          7          Research complete. Key findings:8          - Multi-modal agents emerging9          - Tool use becoming standard10          - Enterprise adoption growing11          12          [Calling writer-agent with research notes]13          14          Draft complete. 1,200 words covering trends,15          use cases, and predictions.16          17          [Calling editor-agent with draft]18          19          Editing complete. Final version ready.20          21          Here's your blog post:22          23          ...polished, publication-ready content...

Benefits

BenefitDescription
SpecializationEach agent excels at one thing
ReusabilityUse the same research agent elsewhere
ClarityClear responsibilities, easier debugging
QualityMultiple passes improve output

Other Multi-Agent Patterns

Customer Support Team

code
1Support Director2 Triage Agent (categorize issues)3 Technical Agent (solve tech problems)4 Billing Agent (handle payments)5 Escalation Agent (complex cases)

Code Review Team

code
1Review Lead2 Style Agent (formatting, conventions)3 Security Agent (vulnerabilities)4 Performance Agent (optimization)5 Documentation Agent (comments, docs)

Sales Assistant

code
1Sales Coordinator2 Lead Qualifier (score leads)3 Research Agent (company info)4 Proposal Writer (create proposals)5 Follow-up Agent (schedule, remind)

Tips

Start simple:

  • Begin with 2 agents
  • Add more as needed
  • Don't over-engineer

Clear handoffs:

  • Define what each agent returns
  • Make responsibilities explicit
  • Avoid overlap

Test individually:

  • Test each agent alone first
  • Then test together
  • Debug one at a time

That's It!

You've learned how to build multi-agent systems.

Back to Docs

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.