Overview ↗
noOriginal Documentation
Documentation Index#
Fetch the complete documentation index at: https://docs.langchain.com/llms.txt Use this file to discover all available pages before exploring further.
Build UIs that display real-time subagent streams, task progress, and sandbox for Deep Agents
Build frontends that visualize deep agent workflows in real time. These patterns show how to render subagent progress, task planning, streaming content, and IDE-like sandbox experiences from agents created with createDeepAgent.
Architecture#
Deep Agents use a coordinator-worker architecture. The main agent plans tasks and delegates to specialized subagents, each running in isolation. On the frontend, useStream surfaces both the coordinator’s messages and each subagent’s streaming state.
%%{
init: {
"fontFamily": "monospace",
"flowchart": {
"curve": "curve"
}
}
}%%
graph LR
FRONTEND["useStream()"]
BACKEND["createDeepAgent()"]
SUB1["Subagent A"]
SUB2["Subagent B"]
BACKEND --"stream"--> FRONTEND
FRONTEND --"submit"--> BACKEND
BACKEND --"delegate"--> SUB1
BACKEND --"delegate"--> SUB2
SUB1 --"result"--> BACKEND
SUB2 --"result"--> BACKEND
classDef blueHighlight fill:#DBEAFE,stroke:#2563EB,color:#1E3A8A;
classDef greenHighlight fill:#DCFCE7,stroke:#16A34A,color:#14532D;
classDef purpleHighlight fill:#EDE9FE,stroke:#7C3AED,color:#4C1D95;
class FRONTEND blueHighlight;
class BACKEND greenHighlight;
class SUB1,SUB2 purpleHighlight;
const agent = createDeepAgent({
tools: [getWeather],
system: "You are a helpful assistant",
subagents: [
{
name: "researcher",
description: "Research assistant",
},
],
});On the frontend, connect with useStream the same way as with createAgent. Deep agent patterns use additional useStream features like stream.subagents, stream.values.todos, and filterSubagentMessages to render subagent-specific UIs.
function App() {
const stream = useStream<typeof agent>({
apiUrl: "http://localhost:2024",
assistantId: "agent",
});
// Deep agent state beyond messages
const todos = stream.values?.todos;
const subagents = stream.subagents;
}Patterns#
Display specialist subagents with streaming content, progress tracking, and collapsible cards.
Track agent progress with a real-time todo list synced from agent state.
Build an IDE-like UI with a file browser, code viewer, and diff panel backed by a sandbox.
Related patterns#
The LangChain frontend patterns, including
markdown messages, tool calling, and human-in-the-loop, all work with deep
agents too. Deep Agents are built on the same LangGraph runtime, so
useStream provides the same core API.
Edit this page on GitHub or file an issue.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.