# DeepSeek conversations.json 匯出格式欄位說明

> **TL;DR** — 在 DeepSeek「設定 → 資料管理 → 匯出所有歷史對話」會得到 deepseek_data-*.zip。舊版匯出裡只有一個 conversations.json：最外層是對話陣列，每個對話有 id、title、inserted_at、updated_at，以及用樹狀結構存放訊息的 mapping 物件（root → parent／children）。每則訊息依序帶有 fragments，類型包括 REQUEST（你的提問）、RESPONSE（回答）和 THINK（深度思考過程）。新版匯出則把同樣的資料拆成 chat_sessions/<id>.json。

最後審閱: 2026-12-06 · Canonical: https://ballpure.com/ai-models/zh-tw/deepseek-conversations-json-spec

## 匯出 ZIP 裡有什麼

壓縮檔名為 deepseek_data-<日期>.zip，目前流通兩種結構：舊版只有一個 conversations.json，裝著全部對話；新版（export_format_version 3）包含 manifest.json、chat_session_index.json，以及 chat_sessions/ 資料夾內每個對話一個 JSON 檔，另附圖片附件。匯入工具應兩種都能辨識。

## conversations.json 欄位字典

| 欄位 | 型別 | 說明 |
| --- | --- | --- |
| `[ ]` | `array` | 最外層是陣列，每個元素是一個對話。 |
| `id` | `string (UUID)` | 對話 ID（UUID），每次匯出都不變，合併時用它去重。 |
| `title` | `string \| null` | 側邊欄顯示的對話標題，可能為空。 |
| `inserted_at / updated_at` | `string (ISO-8601)` | 建立與最後更新時間，ISO-8601 格式，含微秒與時區偏移（例如 +08:00）。 |
| `mapping` | `object` | 訊息樹：以節點 ID 為鍵的物件。 |
| `mapping.root` | `node` | 虛擬根節點：parent 與 message 皆為 null，它的 children 是第一輪提問。 |
| `mapping[*].parent` | `string \| null` | 父節點 ID。 |
| `mapping[*].children` | `string[]` | 子節點 ID 清單。超過一個子節點代表回答被重新生成或提問被編輯過（分支）。 |
| `mapping[*].message` | `object \| null` | 訊息內容；根節點為 null。 |
| `message.model` | `string` | 產生該輪的模型，例如 deepseek-chat 或 deepseek-reasoner。 |
| `message.fragments` | `object[]` | 訊息的有序片段（類型見下表）。 |

### 片段類型

| 欄位 | 說明 |
| --- | --- |
| `REQUEST` | 使用者提問文字（content）。 |
| `RESPONSE` | 模型可見的回答（content）。 |
| `THINK` | 深度思考（R1）的推理文字；回傳給模型的上下文中不要放入。 |
| `SEARCH / FILE` | 搜尋結果、檔案附件等；只重建純文字時可略過。 |

## 最小範例

```json
[
  {
    "id": "6f1c1b7e-2b1d-4c1e-9f3a-0d5e8b7a1c42",
    "title": "Autumn poem",
    "inserted_at": "2025-02-10T10:04:41.343000+08:00",
    "updated_at": "2025-02-10T10:09:12.120000+08:00",
    "mapping": {
      "root": { "id": "root", "parent": null, "children": ["1"], "message": null },
      "1": {
        "id": "1", "parent": "root", "children": ["2"],
        "message": {
          "model": "deepseek-reasoner",
          "inserted_at": "2025-02-10T10:04:41.343000+08:00",
          "fragments": [{ "type": "REQUEST", "content": "Write a short poem about autumn" }]
        }
      },
      "2": {
        "id": "2", "parent": "1", "children": ["3", "5"],
        "message": {
          "model": "deepseek-reasoner",
          "inserted_at": "2025-02-10T10:04:50.000000+08:00",
          "fragments": [
            { "type": "THINK", "content": "The user wants a short seasonal poem." },
            { "type": "RESPONSE", "content": "Amber leaves drift down, the geese fly south." }
          ]
        }
      }
    }
  }
]
```

## 如何還原畫面上看到的對話

1. 從 mapping.root 沿 children 往下走；message 為 null 的節點直接跳過，並把它的子節點往上提。
2. 某節點有多個子節點時代表對話分岔。選擇結尾葉節點更新時間最晚的那條分支（也就是使用者最後看到的內容）；若要完整封存，則保留所有分支。
3. 依序串接 REQUEST 與 RESPONSE 片段；THINK 另外存放。

