Introduction¶
In agent development, historical conversations are often scattered across browser sessions or exported files, requiring re-organization and continuation. DeepSeek Harness (DSH) adopts a plugin-based architecture, but its native session import capabilities are limited. This plugin imports DeepSeek web chat history into DSH, saving it as resumable sessions in the workspace, with support for version selection, summary compression, and cost estimation.
Plugin Overview¶
- Plugin name: dsh-deepseek-chat-history-import
- Maintainer: greenballyjq
- Category: Memory
- Description: Import DeepSeek web chat history into DeepSeek Harness as resumable sessions: official ZIP/JSON, split conversations, browser records, JSONL, merge/dedupe, branch selection, summaries and calibrated cost estimates.
Installation & Activation¶
Environment requirements:
- DeepSeek Harness 0.2.x (verified on 0.2.2-rc.1)
- Node.js >= 22.19
WebUI (dsh web) installation:
dsh plugin --profile web add github:greenballyjq/dsh-deepseek-chat-history-import
After installation, restart dsh web, refresh the page, and “Import” will appear in the sidebar.
Official desktop client installation:
Add the following on the “Plugins” page of the desktop application:
github:greenballyjq/dsh-deepseek-chat-history-import
Restart as prompted. The desktop client uses its own desktop profile — do not install with --profile web to avoid placing it in the wrong location.
Core Capabilities¶
1. Supported Export Formats¶
- New official export (v3):
deepseek_data-<date>.zip(containingmanifest.json,chat_session_index.json,chat_sessions/<id>.json, and an attachments directory), as well as individual session files after extraction - Legacy official export:
conversations.json(mapping tree), and the same file after extraction - Official wrappers: bare arrays,
{ conversations: [...] },{ records: [...] },{ data: [...] }, nested arrays - Browser IndexedDB exports: single records, bare records, arrays,
{ records: [...] },{ data: [...] } - JSONL: one object per line, malformed lines are tolerated, different sources can be mixed in the same file
- ZIP: any of the above content packaged together, including subdirectories
- Multi-file mix: JSON / JSONL / ZIP can be selected together
user.json,manifest.json, andchat_session_index.jsoninside official packages are skipped — not read, not imported
2. Format Detection & Filtering¶
The plugin performs strict format validation to prevent misinterpretation:
- New official sessions must have: an
id, amessagesarray,current_message_id, and messages withrole/fragments - Legacy official conversations must have: an
id, amapping, and nodes wheremessage.fragmentscontainREQUEST/RESPONSE/THINK - Browser records must have both:
chat_session.idand achat_messagesarray - Unknown
export_format_versionvalues are explicitly rejected; no structural guessing is attempted - ChatGPT / Claude / Gemini exports are rejected with an explanation to prevent accidental import
- Missing
id, empty files, or corrupted JSON are skipped and counted — never silently swallowed
3. Multi-file Merging & Deduplication¶
The same conversation may appear in multiple files. The plugin merges them according to the following rules:
- Identity is determined solely by conversation id; identical titles do not make two conversations the same
- First, compare by chat content: roles, timestamps, user text, thinking, and reply text; ignore formatting differences, message ids, reference markers, and empty messages
- Identical content: the first read copy is kept — not counted as an update or a conflict; if only titles differ, the newer title (by time/date) is adopted
- Different content: resolved by
updated_at, source priority (official > browser), export date, and message count, in that order - If still indistinguishable, marked as “Indeterminate” and the first copy is kept
- Different ids are all preserved; conversations appearing in only one file are also preserved (union set)
- The panel displays by “conversation count”: conversations found in multiple sources, identical content, newer adopted, indeterminate, skipped, and reasons
- Two identical files are not displayed as duplicates; batch import does not delete already-uploaded files mid-process
4. Version/Branch Selection¶
- Default path: the current message with an export marker takes priority; otherwise, stop at the latest version (the latest-leaf by time)
- After switching versions: follow the path with the most subsequent content from that version forward
- Supports “version with most messages” and “select version per message”; previously selected versions can be “re-selected”
- Messages from two versions are never concatenated; a single complete segment is taken
5. Attachments & Status Handling¶
- Images in new official exports are written into DSH sessions and displayed as images; other files are saved as file attachments
- Attachments are read by their path within the export package; the same attachment is saved only once; missing or oversized files are skipped with a notification
- Legacy official exports do not contain attachment bodies; browser records only have signed URLs — both retain only the file name
- Replies with
INCOMPLETE / TIMEOUT / CONTEXT_LENGTH_EXCEEDEDstatus get an appended note line during import;CONTENT_FILTERuses the fallback text included in the export
6. Import Settings¶
During import, you can choose to keep the most recent N turns, with three options for the remainder:
- Discard: no model call, no memory file generated
- Summarize: calls your configured DeepSeek model to generate a summary, writes it back to the session, and archives it in the workspace under
deepseek-memory/ - Full archive: no model call; earlier turns are written in full to
deepseek-memory/memory.md; optionally save AI thinking separately
Other settings:
- Summary length: Brief / Standard / Detailed (determined by the model configuration tier)
- Summary prompt: only specifies style (Neutral (default) / Narrative / Technical); output structure, language, and word count are controlled by a fixed System prompt — users do not need to write
{{limit}}. When selected, the original text is displayed and can be edited directly; editing automatically switches to “Custom”; can be saved as “My Preset”; custom presets can be deleted, built-in presets cannot - Thinking intensity: selectable as
Off / Low / High / Maxfor each summary import; the initial value comes from the plugin configuration’s “Default Thinking Intensity”, defaulting toOff - Cost cap: if the estimated cost exceeds the cap, the model call is blocked
- Import location, summary model, default values, and default thinking intensity can all be modified in the plugin configuration; the developer configuration allows editing context, pricing, summary, and estimation parameters for each model, but no longer includes thinking intensity
7. Cost Estimation & Calibration¶
- A reference cost is provided before import
- After import, actual cost and usage (miss / cache hit / output) are displayed
- Priced by model version, peak/off-peak periods, input/output tokens, and cache hit/miss
- Learning parameters are stored in a local calibration file; calibration gradually converges toward actual costs
- Records from older workspaces can serve as references for the same plan, avoiding cold-start pricing on repeated imports
- Only summary mode incurs model costs; Discard and Full archive do not call any model
- When summary thinking is not
Off, inference tokens are billed as output, but the current estimate only covers the summary body; the UI explicitly notes “excludes thinking” — actual costs will be higher
8. Writing to DSH Sessions & Memory Files¶
- Each conversation is written into DSH’s native session log; DSH source code is not modified
- Session title prioritizes the original conversation title; duplicate imports are auto-numbered as
Title (2),Title (3), … - Summaries and full archives generate a unified-format memory directory in the workspace:
deepseek-memory/manifest.json: the sole metadata filedeepseek-memory/memory.md: summary segments or full conversation textdeepseek-memory/thinking.md: generated only for full archive mode with “Keep AI Thinking” checked- Large files are automatically split into shards like
memory-0001-0400.md, withmemory.mdserving as the index - Discard mode generates no memory file; keeping everything also generates no memory file
- Attachments are still written to DSH’s attachment storage; memory files only record attachment names, not the attachment bodies
- “Stop Import” is supported: Continue, Keep completed portion and stop, Stop and discard
- Failed summary chunks are automatically retried once; if a later segment fails, summaries already generated for earlier segments are preserved as a partial summary; the result card shows the failed chunk, reason, and retry count; only a first-segment failure causes a complete failure
- A session format self-check is performed before writing; on failure, a short message + details are provided
9. Panel & Progress¶
- Sidebar “Import” page: file selection (multi-select), recent files, conversation search
- Status line displays format (
Official Export v3/Official Export (no version)/Browser Records/Mixed Sources), file count, conversation count, merge statistics, and skip reasons - During parsing, a separate line shows “Parsing” + progress bar + percentage
- Import settings and cost estimation are on the same page
- “Plugin Config” in the top-right corner; opening the panel automatically restores the previously selected file set
- Large batch uploads show
Uploading 123/2019progress
10. Security & Local-First¶
- The plugin itself does not directly access the network; when summary compression is selected, summary requests are sent through DSH’s model service
- Local API and upload endpoints perform
connection.requestRejectionbrowser/origin verification first on supported DSH versions - No account credentials, cookies, or API keys required
- No telemetry, no remote logging
- Only reads locally selected files; only writes to DSH sessions, workspace, DSH attachment storage, and plugin data directory
- Network audit script provided:
npm run audit
Typical Usage¶
- Open “Import” in the sidebar.
- Click “Select Files” and choose official v3 ZIP / legacy ZIP / split JSON / browser export / JSONL; multiple files can be selected.
- Search for and select a conversation in the list.
- Choose version, number of turns to keep, compression method, and cost cap.
- Click “Import”. When done, open the new session in the left workspace, select a model, and continue chatting.
Use Cases & Notes¶
- Suitable for scenarios where you need to import DeepSeek web chat history into DSH for continued development and debugging
- The plugin runs with the current DSH process permissions; review the source code and license before installing
- All processing is done locally; no account credentials, cookies, or API keys required
Closing¶
This plugin organizes web conversations into resumable sessions, with support for multi-source merging, version selection, summary compression, and cost calibration. See the GitHub repository for more details.
References¶
- Plugin catalog page: https://www.skillhub.cn/plugins/greenballyjq/dsh-deepseek-chat-history-import
- GitHub repository: https://github.com/greenballyjq/dsh-deepseek-chat-history-import