Skip to content

Commit 427872a

Browse files
committed
feature: 对接deer-flow
1 parent a78cd4e commit 427872a

File tree

14,508 files changed

+3844295
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

14,508 files changed

+3844295
-29
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "runtime/deer-flow"]
2+
path = runtime/deer-flow
3+
url = [email protected]:bytedance/deer-flow.git

Makefile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,9 @@ label-studio-adapter-docker-build:
8484

8585
.PHONY: deer-flow-docker-build
8686
deer-flow-docker-build:
87-
@if [ -d "../deer-flow/.git" ]; then \
88-
cd ../deer-flow && git pull; \
89-
else \
90-
git clone [email protected]:bytedance/deer-flow.git ../deer-flow; \
91-
fi
92-
sed -i "s/dark/light/g" "../deer-flow/web/src/components/deer-flow/theme-provider-wrapper.tsx"
9387
cp -n runtime/deer-flow/.env.example runtime/deer-flow/.env
9488
cp -n runtime/deer-flow/conf.yaml.example runtime/deer-flow/conf.yaml
95-
cp runtime/deer-flow/.env ../deer-flow/.env
96-
cp runtime/deer-flow/conf.yaml ../deer-flow/conf.yaml
97-
cd ../deer-flow && docker compose build
89+
cd runtime/deer-flow && docker compose build
9890

9991
.PHONY: mineru-docker-build
10092
mineru-docker-build:
@@ -152,7 +144,8 @@ deer-flow-docker-install:
152144
cd deployment/docker/datamate && cp .env.deer-flow.example .env && docker compose -f docker-compose.yml up -d
153145
cp -n runtime/deer-flow/.env.example runtime/deer-flow/.env
154146
cp -n runtime/deer-flow/conf.yaml.example runtime/deer-flow/conf.yaml
155-
cp runtime/deer-flow/.env deployment/docker/deer-flow/.env && cp runtime/deer-flow/conf.yaml deployment/docker/deer-flow/conf.yaml
147+
cp runtime/deer-flow/.env deployment/docker/deer-flow/.env
148+
cp runtime/deer-flow/conf.yaml deployment/docker/deer-flow/conf.yaml
156149
cd deployment/docker/deer-flow && docker compose -f docker-compose.yml up -d
157150

158151
.PHONY: deer-flow-docker-uninstall
@@ -175,12 +168,17 @@ datamate-k8s-uninstall:
175168
.PHONY: deer-flow-k8s-install
176169
deer-flow-k8s-install:
177170
helm upgrade datamate deployment/helm/datamate/ -n $(NAMESPACE) --install --set global.deerFlow.enable=true
171+
cp -n runtime/deer-flow/.env.example runtime/deer-flow/.env
172+
cp -n runtime/deer-flow/conf.yaml.example runtime/deer-flow/conf.yaml
178173
cp runtime/deer-flow/.env deployment/helm/deer-flow/charts/public/.env
179174
cp runtime/deer-flow/conf.yaml deployment/helm/deer-flow/charts/public/conf.yaml
180175
helm upgrade deer-flow deployment/helm/deer-flow -n $(NAMESPACE) --install
181176

182177
.PHONY: deer-flow-k8s-uninstall
183178
deer-flow-k8s-uninstall:
179+
@if helm list -n $(NAMESPACE) -f datamate | grep -q datamate; then \
180+
helm upgrade datamate deployment/helm/datamate/ -n $(NAMESPACE) --set global.deerFlow.enable=false; \
181+
fi
184182
helm uninstall deer-flow -n $(NAMESPACE) --ignore-not-found
185183

186184
.PHONY: milvus-k8s-install

runtime/deer-flow/.dockerignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.env
2+
Dockerfile
3+
.dockerignore
4+
.git
5+
.gitignore
6+
7+
# Python
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
*.so
12+
.Python
13+
env/
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
.venv/
30+
31+
# Web
32+
node_modules
33+
npm-debug.log
34+
.next
35+
36+
# IDE
37+
.idea/
38+
.vscode/
39+
*.swp
40+
*.swo
41+
42+
# OS
43+
.DS_Store
44+
Thumbs.db
45+
46+
# Project specific
47+
conf.yaml
48+
web/
49+
docs/
50+
examples/
51+
assets/
52+
tests/
53+
*.log

