s01
系统架构总览
架构层从请求入口到响应出口
Nginx 统一代理 → 三服务分层LangGraph Server 负责 Agent 运行时,Gateway 负责 REST API,Frontend 负责 UI
从请求入口到响应出口
Nginx 统一代理 → 三服务分层LangGraph Server 负责 Agent 运行时,Gateway 负责 REST API,Frontend 负责 UI
DeerFlow 将系统拆为三个独立服务:Next.js Frontend 负责 UI,FastAPI Gateway 负责 REST API 资源管理,LangGraph Server 负责 Agent 运行时。Nginx 统一代理,各层独立部署、独立扩展。这是理解后续所有模块的全局地图。
Nginx 路由规则 — 一个入口,按路径前缀分发到三个服务
upstream gateway { server 127.0.0.1:8000; }
upstream langgraph { server 127.0.0.1:2024; }
upstream frontend { server 127.0.0.1:3000; }
server {
listen 80;
location /api/ { proxy_pass http://gateway; }
location /langgraph/ { proxy_pass http://langgraph; }
location / { proxy_pass http://frontend; }
}Gateway 路由注册 — FastAPI 管理 agents/threads/memory/uploads 等资源
app = FastAPI()
app.include_router(agents_router, prefix="/api")
app.include_router(threads_router, prefix="/api")
app.include_router(memory_router, prefix="/api")
app.include_router(uploads_router, prefix="/api")
app.include_router(skills_router, prefix="/api")
app.include_router(channels_router, prefix="/api")
app.include_router(mcp_router, prefix="/api")