Deep Research implemented based on spring-ai-alibaba-graph.

The diagram shows the layered architecture and main call relationships of the core modules in deepresearch.
The diagram shows the primary flow of a user request within the deepresearch system.
-
DashScope API:
${AI_DASHSCOPE_API_KEY}DashScope API key
-
TavilySearch API:
${TAVILY_API_KEY}TavilySearch API key
-
Report export path:
${AI_DEEPRESEARCH_EXPORT_PATH}TIP: if omitted, files will be stored in the project root
Search Services (default: Tavily)
- Jina API:
${JINA_API_KEY} - aliyunaisearch:
- api-key:
${ALIYUN_AI_SEARCH_API_KEY} - base-url:
${ALIYUN_AI_SEARCH_BASE_URL}
- api-key:
Storage Options (default: in-memory)
-
redis:
${REDIS-PASSWORD}Redis password; TIP: defaults to localhost:6379
Coding Node (programming capability for LLM)
- The Python executor of the Coder node runs inside a Docker container and requires Docker configuration.
- Set
spring.ai.alibaba.deepresearch.python-coder.docker-hostin the config file; default isunix:///var/run/docker.sock. The project uses thepython:3-slimimage to create ephemeral containers. You can customize an image that includes common third-party libraries. Install them under/app/dependencyinside the image, and setspring.ai.alibaba.deepresearch.python-coder.image-nameto the image name in the config file.
- Set
RAG
- ElasticSearch:
- In
application.yml, setspring.ai.alibaba.deepresearch.rag.enabled: true - In
application.yml, setspring.ai.alibaba.deepresearch.rag.vector-store-type: elasticsearch - In
application.yml, configurespring.ai.alibaba.deepresearch.rag.elasticsearchwith ES connection details - Start ES middleware from the project root with the command below
docker compose -f docker-compose-middleware.yml up -d
- In the Knowledge Base page, create a new knowledge base and upload documents to ES
- In
MCP Services (WIP)
- AMap MCP
{
"researchAgent": {
"mcp-servers": [
{
"url": "https://mcp.amap.com?key=${AI_DASHSCOPE_API_KEY}",
"sse-endpoint": null,
"description": "This is an AMap service",
"enabled": false
}
]
}
} -
DashScope (Alibaba Bailian): https://bailian.console.aliyun.com
-
Tavily API Docs: https://docs.tavily.com/documentation/api-reference/endpoint/search
-
Jina API Docs: https://jina.ai/reader
-
AMap MCP Docs: https://lbs.amap.com/api/mcp-server/gettingstarted#t1
Right-click the DeepResearchApplication class and run it.
From the project root, run with Maven:
mvn spring-boot:run
- Build the Docker image from the project directory. This may take ~5 minutes depending on network speed.
docker build -t alibaba-deepresearch:v1.0 . - After building, run the container and set environment variables:
docker run -d \
--name alibaba-deepresearch \
-e AI_DASHSCOPE_API_KEY="your_key_here" \
-e TAVILY_API_KEY="your_key_here" \
# -e JINA_API_KEY="your_key_here" \ optional
-p 8080:8080 \
alibaba-deepresearch:v1.0- Alternatively, use docker-compose to start Redis, ElasticSearch, and the app:
docker-compose upNote:
- Set API keys in the
.envfile- Config files are under
dockerConfig; you can also set keys and related configs there
Test Cases
See DeepResearch.http for sample requests.
curl --location 'http://localhost:8080/chat/stream' \
--header 'Content-Type: application/json' \
--data '{
"thread_id": "__default_",
"enable_deepresearch": false,
"query": "Please analyze the reasons for the explosive popularity of Pop Mart",
"max_step_num": 2,
"auto_accepted_plan": true
}'
Debugging & Observability
Langfuse Configuration
- Sign up at https://cloud.langfuse.com
- Create a new project
- Go to Settings → API Keys
- Generate a new API key pair (public and secret)
- Encode the credentials to Base64:
echo -n "public_key:secret_key" | base64
[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("public_key:secret_key")) - In your yml, select the endpoint and set the encoded string as env
YOUR_BASE64_ENCODED_CREDENTIALS
Reference: https://langfuse.com/docs/opentelemetry/get-started
Thanks to the following contributors for improving this project (unordered):
- yingzi
- zhouyou
- NOBODY
- xiaohai-78
- VLSMB
- disaster1-tesk
- Allen Hu
- Makoto
- sixiyida
- Gfangxin
- AliciaHu
- swl
- huangzhen
- Tfh-Yqf
- anyin-xyz
- zhou youkang
- supermonkeyguys
- yuluo-yx
- Ken Liu
- co63ox
Community Study Group


