Multi-Agent Planning
A planner agent that breaks tasks into steps and delegates to specialists. Built with @agentskit/react and the planner skill.
Code
import { useChat, ChatContainer, Message, InputBar } from '@agentskit/react'
import { planner } from '@agentskit/skills'
import '@agentskit/react/theme'
function MultiAgentDemo() {
const chat = useChat({
adapter: yourAdapter,
skills: [planner],
systemPrompt: 'Break tasks into steps. Delegate research and coding to specialists.',
})
return (
<ChatContainer>
{chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
<InputBar chat={chat} placeholder="Give me a complex task..." />
</ChatContainer>
)
}
With Real Delegation (Runtime)
For actual multi-agent execution where child agents run independently:
import { createRuntime } from '@agentskit/runtime'
import { planner, researcher, coder } from '@agentskit/skills'
const runtime = createRuntime({
adapter: yourAdapter,
delegates: {
researcher: { skill: researcher },
coder: { skill: coder },
},
})
const result = await runtime.run('Build a REST API for task management', {
skill: planner,
})
Try it
cd apps/example-multi-agent
pnpm dev