runtime/deer-flow/.env

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Application Settings
2+
DEBUG=True
3+
APP_ENV=development
4+
5+
# docker build args
6+
NEXT_PUBLIC_API_URL="/deer-flow-backend"
7+
8+
AGENT_RECURSION_LIMIT=30
9+
10+
# CORS settings
11+
# Comma-separated list of allowed origins for CORS requests
12+
# Example: ALLOWED_ORIGINS=http://localhost:3000,http://example.com
13+
ALLOWED_ORIGINS=*
14+
15+
# Enable or disable MCP server configuration, the default is false.
16+
# Please enable this feature before securing your front-end and back-end in a managed environment.
17+
# Otherwise, you system could be compromised.
18+
ENABLE_MCP_SERVER_CONFIGURATION=true
19+
20+
# Enable or disable PYTHON_REPL configuration, the default is false.
21+
# Please enable this feature before securing your in a managed environment.
22+
# Otherwise, you system could be compromised.
23+
ENABLE_PYTHON_REPL=false
24+
25+
# Search Engine, Supported values: tavily (recommended), duckduckgo, brave_search, arxiv, searx
26+
SEARCH_API=tavily
27+
TAVILY_API_KEY=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
28+
# SEARX_HOST=xxx # Required only if SEARCH_API is searx.(compatible with both Searx and SearxNG)
29+
# BRAVE_SEARCH_API_KEY=xxx # Required only if SEARCH_API is brave_search
30+
# JINA_API_KEY=jina_xxx # Optional, default is None
31+
32+
# Optional, RAG provider
33+
# RAG_PROVIDER=vikingdb_knowledge_base
34+
# VIKINGDB_KNOWLEDGE_BASE_API_URL="api-knowledgebase.mlp.cn-beijing.volces.com"
35+
# VIKINGDB_KNOWLEDGE_BASE_API_AK="AKxxx"
36+
# VIKINGDB_KNOWLEDGE_BASE_API_SK=""
37+
# VIKINGDB_KNOWLEDGE_BASE_RETRIEVAL_SIZE=15
38+
39+
# RAG_PROVIDER=ragflow
40+
# RAGFLOW_API_URL="http://localhost:9388"
41+
# RAGFLOW_API_KEY="ragflow-xxx"
42+
# RAGFLOW_RETRIEVAL_SIZE=10
43+
# RAGFLOW_CROSS_LANGUAGES=English,Chinese,Spanish,French,German,Japanese,Korean # Optional. To use RAGFlow's cross-language search, please separate each language with a single comma
44+
45+
# RAG_PROVIDER=dify
46+
# DIFY_API_URL="https://api.dify.ai/v1"
47+
# DIFY_API_KEY="dataset-xxx"
48+
49+
# MOI is a hybrid database that mainly serves enterprise users (https://www.matrixorigin.io/matrixone-intelligence)
50+
# RAG_PROVIDER=moi
51+
# MOI_API_URL="https://cluster.matrixonecloud.cn"
52+
# MOI_API_KEY="xxx-xxx-xxx-xxx"
53+
# MOI_RETRIEVAL_SIZE=10
54+
# MOI_LIST_LIMIT=10
55+
56+
57+
# RAG_PROVIDER: milvus (using free milvus instance on zilliz cloud: https://docs.zilliz.com/docs/quick-start )
58+
RAG_PROVIDER=milvus
59+
MILVUS_URI=http://milvus-standalone:19530
60+
MILVUS_USER=root
61+
MILVUS_PASSWORD=Milvus
62+
MILVUS_COLLECTION=test
63+
MILVUS_EMBEDDING_PROVIDER=dashscope
64+
MILVUS_EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
65+
MILVUS_EMBEDDING_MODEL=text-embedding-v4
66+
MILVUS_EMBEDDING_API_KEY=sk-2cdb289117d6481ab23d7b154261f489
67+
MILVUS_AUTO_LOAD_EXAMPLES=true
68+
69+
# RAG_PROVIDER: milvus (using milvus lite on Mac or Linux)
70+
# RAG_PROVIDER=milvus
71+
# MILVUS_URI=./milvus_demo.db
72+
# MILVUS_COLLECTION=documents
73+
# MILVUS_EMBEDDING_PROVIDER=openai # support openai,dashscope
74+
# MILVUS_EMBEDDING_BASE_URL=
75+
# MILVUS_EMBEDDING_MODEL=
76+
# MILVUS_EMBEDDING_API_KEY=
77+
# MILVUS_AUTO_LOAD_EXAMPLES=true
78+
79+
# Optional, volcengine TTS for generating podcast
80+
VOLCENGINE_TTS_APPID=xxx
81+
VOLCENGINE_TTS_ACCESS_TOKEN=xxx
82+
# VOLCENGINE_TTS_CLUSTER=volcano_tts # Optional, default is volcano_tts
83+
# VOLCENGINE_TTS_VOICE_TYPE=BV700_V2_streaming # Optional, default is BV700_V2_streaming
84+
85+
# Option, for langsmith tracing and monitoring
86+
# LANGSMITH_TRACING=true
87+
# LANGSMITH_ENDPOINT="https://api.smith.langchain.com"
88+
# LANGSMITH_API_KEY="xxx"
89+
# LANGSMITH_PROJECT="xxx"
90+
91+
# [!NOTE]
92+
# For model settings and other configurations, please refer to `docs/configuration_guide.md`
93+
94+
# Option, for langgraph mongodb checkpointer
95+
# Enable LangGraph checkpoint saver, supports MongoDB, Postgres
96+
#LANGGRAPH_CHECKPOINT_SAVER=true
97+
# Set the database URL for saving checkpoints
98+
#LANGGRAPH_CHECKPOINT_DB_URL=mongodb://localhost:27017/
99+
#LANGGRAPH_CHECKPOINT_DB_URL=postgresql://localhost:5432/postgres

