Multi-agent delegation with a live log. A supervisor LLM orchestrates three specialized sub-agents exposed as tools, and every delegation streams into the UI in real time via shared agent state.
- Three specialized sub-agents:
research_agent(gathers facts),writing_agent(drafts prose),critique_agent(reviews drafts) — each is its own fullcreate_agent(...) - Sub-agents-as-tools: the supervisor calls them through
@toolwrappers; each wrapper runs the sub-agent and appends an entry to the shareddelegationsstate slot - Live delegation log: the left pane renders
delegationsfrom agent state, growing as the supervisor fans work out
Click a suggestion chip, or type your own prompt. For example:
- "Produce a short blog post about the benefits of cold exposure training. Research first, then write, then critique."
- "Explain how large language models handle tool calling. Research, write a paragraph, then critique."
- "Summarize the current state of reusable rockets in 1 polished paragraph, with research and critique."
Watch the delegation log fill in as the supervisor runs research → write → critique.
- Each delegation tool returns a LangGraph
Command(update={"delegations": [...], "messages": [ToolMessage(...)]})— appending to shared state AND feeding the result back as a tool message in one step AgentStatesubclasseslangchain.agents.AgentStateand addsdelegations: list[Delegation];create_agent(..., state_schema=AgentState)makes it available on the frontend- Frontend uses
useAgent({ agentId: "subagents", updates: [UseAgentUpdate.OnStateChanged, UseAgentUpdate.OnRunStatusChanged] })and readsagent.state.delegations+agent.isRunningto drive the log CopilotKitprovider usesagent="subagents", backed bysrc/agents/subagents.py