Deer-Flow Dependencies: Complete Guide to Frontend and Backend Requirements
Deer-Flow manages dependencies through a two-tier architecture where the Next.js frontend relies on frontend/package.json and the FastAPI backend declares requirements in backend/pyproject.toml.
Deer-Flow is an open-source agentic workflow platform developed by ByteDance that combines modern web technologies with AI orchestration capabilities. Understanding the complete deer-flow dependencies is essential for developers looking to deploy, extend, or contribute to the project. The codebase is explicitly split into frontend and backend tiers, each with distinct dependency management files that define the runtime requirements.
Understanding Deer-Flow's Two-Tier Architecture
Deer-Flow operates as a full-stack application with clear separation between presentation and orchestration layers. The frontend tier built with Next.js and React handles the user interface, while the backend tier built with FastAPI and LangGraph manages AI agent execution and workflow orchestration. Each tier maintains its own dependency manifest, allowing independent version management and deployment scaling.
Frontend Dependencies in Deer-Flow
The frontend dependencies are declared in frontend/package.json (lines 17‑88) and center around React ecosystem libraries and AI SDKs.
UI Component Libraries
The interface relies on Radix UI primitives for accessible, unstyled components. Key packages include @radix-ui/react-avatar, @radix-ui/react-dialog, and @radix-ui/react-dropdown-menu. These provide the foundation for the design system while allowing custom styling through Tailwind CSS utilities like clsx and tailwind-merge.
AI and State Management SDKs
For AI integration, the frontend imports @langchain/core and @langchain/langgraph-sdk to communicate with the backend orchestration layer. State management uses @tanstack/react-query for server-state synchronization, while the ai package provides streaming utilities for real-time LLM responses.
Code Editor and Utility Dependencies
The application includes a code editing interface powered by @uiw/react-codemirror with language support through @codemirror/lang-python, @codemirror/lang-javascript, and @codemirror/lang-json. Utility libraries include date-fns for date formatting, uuid for identifier generation, and zod for schema validation.
Backend Dependencies in Deer-Flow
The backend dependencies are defined in backend/pyproject.toml (lines 7‑42) and focus on web serving, AI orchestration, and data processing.
Web Framework and Server Components
The core server stack uses fastapi (≥0.115.0) for API routing and uvicorn[standard] as the ASGI server. These handle HTTP requests, WebSocket connections, and background task processing. The python-multipart library supports file upload handling for document ingestion workflows.
AI Orchestration and LangGraph Stack
The backend centers on the LangGraph ecosystem for agent workflow management. Core packages include langgraph (≥1.0.6), langgraph-api (≥0.7.0,<0.8.0), and langgraph-runtime-inmem (≥0.22.1). Model provider integrations come through langchain-openai, langchain-anthropic, langchain-deepseek, and langchain-mcp-adapters for MCP (Model Context Protocol) support.
Data Handling and External Integrations
Data validation uses pydantic (aligned with FastAPI), while duckdb provides embedded analytical database capabilities for local data processing. External service integrations include kubernetes (≥30.0.0) for container orchestration, slack-sdk and python-telegram-bot for messaging platforms, and httpx (≥0.28.0) for async HTTP client operations. The agent-sandbox (≥0.0.19) package provides secure code execution environments for agent tools.
Practical Code Examples
Using Backend Dependencies: FastAPI Endpoint with LangChain
The following example from backend/app/main.py demonstrates how the backend dependencies work together to create an AI-powered endpoint:
from fastapi import FastAPI
from langchain.chat_models import ChatOpenAI # from langchain-openai
from pydantic import BaseModel
app = FastAPI()
class Prompt(BaseModel):
text: str
@app.post("/generate")
async def generate(prompt: Prompt):
# Simple wrapper around OpenAI chat model (provided by langchain-openai)
chat = ChatOpenAI(model="gpt-4o-mini")
response = await chat.ainvoke(prompt.text)
return {"answer": response}
This implementation relies on fastapi, langchain-openai, and pydantic — all declared in the backend TOML configuration.
Importing Frontend Dependencies: React Component with Radix UI
This component demonstrates the use of @radix-ui/react-avatar from the frontend dependency tree:
// frontend/components/AvatarMenu.tsx
import * as Avatar from '@radix-ui/react-avatar';
import { useState } from 'react';
export default function AvatarMenu() {
const [open, setOpen] = useState(false);
return (
<Avatar.Root>
<Avatar.Image src="/user.png" alt="User" />
<Avatar.Fallback delayMs={600}>U</Avatar.Fallback>
{/* additional Radix UI elements can be added here */}
</Avatar.Root>
);
}
The @radix-ui/react-avatar package is declared in frontend/package.json alongside other Radix primitives.
Using AI SDKs from the Frontend: LangChain Core Integration
This hook demonstrates direct usage of @langchain/core in the frontend:
// frontend/hooks/useChat.ts
import { ChatOpenAI } from '@langchain/core/chat_models/openai';
import { useState } from 'react';
export function useChat() {
const [messages, setMessages] = useState<string[]>([]);
const model = new ChatOpenAI({ model: 'gpt-4o-mini' });
async function send(message: string) {
setMessages(prev => [...prev, `User: ${message}`]);
const reply = await model.invoke(message);
setMessages(prev => [...prev, `AI: ${reply}`]);
}
return { messages, send };
}
This relies on @langchain/core — part of the frontend dependency set defined in the package manifest.
Key Configuration Files for Deer-Flow Dependencies
| File | Role | Source Location |
|---|---|---|
frontend/package.json |
Declares all JavaScript/TypeScript runtime libraries for the UI layer | View on GitHub |
backend/pyproject.toml |
Declares all Python runtime libraries for the server/agent layer | View on GitHub |
backend/app/main.py |
Entry point for the FastAPI service that consumes backend deps | Example location |
frontend/components/ |
UI components that import Radix, Codemirror, LangChain SDK, etc. | Example directory |
These files together define the complete set of dependencies required to build, run, and extend Deer-Flow.
Summary
- Deer-Flow dependencies are split between a Next.js frontend and a FastAPI backend, each with isolated manifest files.
- The frontend relies on
frontend/package.json(lines 17‑88) for React, Radix UI, LangChain SDKs, and CodeMirror editor components. - The backend declares requirements in
backend/pyproject.toml(lines 7‑42) covering FastAPI, LangGraph orchestration, model providers (OpenAI, Anthropic, DeepSeek), and infrastructure tools like Kubernetes and DuckDB. - Both tiers use Pydantic for data validation, with the frontend using
@langchain/coredirectly and the backend using the fulllangchainandlanggraphstack. - Agent-sandbox (≥0.0.19) provides secure code execution for backend agent tools.
Frequently Asked Questions
What is the primary frontend framework used in Deer-Flow?
The frontend is built with Next.js running on React and TypeScript. This stack is declared in frontend/package.json alongside state management tools like @tanstack/react-query and UI primitives from @radix-ui/*.
Which AI orchestration libraries does Deer-Flow use?
The backend uses LangGraph (≥1.0.6) and LangChain (≥1.2.3) for agent workflow management. Specific provider integrations include langchain-openai, langchain-anthropic, and langchain-deepseek, all declared in backend/pyproject.toml.
How are Deer-Flow dependencies managed for the backend?
Python dependencies are managed through backend/pyproject.toml (lines 7‑42) using modern Python packaging standards. This file specifies exact version constraints for the FastAPI server, LangGraph runtime, and auxiliary services like uvicorn[standard] and kubernetes.
What database solutions are included in Deer-Flow dependencies?
The backend includes DuckDB for embedded analytical database capabilities and local data processing. This is specified alongside pydantic for data validation in the backend dependency manifest, supporting the platform's data ingestion and processing workflows.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →