From c53295dfeefccd0e8bdd100a7d4ef683278d9d25 Mon Sep 17 00:00:00 2001
From: 1445043649 <>
Date: Mon, 11 May 2026 09:20:26 +0800
Subject: [PATCH] docs(readme): add Database backend section in Quick Start
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Quick Start 加 Step 3 "Database backend (Stage 0+ defaults to Postgres)":
- 说明 config.example.yaml 默认 postgres + DATABASE_URL 写 .env
- 给本地 dev 起 docker compose postgres 一行命令
- 提示 make doctor / make dev preflight 行为
- 折叠 SQLite fallback 说明(offline dev 用)
Stage 0 PR2 T2.9(README 部分;backend/CLAUDE.md follow-up)。
Co-Authored-By: Claude Opus 4.7 (1M context)
---
README.md | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/README.md b/README.md
index 0fc8f173..833f0845 100644
--- a/README.md
+++ b/README.md
@@ -202,6 +202,38 @@ That prompt is intended for coding agents. It tells the agent to clone the repo
+3. **Database backend (Stage 0+ defaults to Postgres)**
+
+ `config.example.yaml` ships with `database.backend: postgres` and `postgres_url: $DATABASE_URL`. Set `DATABASE_URL` in `.env`:
+
+ ```bash
+ DATABASE_URL=postgresql+asyncpg://deerflow:deerflow_dev@localhost:5432/deerflow
+ ```
+
+ Start the local Postgres dev container:
+
+ ```bash
+ docker compose -f docker/docker-compose-dev.yaml up -d postgres
+ ```
+
+ Or point `DATABASE_URL` at a remote RDS / Cloud SQL instance.
+
+ `make doctor` will report the configured backend, attempt an asyncpg connection, and surface actionable fix hints. `make dev` preflights Postgres reachability before starting services and aborts if `DATABASE_URL` is unreachable.
+
+
+ Offline dev (SQLite fallback)
+
+ If you prefer no Postgres, edit `config.yaml`:
+
+ ```yaml
+ database:
+ backend: sqlite
+ sqlite_dir: .deer-flow/data
+ ```
+
+ SQLite is preserved as a valid backend for offline development. RLS / multi-node features (Stage 2+) require Postgres.
+
+
### Running the Application
#### Deployment Sizing