Agent Design Recipes: Tool Use, Sub-agent, Control Flow

AI Navigate Original / 4/27/2026

💬 OpinionDeveloper Stack & InfrastructureTools & Practical Usage
共有:

Key Points

  • Build your-work-fitted agents via 3 patterns
  • Tool Use (functions), Sub-agent (role split), control flow (code)
  • Combine the 3 in practice; cap loops, log, approve, test
  • Avoid over-design; cost rises with Sub-agents; grow from minimal

From "Using" Agents to "Building" Them

Using ready-made agents like Claude Cowork or Manus is the entrance. To build an agent fitted to your work, you need to know design patterns. This article organizes 3 basic patterns: Tool Use, Sub-agent, control flow.

Pattern 1: Tool Use

Give the LLM, from outside, info it doesn't know or operations it can't do, as "tools (functions)." The AI calls and uses them itself.

Example: An AI That Answers Weather

tools: [
  {
    name: "get_weather",
    description: "Today's weather for a specified city",
    input: { city: "string" },
  },
  {
    name: "send_slack",
    description: "Send a message to Slack",
    input: { channel: "string", text: "string" },
  },
]

Asked "post Tokyo's weather to Slack," the AI calls in order get_weathersend_slack itself.

Design Tips

  • Make tool name/description concrete so the AI understands "what for, what"
  • Strictly define the input schema (JSON Schema). Vague, and the AI passes weird values
  • Make failure error text readable too. The AI can recover

Pattern 2: Sub-agent

Sign up to read the full article

Create a free account to access the full content of our original articles.