runtime/deer-flow/.env.example

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,11 @@ TAVILY_API_KEY=tvly-xxx
5353
# MOI_RETRIEVAL_SIZE=10
5454
# MOI_LIST_LIMIT=10
5555

56-
5756
# RAG_PROVIDER: milvus (using free milvus instance on zilliz cloud: https://docs.zilliz.com/docs/quick-start )
5857
# RAG_PROVIDER=milvus
59-
# MILVUS_URI=<endpoint_of_self_hosted_milvus_or_zilliz_cloud>
60-
# MILVUS_USER=<username_of_self_hosted_milvus_or_zilliz_cloud>
61-
# MILVUS_PASSWORD=<password_of_self_hosted_milvus_or_zilliz_cloud>
58+
# MILVUS_URI=http://milvus-standalone:19530
59+
# MILVUS_USER=root
60+
# MILVUS_PASSWORD=Milvus
6261
# MILVUS_COLLECTION=documents
6362
# MILVUS_EMBEDDING_PROVIDER=openai # support openai,dashscope
6463
# MILVUS_EMBEDDING_BASE_URL=
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Publish Containers
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
jobs:
12+
13+
backend-container:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
attestations: write
19+
id-token: write
20+
env:
21+
REGISTRY: ghcr.io
22+
IMAGE_NAME: ${{ github.repository }}
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
- name: Log in to the Container registry
28+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #v3.4.0
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Extract metadata (tags, labels) for Docker
34+
id: meta
35+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 #v5.7.0
36+
with:
37+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
- name: Build and push Docker image
39+
id: push
40+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0
41+
with:
42+
context: .
43+
file: Dockerfile
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
48+
- name: Generate artifact attestation
49+
uses: actions/attest-build-provenance@v2
50+
with:
51+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
52+
subject-digest: ${{ steps.push.outputs.digest }}
53+
push-to-registry: true
54+
55+
frontend-container:
56+
runs-on: ubuntu-latest
57+
permissions:
58+
contents: read
59+
packages: write
60+
attestations: write
61+
id-token: write
62+
env:
63+
REGISTRY: ghcr.io
64+
IMAGE_NAME: ${{ github.repository }}-web
65+
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
- name: Log in to the Container registry
70+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #v3.4.0
71+
with:
72+
registry: ${{ env.REGISTRY }}
73+
username: ${{ github.actor }}
74+
password: ${{ secrets.GITHUB_TOKEN }}
75+
- name: Extract metadata (tags, labels) for Docker
76+
id: meta
77+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 #v5.7.0
78+
with:
79+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
80+
- name: Build and push Docker image
81+
id: push
82+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0
83+
with:
84+
context: web
85+
file: web/Dockerfile
86+
push: true
87+
tags: ${{ steps.meta.outputs.tags }}
88+
labels: ${{ steps.meta.outputs.labels }}
89+
90+
- name: Generate artifact attestation
91+
uses: actions/attest-build-provenance@v2
92+
with:
93+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
94+
subject-digest: ${{ steps.push.outputs.digest }}
95+
push-to-registry: true
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Lint Check
2+
3+
on:
4+
push:
5+
branches: [ 'main' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Install the latest version of uv
19+
uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 #v6.5.0
20+
with:
21+
version: "latest"
22+
23+
- name: Install dependencies
24+
run: |
25+
uv venv --python 3.12
26+
uv pip install -e ".[dev]"
27+
28+
- name: Run linters
29+
run: |
30+
source .venv/bin/activate
31+
make lint
32+
33+
lint-frontend:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
38+
- name: Setup Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: '22'
42+
43+
- name: Install pnpm
44+
run: npm install -g pnpm
45+
46+
- name: Install frontend dependencies
47+
run: |
48+
cd web
49+
pnpm install --frozen-lockfile
50+
51+
- name: Run frontend linting
52+
run: |
53+
cd web
54+
pnpm lint
55+
56+
- name: Check TypeScript types
57+
run: |
58+
cd web
59+
pnpm typecheck
60+
61+
- name: Running the frontend tests
62+
run: |
63+
cd web
64+
pnpm test:run
65+
66+
- name: Build frontend
67+
run: |
68+
cd web
69+
pnpm build

0 commit comments

Comments
 (0)