## JSON Schema（舊版格式）

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "DeepSeek conversations.json (legacy export)",
  "type": "array",
  "items": {
    "type": "object",
    "required": ["id", "mapping"],
    "properties": {
      "id": { "type": "string", "format": "uuid" },
      "title": { "type": ["string", "null"] },
      "inserted_at": { "type": "string", "format": "date-time" },
      "updated_at": { "type": "string", "format": "date-time" },
      "mapping": {
        "type": "object",
        "additionalProperties": {
          "type": "object",
          "required": ["id", "children"],
          "properties": {
            "id": { "type": "string" },
            "parent": { "type": ["string", "null"] },
            "children": { "type": "array", "items": { "type": "string" } },
            "message": {
              "type": ["object", "null"],
              "properties": {
                "model": { "type": "string" },
                "inserted_at": { "type": "string", "format": "date-time" },
                "fragments": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": ["type"],
                    "properties": {
                      "type": { "enum": ["REQUEST", "RESPONSE", "THINK", "SEARCH", "FILE"] },
                      "content": { "type": "string" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```

## 新版匯出格式（export_format_version 3）

新版沿用相同概念，但把樹攤平：每則訊息有整數 id 與 parent_id，每個對話記錄 current_message_id，也就是使用者當時停留的訊息，這是還原分支唯一可靠的依據。所有時間皆為 UTC，以 Z 結尾。

| 欄位 | 說明 |
| --- | --- |
| `manifest.json` | ZIP 的第一個項目：{"export_format_version": 3}。 |
| `chat_session_index.json` | 已匯出對話清單（id、title、pinned、message_count、inserted_at、updated_at）。 |
| `chat_sessions/<id>.json` | 單一對話：id、title、pinned、current_message_id、inserted_at、updated_at、messages[]。 |
| `messages[]` | 每則訊息：id、parent_id（第一則為 null）、role（USER／ASSISTANT）、status、thinking_enabled、search_enabled、accumulated_token_usage、inserted_at、fragments[]。 |
| `fragments[].type` | 額外片段類型：TEMPLATE_RESPONSE（伺服器提示，不是真正的回答）、TIP、CONTENT_RISK、PARTIAL_FILE_READ、TOOL_SEARCH。 |

## 大檔案與常見錯誤

### 在瀏覽器載入匯出檔出現 QuotaExceededError

localStorage 每個網站只有約 5 MB，而對話多或含圖片的匯出檔常達數十到數百 MB，把解析後的 JSON 存進 localStorage 就會丟出 QuotaExceededError。正確做法是檔案留在記憶體中，逐一讀取 ZIP 項目，再把每個對話寫入 IndexedDB。

### 分享連結不等於匯出檔

DeepSeek 的分享連結打開的是單一對話的唯讀網頁，不是 conversations.json 資料，也沒有可匯入的訊息樹。包括續聊在內的匯入工具都需要官方匯出的 ZIP。

### 無損串流、分片與增量合併

一次解析一個對話，而不是整個陣列；超大檔案按對話 id 分片；合併時以 id 為準：本機已存在的對話直接略過而不覆蓋，這樣每週重新匯入最新檔案也不會遺失任何內容。

## 開源與線上相容實作

| 專案 | 可匯入 | 需自備 API Key | 說明 |
| --- | --- | --- | --- |
| [deepseek-ai/chat-demo](https://github.com/deepseek-ai/chat-demo) | 新版匯出 ZIP | 需要 | DeepSeek 官方 MIT 授權參考網頁介面；匯入會取代其中既有的全部對話。 |
| [續聊（seequel） (mydeepseek.app)](https://mydeepseek.app/zh-tw) | 新版與舊版 ZIP、conversations.json | 不需要 | 以 MIT 授權的 chat-demo 為基礎、串接 DeepSeek 官方 API 的網頁工作台：ZIP 在瀏覽器本機解析、不上傳；匯入採合併、不覆蓋舊對話；可在舊對話裡直接接著聊。日常輕度使用可免費體驗，重度使用可按需升級方案。 |

## 相關資源

- [續聊：匯入 DeepSeek 匯出檔接著聊](https://mydeepseek.app/zh-tw)
- [conversations.json 怎麼開啟與轉成文字](https://mydeepseek.app/zh-tw/tools/json-viewer)
- [DeepSeek 聊天紀錄匯出教學](https://mydeepseek.app/zh-tw/guide/export-deepseek-history)
- [DeepSeek API 與網頁版：聊天要花多少錢](https://mydeepseek.app/zh-tw/tools/api-cost-calculator)
- [DeepSeek 單次 4 萬字上限說明](https://mydeepseek.app/zh-tw/tools/token-calculator)
- [續聊機器可讀摘要（llms.txt）](https://mydeepseek.app/llms.txt)

## FAQ

### DeepSeek 匯出檔裡的 conversations.json 在哪裡？

在「設定 → 資料管理 → 匯出所有歷史對話」產生的 deepseek_data-<日期>.zip 裡。舊版匯出只有一個 conversations.json；新版改用 chat_sessions/<id>.json，資訊相同。

### REQUEST、RESPONSE、THINK 片段分別是什麼？

REQUEST 是使用者輸入的內容，RESPONSE 是可見的回答，THINK 是深度思考（R1）的推理過程。用 REQUEST 與 RESPONSE 重建可讀對話，THINK 另外保存。

### 為什麼大型匯出檔會讓瀏覽器出現 QuotaExceededError？

localStorage 每個網站約只有 5 MB。大型匯出檔必須在記憶體中解析，並逐一對話存入 IndexedDB。

_獨立技術參考，與 DeepSeek 無隸屬關係。欄位清單依實際匯出檔核對；DeepSeek 可能隨時調整格式。_
