examples/deepresearch/README.md
A DeepResearch agent built with Spring AI Alibaba that conducts thorough research and writes polished reports. Using an LLM to call tools in a loop is the simplest form of an agent, but this can yield agents that are "shallow". DeepResearch implements task planning, sub agents, file system access, and a detailed prompt to solve complex, multi-step research tasks.
export AI_DASHSCOPE_API_KEY=your_dashscope_api_key
export JINA_API_KEY=your_jina_api_key # Optional
mvn spring-boot:run
Application.java.After the agent starts, open in your browser: http://localhost:8080/chatui/index.html
<div style="border: 2px solid #999; display: inline-block;"> </div>Now you can ask the agent complex research questions like:
DeepResearch implements an agentic architecture that goes beyond simple tool-calling loops. It combines planning, context management, and subagent collaboration to tackle complex research tasks that require multiple steps and deep investigation.
🎯 Planning & Task Decomposition
TodoListInterceptor to break down complex tasks into discrete steps📁 File System & Context Management
ls, read_file, write_file, edit_file, glob, grep tools for file operations🤝 Subagent Collaboration
🔧 MCP Tool Integration
Agent Framework
ReactAgent: ReAct pattern implementation with reasoning-action loopsInterceptor: Middleware mechanism for planning, file management, context editingHook: Event hooks for human approval, summarization, tool call limitsMemorySaver: In-memory state management with conversation historyBuiltin Interceptors
TodoListInterceptor: Task list management and trackingFilesystemInterceptor: File system access control with sandboxingSubAgentInterceptor: Subagent spawning and coordinationContextEditingInterceptor: Auto-compress context (triggers at 10K tokens)LargeResultEvictionInterceptor: Auto-dump large results to filesToolRetryInterceptor: Retry logic for failed tool callsBuiltin Hooks
SummarizationHook: Conversation history summarization (triggers at 120K tokens)HumanInTheLoopHook: Human approval for critical operationsToolCallLimitHook: Limit tool calls per run (default: 25)Integration Capabilities