Agents
Multi-Agent Delegation
Coordinate multiple specialist agents from a parent agent using directed delegation.
Coordinate multiple specialist agents from a parent agent using directed delegation.
Install
npm install @agentskit/runtime @agentskit/adapters @agentskit/skills @agentskit/toolsQuick Start
import { createRuntime, createSharedContext } from '@agentskit/runtime'
import { anthropic } from '@agentskit/adapters'
import { planner, researcher, coder } from '@agentskit/skills'
import { webSearch, filesystem } from '@agentskit/tools'
const runtime = createRuntime({
adapter: anthropic({ apiKey, model: 'claude-sonnet-4-6' }),
})
const result = await runtime.run('Build a landing page about quantum computing', {
skill: planner,
delegates: {
researcher: { skill: researcher, tools: [webSearch()], maxSteps: 3 },
coder: { skill: coder, tools: [...filesystem({ basePath: './src' })], maxSteps: 8 },
},
})How It Works
When you configure delegates, the runtime auto-generates tools named delegate_<name>. The parent LLM calls them like any other tool. Each delegate runs its own ReAct loop and returns a result.
DelegateConfig
interface DelegateConfig {
skill: SkillDefinition // required — the child's behavior
tools?: ToolDefinition[] // tools available to the child
adapter?: AdapterFactory // optional — different LLM per child
maxSteps?: number // default: 5
}Shared Context
const ctx = createSharedContext({ project: 'landing-page' })
runtime.run('Build it', { delegates: { ... }, sharedContext: ctx })
// Parent reads/writes
ctx.set('key', 'value')
ctx.get('key')
// Children get read-only view — set() is not availableChild Isolation
- Fresh messages — no parent history
- Inherits observers — events visible in logging
- No memory — doesn't share parent's memory
- Depth limit —
maxDelegationDepthdefault 3
Events
[10:00:01] => delegate:start researcher [depth=1] "Research quantum computing"
[10:00:03] <= delegate:end researcher (2100ms) "Found 3 papers on..."Related
- Runtime — ReAct loop
- Skills — behavioral prompts
- Observability — trace events
Skills
@agentskit/skills provides five built-in SkillDefinition values (system prompts + metadata). Skills carry tools hints and delegates hints so the runtime knows which tools to merge and whic
@agentskit/react
React chat UI built on @agentskit/core. Provides three hooks and seven headless components styled via CSS variables.