AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
94/100
Scores the file, not the repository.Length
1,172 words
9 headings · 3 code blocksRepository
79k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# AGENTS.md23This file provides guidance to AI coding agents (Claude Code, Codex, and others) when working with code in this repository. It is the source of truth; the sibling `CLAUDE.md` imports it via `@AGENTS.md`.45It is the **monorepo orientation layer**: it maps the whole repo and points to the6module guides that own the depth. For anything inside a module, read that module's7guide rather than expecting full detail here:89- **[backend/AGENTS.md](backend/AGENTS.md)** — backend depth: harness/app split, agent &10 middleware chain, sandbox, MCP, skills, memory, IM channels, persistence/migrations,11 config system, test layout.12- **[frontend/AGENTS.md](frontend/AGENTS.md)** — frontend depth: Next.js App Router layout,13 thread/streaming data flow, code style, commands.1415## What is DeerFlow1617DeerFlow is a LangGraph-based AI super-agent system with a full-stack architecture. The18backend runs a "super agent" with sandboxed execution, persistent memory, subagent19delegation, and extensible tools (built-in, MCP, community), all per-thread isolated. The20frontend is a Next.js chat UI. External IM platforms (Feishu, Slack, Telegram, Discord,21DingTalk) bridge into the same agent through the Gateway.2223## Service Topology2425A single `make dev` / Docker stack runs four cooperating services:2627| Service | Port | Role |28| --------------- | ------ | ------------------------------------------------------------------- |29| **Nginx** | `2026` | Unified reverse-proxy entry point — open this in the browser |30| **Gateway API** | `8001` | FastAPI REST API + embedded LangGraph-compatible agent runtime |31| **Frontend** | `3000` | Next.js web interface |32| **Provisioner** | `8002` | Optional — only when sandbox is configured for provisioner/K8s mode |3334Nginx is the single public entry: it serves the frontend and proxies `/api/langgraph/*`35to the Gateway's LangGraph runtime, rewriting it to Gateway's native `/api/*` routes; all36other `/api/*` go straight to the Gateway REST routers. See37[backend/AGENTS.md](backend/AGENTS.md) for the runtime and router detail.38It compresses HTML and configured textual assets, while deliberately leaving SSE,39fonts, images, audio, and video uncompressed at the proxy layer.4041Both compose files publish that entry as `"${BIND_HOST:-127.0.0.1}:${PORT:-2026}:2026"`42— **loopback by default**, matching the README's documented deployment model. A bare43`"${PORT}:2026"` binds `0.0.0.0`, which does not.44Nginx itself listens `default_server` on IPv4+IPv6 and the45Gateway binds `0.0.0.0:8001` inside the container on purpose — both are container-46internal; the published nginx port is the entire external surface, and the Gateway's47`8001` is deliberately not published. Any new published port needs an explicit bind48address; `backend/tests/test_compose_default_bind_host.py` pins this for every service49in both compose files.5051## Repository Map5253```54deer-flow/55├── Makefile # Root orchestration: drives the full stack (dev/start/stop, docker, setup)56├── config.example.yaml # Template → copy to config.yaml (gitignored) at repo root57├── extensions_config.example.json # Template → copy to extensions_config.json (gitignored): MCP servers + skills58├── backend/ # Python backend — see backend/AGENTS.md59│ ├── Makefile # Per-module backend commands (dev, gateway, test, lint, migrate-rev)60│ ├── packages/harness/ # deerflow-harness package (import: deerflow.*) — agent framework61│ └── app/ # FastAPI Gateway + IM channels (import: app.*)62├── frontend/ # Next.js frontend (pnpm) — see frontend/AGENTS.md63├── docker/ # docker-compose files, nginx config, provisioner64├── skills/ # Agent skills: public/ (committed), custom/ (gitignored)65│ # Managed integration skill packs are global at .deer-flow/integrations/skills/{provider}/66│ # Integration credentials and enabled state remain per-user67├── contracts/ # Cross-component JSON contracts (e.g. subagent status, skill review)68├── scripts/ # Root orchestration scripts invoked by the Makefile (check, configure, doctor, support_bundle, serve, nginx, docker, deploy, setup_wizard)69├── tests/ # Root-level tests (currently tests/skills/ — public skill tests)70└── docs/ # Cross-cutting docs, plans, and design notes71```7273Runtime config lives at the **repo root**: copy `config.example.yaml` → `config.yaml`74(main app config) and `extensions_config.example.json` → `extensions_config.json` (MCP75servers + skills). Both real files are gitignored and may be edited at runtime via the76Gateway API. Config schema and resolution order are documented in77[backend/AGENTS.md](backend/AGENTS.md).7879Skill quality review note:80- `skills/public/skill-reviewer/` is the built-in read-only skill quality reviewer.81 It uses the harness-layer `review_skill_package` tool and contracts in82 `contracts/skill_review/`. Model-visible review data is compact and83 tag-neutralized; full raw payloads stay in tool artifacts. See84 [backend/AGENTS.md](backend/AGENTS.md) for the non-activation, SkillScan, and85 `skill-creator` ownership boundaries.8687Scheduled-task note:88- The scheduled-task MVP adds a workspace page at `/workspace/scheduled-tasks` plus a background scheduler service gated by `config.yaml -> scheduler.enabled`.89- Scheduled background runs are intentionally non-interactive: they execute through the normal run lifecycle, but the lead-agent toolset excludes `ask_clarification` when `context.non_interactive=true`. The key is honored only for internally-authenticated callers (the scheduler launch path); client-supplied `context.non_interactive` is dropped.9091## Commands: Root vs. Module9293**Root `make` targets drive the whole stack** (run from the repo root):9495```bash96make setup # Interactive setup wizard (recommended for new users)97make doctor # Check configuration and system requirements98make support-bundle # Generate redacted troubleshooting summary, AI issue draft, and optional zip99make config # Generate local config files from the examples100make check # Check that required tools are installed101make install # Install all dependencies (frontend + backend + pre-commit hooks)102make dev # Start all services with hot-reload (Gateway + Frontend + Nginx)103make start # Start all services in production mode (local, optimized)104make stop # Stop all running services105make up / down # Build/stop the production Docker stack (browser at localhost:2026)106make docker-start / docker-stop / docker-logs # Docker development environment107```108109Run `make help` for the full list.110111**Per-module commands drive a single module** (run inside that module):112113```bash114# Backend (see backend/AGENTS.md for the full set)115cd backend && make dev # Gateway API with reload (port 8001)116cd backend && make test # Backend test suite117cd backend && make lint # ruff check118cd backend && make format # ruff format119120# Frontend (see frontend/AGENTS.md for the full set)121cd frontend && pnpm dev # Dev server with Turbopack (port 3000)122cd frontend && pnpm check # Lint + type check (run before committing)123cd frontend && pnpm test # Unit tests124```125126Rule of thumb: **root `make` = the full application**; **`backend/Makefile` and `frontend/`127(`pnpm`) = per-module work.**128129Host-side pnpm consumers, including the root/frontend Makefiles and local diagnostic scripts, must run through `scripts/pnpm.py`. The runner preserves direct `pnpm`/`pnpm.cmd` priority, falls back to `corepack pnpm`, and is invoked from `frontend/` so Corepack honors the package-manager version pinned by that project.130131## Where to Go Next132133- Backend work → **[backend/AGENTS.md](backend/AGENTS.md)**134- Frontend work → **[frontend/AGENTS.md](frontend/AGENTS.md)**135- Setup & install → **[Install.md](Install.md)**, **[CONTRIBUTING.md](CONTRIBUTING.md)**136- Project overview & usage → **[README.md](README.md)** (translations: `README_zh.md`,137 `README_ja.md`, `README_fr.md`, `README_ru.md`)138- Security policy → **[SECURITY.md](SECURITY.md)**139- Changes → **[CHANGELOG.md](CHANGELOG.md)**140- Cutting a release → **[RELEASING.md](RELEASING.md)**141142## Cross-Cutting Conventions143144These apply repo-wide; module guides own the module-specific detail.145146- **Documentation update policy** — keep docs in sync with code: update `README.md` for147 user-facing changes and the relevant `AGENTS.md` for development/architecture changes in148 the same change set.149- **Test-driven development** — features and bug fixes ship with tests. Backend tests live150 in `backend/tests/` (TDD is mandatory there; see [backend/AGENTS.md](backend/AGENTS.md));151 frontend tests live in `frontend/tests/`.152- **Format before pushing** — run `make format` (backend) / `pnpm check` (frontend). Backend153 CI enforces `ruff format --check`, so formatting must be clean before a push.154
Also in bytedance/deer-flow
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bytedance/deer-flow.github/copilot-instructions.md · 79k | Copilot instructions | setupbuildtestlint-format+6 | 89/100 | 3 days ago | |
| bytedance/deer-flowbackend/AGENTS.md · 79k | AGENTS.md | testlint-formatstylearch+12 | 84/100 | 2 days ago | |
| bytedance/deer-flowfrontend/AGENTS.md · 79k | AGENTS.md | setuptestlint-formatstyle+4 | 69/100 | 2 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| OnlyTerp/prompt-cache-skillsAGENTS.md · 112 | AGENTS.md | setupbuildtestlint-format+5 | 100/100 | 3 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| vllm-project/vllmAGENTS.md · 88k | AGENTS.md | setuptestlint-formatstyle+5 | 100/100 | 3 days ago |
