From 5ae3f9a4eb5abe64429b4473c9e977a4dee8536a Mon Sep 17 00:00:00 2001 From: XZH Date: Thu, 22 Oct 2026 13:26:32 -0700 Subject: [PATCH 1/2] docs(storage): document local persistence layout (#612) --- README.md | 2 +- docs-for-user/DATA_STORAGE.md | 75 +++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 docs-for-user/DATA_STORAGE.md diff --git a/README.md b/README.md index 57e6ece07..733828460 100644 --- a/README.md +++ b/README.md @@ -268,7 +268,7 @@ with the access URL and the results of your checks. The [Agent Setup guide](docs-for-user/AGENT_SETUP.md) covers the full flow, including non-interactive CLI configuration. To install it yourself, choose one of the paths below. -DeepTutor ships four installation paths. They all share one runtime-home layout: private settings live in `data/user/settings/` under the directory you launch from (or under `DEEPTUTOR_HOME` / `deeptutor start --home` if you set one explicitly). For the full app, the recommended flow is **pick a runtime-home directory → install → `deeptutor init` → `deeptutor start`**. +DeepTutor ships four installation paths. They all share one runtime-home layout: private settings live in `data/user/settings/` under the directory you launch from (or under `DEEPTUTOR_HOME` / `deeptutor start --home` if you set one explicitly). See [Local Data Persistence](./docs-for-user/DATA_STORAGE.md) for the complete storage layout, database support, and backup notes. For the full app, the recommended flow is **pick a runtime-home directory → install → `deeptutor init` → `deeptutor start`**. ### One-Command Docker Trial diff --git a/docs-for-user/DATA_STORAGE.md b/docs-for-user/DATA_STORAGE.md new file mode 100644 index 000000000..00e42103e --- /dev/null +++ b/docs-for-user/DATA_STORAGE.md @@ -0,0 +1,75 @@ +# Local Data Persistence + +DeepTutor's default installation does not require PostgreSQL, MySQL, or another +database server. Durable state is written below one runtime-home directory, so +a deployment has one tree to mount, inspect, and back up. Some state is stored +in SQLite, while settings, generated artifacts, knowledge-base indexes, caches, +and imported source files remain ordinary files. + +## Where Data Lives + +The runtime home is the directory from which you start DeepTutor. Set +`DEEPTUTOR_HOME` or pass `deeptutor start --home` / `deeptutor init --home` to +choose another directory. In the published container, the same tree is mounted +at `/app/data`. + +The default admin scope uses this layout: + +| Path | Contents | +| --- | --- | +| `data/user/settings/` | JSON/YAML settings and provider credentials | +| `data/user/chat_history.db` | SQLite sessions, messages, turns, notebook, and practice data | +| `data/user/.runtime/` | Private runtime state such as `workspaces.sqlite3` | +| `data/user/workspace/` | Default Content Workspace and generated artifacts | +| `data/user/logs/` | Application logs | +| `data/knowledge_bases/` | Knowledge-base indexes and versioned source data | +| `data/parse_cache/` | Shared document-parse cache | +| `data/users//` | Per-user workspace roots when local multi-user auth is enabled | +| `data/partners//` | Synthetic Partner workspaces | +| `data/system/` | Accounts, grants, audit records, indexes, and owner credentials | + +A selected Content Workspace can be outside `data/user`. In that case its +private learning state is under `/.deeptutor/data/`, while account +settings, credentials, Memory, and workspace registrations remain in the +runtime home. Run `deeptutor workspace show` to print the selected workspace +path. + +## Database Support + +SQLite is the supported local backend. There is no supported PostgreSQL or +MySQL connection setting; setting `DATABASE_URL` or a similar environment +variable does not redirect DeepTutor storage. + +PocketBase is an optional integration configured through +`data/user/settings/integrations.json`. It stores supported session collections +in PocketBase, but it is not a PostgreSQL adapter and does not move all runtime +state into PocketBase. Settings, credentials, knowledge-base indexes, parse +caches, logs, and workspace artifacts remain in the runtime tree. Current +PocketBase mode is single-user; leave `integrations.pocketbase_url` blank for +the supported local multi-user JSON/SQLite layout. + +## Inspecting and Backing Up State + +From your runtime home, after DeepTutor has created data, list the SQLite +databases in the private runtime tree: + +```bash +find data -type f \( -name '*.db' -o -name '*.sqlite3' \) -print +``` + +For a selected external Content Workspace, inspect its private database files: + +```bash +workspace="$(deeptutor workspace show | sed -n 's/^Path: //p')" +if [ -d "$workspace/.deeptutor/data" ]; then + find "$workspace/.deeptutor/data" -type f \ + \( -name '*.db' -o -name '*.sqlite3' \) -print +fi +``` + +Stop DeepTutor and any Partner processes before copying `data` or a workspace. +SQLite may have live write-ahead log files, so copying only `.db` files while +the app runs can lose recent transactions. Back up the complete runtime-home +`data` directory plus each separately configured Content Workspace. Treat every +copy as sensitive because it can contain credentials, private conversation +text, and uploaded learning material. From c60c5aa4c422d32409731a12c03ed49615a20be0 Mon Sep 17 00:00:00 2001 From: "Bingxi Zhao (Frank)" <13051345080@163.com> Date: Tue, 27 Oct 2026 21:49:17 +0800 Subject: [PATCH 2/2] docs: distinguish question bank, favorites, and authored note storage --- docs-for-user/DATA_STORAGE.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs-for-user/DATA_STORAGE.md b/docs-for-user/DATA_STORAGE.md index 00e42103e..e8c19cac6 100644 --- a/docs-for-user/DATA_STORAGE.md +++ b/docs-for-user/DATA_STORAGE.md @@ -18,9 +18,11 @@ The default admin scope uses this layout: | Path | Contents | | --- | --- | | `data/user/settings/` | JSON/YAML settings and provider credentials | -| `data/user/chat_history.db` | SQLite sessions, messages, turns, notebook, and practice data | +| `data/user/chat_history.db` | SQLite sessions, messages, turns, question-bank entries, and practice data | | `data/user/.runtime/` | Private runtime state such as `workspaces.sqlite3` | | `data/user/workspace/` | Default Content Workspace and generated artifacts | +| `data/user/workspace/notebook/` | Favorite collections and their index as JSON files (legacy directory name) | +| `data/user/workspace/co-writer/documents/doc_/manifest.json` | Authored note pages, blocks, revisions, and page metadata | | `data/user/logs/` | Application logs | | `data/knowledge_bases/` | Knowledge-base indexes and versioned source data | | `data/parse_cache/` | Shared document-parse cache | @@ -34,6 +36,14 @@ settings, credentials, Memory, and workspace registrations remain in the runtime home. Run `deeptutor workspace show` to print the selected workspace path. +Favorites and authored notes are separate stores. The legacy `notebook_entries` +SQLite table holds question-bank entries; it is not the storage for authored +note blocks or favorite collections. In a selected external workspace, those +file-based stores live under its private `.deeptutor/data/workspace/` tree, +using the same `notebook/` and `co-writer/documents/` subdirectories. Back up +the full workspace, including hidden `.deeptutor` files, to preserve both the +learning records and the note/favorite content. + ## Database Support SQLite is the supported local backend. There is no supported PostgreSQL or