Workflow
Sub Agents
icon
Search documents
Deep Agents JS
LangChain· 2025-08-18 16:19
Deep Agent Architecture - Deep agents utilize a planning tool to strategize task execution [4][5] - They employ a file system for organized context and information management, preventing context window overload [5] - Deep agents leverage specialized sub-agents to execute specific tasks, such as research or critique [5][6][18] - A detailed system prompt guides the overall operation of agents and sub-agents [6][10] Implementation and Usage - The process involves cloning the deep agents JS repository and the deep agents UI repository [7][13][14][19] - Configuration requires setting up environment variables, including API keys for web search (Tilli API key) and LLM provider (Anthropic API key), as well as specifying the Langraph server URL and agent ID [8][15][16][19] - The deep agent is instantiated using the `create deep agent` function, which requires a list of tools, instructions, and optionally, sub-agents [9][10] - The Langraph server is initiated using the command `npx langchain langraph cli dev` [8][13] - The deep agents UI runs on localhost 3000, allowing users to interact with the agent [16]
What are Deep Agents?
LangChain· 2025-07-31 18:29
Deep Agent Characteristics - Deep agents utilize a planning tool to manage long-term tasks, enabling cohesive action over extended periods [3][5][9] - Sub-agents are employed to focus on specific areas, preserving context and allowing for specialized expertise, which can improve overall results [3][10][11][12][13][15] - A file system is used to offload context, preventing performance degradation of the LLM by storing and accessing information as needed [3][16][17][18] - Detailed system prompts, often hundreds or thousands of lines long, are crucial for guiding the agent's behavior and tool usage [3][21][22][23] Deep Agent Implementation - Deep agents operate using the same tool-calling loop as simpler agents, but are distinguished by their prompts and tools [3][4][5] - Planning tools can be simple, such as a "to-do write" tool that generates and modifies task lists within the model's context [7][8] - Sub-agents can have specialized expertise and different permissions, allowing for focused work and better results [13][14] - File systems allow agents to manage context by referencing files instead of directly including large observations in the LLM context [17][18] Deep Agent Benefits - Deep agents are capable of handling longer time horizon and more complex tasks compared to naive LLM implementations [4][5] - Sub-agents facilitate context preservation, preventing the main agent's context from being polluted by sub-tasks and vice versa [11][12] - Reusable sub-agents can be created and used across different agents, promoting efficiency and modularity [14]