Build a Research Agent with Deep Agents
LangChain·2025-11-20 17:02

Deep Agents Overview - Deep Agents is an open-source agent harness incorporating planning, computer access, and sub-agent delegation tools, commonly found in agents like Manis and Cloud Code [1][46] - The harness is designed to be easily adaptable with custom prompts, tools, and sub-agents [2][47] Key Features and Tools - Deep Agents provides built-in tools such as planning, sub-agent delegation, and file system operations [6][7] - The built-in tools enable interaction with the file system, shell command execution, planning via to-dos, and task delegation [8] - Custom tools, instructions, and sub-agents can be added to Deep Agents to tailor it for specific use cases [6][47] Quick Start and Research Application - The Deep Agent quick start repo offers examples for different use cases, starting with research [2][5] - The research quick start includes tools like a search tool (using Tavi search API) and an optional "think" tool for auditing agent trajectory [12][13][14] - Task-specific instructions and sub-agents can be supplied to Deep Agents for any given use case [12] Agent Loop and Middleware - Deep Agents utilizes Langraph for orchestrating the agent loop, which involves the language model (LLM) calling tools in a loop [29] - Middleware serves as hooks within the agent loop, allowing for actions like summarization when context exceeds 170,000 tokens [30][32] - Middleware can provide tools to the agent, such as file system middleware, and perform actions like summarization and prompt caching [31][34] File System and State Management - By default, Deep Agents writes to an internal in-memory state object, but it supports different backends like a sandbox or local file system [37][38] - File reading and writing operations occur within the Langraph state object, enabling easy retrieval into the LLM's context window [40] Deployment and Visualization - Deep Agents can be run in a Jupyter notebook for interactive inspection or deployed as an application using Langraph [10][44] - A UI can be connected to the local Langraph server for visualizing generated files and agent interactions [3][45]