Refactor DeerFlow to use Gateway's LangGraph-compatible API

- Updated documentation and comments to reflect the transition from LangGraph Server to Gateway.
- Changed default URLs in ChannelManager and tests to point to Gateway.
- Removed references to LangGraph Server in deployment scripts and configurations.
- Updated Nginx configuration to route API traffic to Gateway.
- Adjusted frontend configurations to utilize Gateway's API.
- Removed LangGraph service from Docker Compose files, consolidating services under Gateway.
- Added regression tests to ensure Gateway integration works as expected.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
JeffJiang
2026-04-26 20:38:34 +08:00
parent 653b7ae17a
commit 7bf618de67
20 changed files with 177 additions and 474 deletions
+4 -10
View File
@@ -26,10 +26,6 @@ http {
server gateway:8001;
}
upstream langgraph {
server ${LANGGRAPH_UPSTREAM};
}
upstream frontend {
server frontend:3000;
}
@@ -56,13 +52,11 @@ http {
return 204;
}
# LangGraph API routes
# In standard mode: /api/langgraph/* → langgraph:2024 (rewrite to /*)
# In gateway mode: /api/langgraph/* → gateway:8001 (rewrite to /api/*)
# Controlled by LANGGRAPH_UPSTREAM and LANGGRAPH_REWRITE env vars.
# LangGraph-compatible API routes served by Gateway.
# Rewrites /api/langgraph/* to /api/* before proxying to Gateway.
location /api/langgraph/ {
rewrite ^/api/langgraph/(.*) ${LANGGRAPH_REWRITE}$1 break;
proxy_pass http://langgraph;
rewrite ^/api/langgraph/(.*) /api/$1 break;
proxy_pass http://gateway;
proxy_http_version 1.1;
# Headers
+3 -35
View File
@@ -19,10 +19,6 @@ http {
server 127.0.0.1:8001;
}
upstream langgraph {
server 127.0.0.1:2024;
}
upstream frontend {
server 127.0.0.1:3000;
}
@@ -48,38 +44,10 @@ http {
return 204;
}
# LangGraph API routes (served by langgraph dev)
# Rewrites /api/langgraph/* to /* before proxying to LangGraph server
# LangGraph-compatible API routes served by Gateway.
# Rewrites /api/langgraph/* to /api/* before proxying to Gateway.
location /api/langgraph/ {
rewrite ^/api/langgraph/(.*) /$1 break;
proxy_pass http://langgraph;
proxy_http_version 1.1;
# Headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection '';
# SSE/Streaming support
proxy_buffering off;
proxy_cache off;
proxy_set_header X-Accel-Buffering no;
# Timeouts for long-running requests
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
# Chunked transfer encoding
chunked_transfer_encoding on;
}
# Experimental: Gateway-backed LangGraph-compatible API
# Frontend can opt-in via NEXT_PUBLIC_LANGGRAPH_BASE_URL=/api/langgraph-compat
location /api/langgraph-compat/ {
rewrite ^/api/langgraph-compat/(.*) /api/$1 break;
rewrite ^/api/langgraph/(.*) /api/$1 break;
proxy_pass http://gateway;
proxy_http_version 1.1;