🤖 AI Tools
· 6 min read

Kimi K2.6 Agent Swarm Tutorial — How to Use 300 Parallel AI Agents


Kimi K2.6’s Agent Swarm scales to 300 sub-agents executing 4,000 coordinated steps in a single session. On BrowseComp (Agent Swarm), K2.6 scores 86.3% vs GPT-5.4’s 78.4%. This tutorial covers setup, use cases, and real-world examples so you can start using it today.

What is Agent Swarm?

Agent Swarm is Kimi’s parallel execution system. Instead of processing tasks sequentially, K2.6 decomposes complex work into parallel, domain-specialized subtasks. Each subtask runs on its own sub-agent. A coordinator agent manages the full lifecycle: splitting, assigning, monitoring, and merging.

A single prompt can produce end-to-end outputs spanning documents, websites, spreadsheets, and code. You describe the goal, and the swarm handles the rest.

For background on how agents work in general, see How AI Agents Work.

How it works

Agent Swarm follows four stages:

1. Task decomposition

K2.6’s coordinator analyzes your prompt and breaks it into independent subtasks. Each subtask gets a clear scope, input context, and expected output format.

You: "Migrate all 60 Express route handlers from callbacks to async/await,
      add error boundaries, and update the tests."

Coordinator decomposes into:
  - Group A (30 agents): Migrate route handlers
  - Group B (20 agents): Add error boundaries
  - Group C (10 agents): Update corresponding tests

2. Agent spawning

Up to 300 sub-agents spin up simultaneously. Each agent receives its assigned files, shared context (project structure, coding conventions, dependencies), and specific instructions from the coordinator.

3. Coordination

The coordinator tracks all 4,000 possible steps across agents. It handles:

  • Dependency ordering: Agent B waits for Agent A if it needs A’s output
  • Conflict resolution: Two agents modifying the same utility file get serialized
  • Progress tracking: Failed agents get retried or reassigned
  • Resource balancing: Agents that finish early pick up remaining work

4. Synthesis

Results from all agents merge into a unified output. The coordinator validates consistency, resolves any remaining conflicts, and presents the final result.

Accessing Agent Swarm

There are three ways to use Agent Swarm:

Via kimi.com chat (agent mode)

Open kimi.com, select K2.6, and enable agent mode. Type your task and the swarm activates automatically for complex requests. You can see agent count and progress in the sidebar.

Via Kimi CLI

Install the Kimi CLI and use the /swarm command:

kimi
> /swarm 50  # Spawn up to 50 sub-agents
> Refactor all API handlers to use the new validation middleware

You can set the agent count from 1 to 300. Start small and scale up as needed.

Via API

Swarm capabilities are built into the K2.6 model. When you send complex tasks through the API, the model handles decomposition and coordination internally:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.moonshot.cn/v1",
    api_key="your-api-key"
)

response = client.chat.completions.create(
    model="kimi-k2.6",
    messages=[{
        "role": "user",
        "content": "Generate a complete marketing site with 12 pages from this brief: ..."
    }],
    extra_body={"swarm": {"max_agents": 100}}
)

For full API setup, see How to Use Kimi K2.6 API.

Use cases with examples

Batch codebase refactoring

Refactor 50+ files in parallel. Each agent handles a subset of files while the coordinator ensures consistency.

> /swarm 50
> Convert all class components in src/components/ to functional components
  with hooks. Preserve all prop types and default props.

The swarm assigns one agent per file (or group of related files), applies the same transformation pattern, and validates that imports and exports still resolve.

Generating a complete marketing site

Give the swarm a creative brief and it produces a full site: landing page, about, pricing, blog templates, contact form, and more.

> /swarm 20
> Build a complete marketing site for a developer tool called "ShipFast".
  Include: landing page, pricing (3 tiers), about, blog index, docs layout,
  changelog, and contact page. Use Astro + Tailwind. Mobile-first.

Each agent builds one page while sharing design tokens and component library.

Multi-format documentation

Generate PDF, HTML, and slide deck versions of the same content from a single source document.

> /swarm 15
> Take docs/architecture.md and produce:
  1. A polished HTML page with diagrams
  2. A PDF-ready version with table of contents
  3. A 20-slide presentation deck
  4. A README summary

Parallel research synthesis

Run research across hundreds of sources and merge findings into a unified report.

> /swarm 100
> Research the current state of WebAssembly adoption in production.
  Cover: browser support, server-side runtimes, language toolchains,
  performance benchmarks, and enterprise case studies.
  Synthesize into a 3000-word report with citations.

This is where K2.6 dominates BrowseComp. Each agent researches a specific angle, and the coordinator merges overlapping findings and resolves contradictions.

BrowseComp-style web research

The BrowseComp benchmark tests exactly this pattern: complex questions requiring information from many sources. K2.6’s 86.3% score comes from its ability to dispatch agents across sources and cross-reference results.

K2.6 vs K2.5 swarm comparison

FeatureK2.5K2.6
Max sub-agents100300
Max coordinated steps~1,2004,000
BrowseComp (Agent Swarm)78.4%86.3%
Conflict resolutionBasicAdvanced (dependency graph)
Agent reassignmentNoYes (idle agents pick up work)
Progress visibilityLimitedFull agent-level tracking

The jump from 100 to 300 agents is not just about raw parallelism. K2.6 also improved coordination quality. With 4,000 steps, agents can handle more complex interdependencies without the coordinator becoming a bottleneck.

For a full comparison, see Kimi K2.6 vs K2.5.

Tips for effective swarm usage

  1. Start with fewer agents. Use 10-20 agents first. Scale up only when you confirm the decomposition makes sense.
  2. Use plan mode first. Run /plan before /swarm to see how K2.6 will split the work.
  3. Match agent count to task size. 300 agents on a 5-file task wastes resources. Match the count to the number of independent work units.
  4. Watch your quota. Swarm tasks consume tokens fast. The Kimi Code Pro plan ($19/mo) gives higher limits.
  5. Provide clear scope. The more specific your prompt, the better the decomposition. Vague prompts lead to overlapping agent work.

Limitations

  • Compute cost. 300 agents running simultaneously burns through tokens and quota quickly. Budget accordingly.
  • Not all tasks benefit. Sequential reasoning tasks (debugging, architecture decisions, single-file changes) get no speedup from parallelism.
  • Coordination overhead. Very small tasks (under 5 files) may actually run slower with swarm due to the decomposition and merging overhead.
  • Conflict-heavy codebases. If most files depend on each other, agents spend more time waiting than working. Swarm works best on tasks with natural parallelism.

FAQ

How many agents can K2.6 run in parallel? Up to 300 sub-agents in a single session, coordinating up to 4,000 steps total.

Is Agent Swarm available via API? Yes. Swarm capabilities are built into the K2.6 model. You can control agent count through the swarm parameter in API calls.

What tasks benefit most from Agent Swarm? Batch operations across many files: refactoring, test generation, documentation, import updates, and multi-source research. Anything with natural parallelism.

How does Agent Swarm compare to other multi-agent frameworks? Most frameworks (CrewAI, AutoGen, LangGraph) require you to define agents and orchestration manually. Agent Swarm handles decomposition, spawning, coordination, and merging automatically from a single prompt. It is the only system that coordinates hundreds of agents on the same codebase without manual setup. See the Agent Swarm deep dive for architecture details.

Related: Kimi K2.6 Complete Guide · Kimi Agent Swarm Deep Dive · Kimi CLI Complete Guide · Kimi K2.6 vs K2.5 · Best AI Coding Tools 2026