description: "Import DeepSeek website chat exports: upload a deepseek_data ZIP from the browser and store its recent conversations as Sessions in a chosen Workspace."
kind: "package-bundle"
@deepseek-ai/dsh-deepseek-chat-import
English | 中文
Summary
Bring the chats exported from the DeepSeek website (chat.deepseek.com) into DSH and continue them. After you enable this optional bundle, a button right of "New session" uploads the deepseek_data-*.zip file to the Host, which stores the most recent conversations as Sessions in the Workspace you choose. Imported Sessions keep their original titles and times and show the original questions with their attached files, reasoning, web search cards, read links, and answers. The Agent Note records the design and its trade-offs.
Table of Contents
Use this package
In the GUI, open the Plugins page, click "More" to open "Experimental plugins", and switch on "DeepSeek chat import". The installation ships the bundle switched off; the plugin manager page owns how More bundles are listed and enabled. Switching it off removes the button and the upload route; imported Sessions stay.
The bundle inserts one Host row, which an explicit composition can also mount:
- id: deepseek-chat-import
name: '@deepseek-ai/dsh-deepseek-chat-import'
The Host half injects typert, connection, sessionPersistence, and workspaceRegistry, and reads sessionProjectionCache and attachments when they are mounted. The browser half injects remote, slots, locale, and sessions, and wraps the ui-sidebar New Session row through its sidebar.session.action HOC slot: it returns the row content followed by its own button, or the content alone for a Peer that may not import. Only the owner imports: the upload route admits only owner Peers, limits() refuses every other principal, and the button shows only for a Peer that may call deepseekChatImport/limits.
Import a chat export
- On the DeepSeek website, export all chats and download the
deepseek_data-*.zip file.
- Click the upload-arrow button right of "New session".
- Under "Export file", choose the ZIP file. Under "Workspace", keep the preselected Workspace of the current Session, pick another one, or choose "Add workspace…" to add a directory.
- Click "Import". On a served page the progress bar shows the upload percentage; a page that carries the archive over its own transport has no byte progress, so the bar starts with the Host reading the archive. Both then show "Importing n/K" while Sessions are written; closing the dialog cancels the request.
- The dialog reports how many Sessions it imported into which Workspace, how many older conversations exceeded the limit, and how many conversations it could not import. However the attempt ends, the Session list refreshes, so Sessions written before a failure or cancellation appear.
Configuration
| Field | Default | Meaning |
|---|
maxSessions | 1000 | Most Sessions one import writes, choosing the conversations the export index lists as most recently updated. |
maxUploadBytes | 536870912 (512 MiB) | Largest export archive one upload may carry; the whole archive is held in memory while it is imported. |
maxEntryBytes | 268435456 (256 MiB) | Largest declared uncompressed size of one archive entry; a larger entry is never decompressed. |
maxTitleBytes | 80 | Largest UTF-8 size of an imported title; keep it equal to the session-title maxTitleBytes of the composition. |
Import results
- Each website conversation becomes one Session. The imported chain ends at the message named by
current_message_id; when that field is absent, null, or names no message, it ends at the message with the largest id. Other branches are dropped.
chat_session_index.json selects the conversations: the newest maxSessions by its updated_at (ties by inserted_at, then id) are imported in archive order, one at a time. When one of them fails, the next older conversation the index lists takes its place.
- Titles keep the original title with whitespace collapsed and truncated to
maxTitleBytes, pinned as a user title, so no title generation runs. A title that is empty after normalization writes no title. Event times follow the export and never decrease; the elapsed_secs of reasoning advances the time of the following steps.
- A user message without text, a stored image, or a file keeps one empty text block: the row renders, and DeepSeek request serialization drops it like any other empty user message, so that turn's question is absent from the model context (a first turn without text therefore starts the request with the assistant message).
- Images in user messages become image attachments when the export contains the file (png, jpg, jpeg, webp, or gif) and the attachment service stores it. Other images and every non-image file become a synthetic file card that shows a file-type icon, the name, and the exported size; the card cannot be opened, holds no bytes, and reaches the model as a file handle whose named path holds no bytes. The Host log records why each image was not stored.
- Web searches become
web_search calls and opened pages become web_fetch calls, shown as the standard search and fetch cards. A search the export records as failed becomes an error result. A search still in progress, an opened page without an address, and an image search are left out, as the website leaves them out of the reply.
- A
READ_LINK record becomes one Markdown link line per linked page, [title](url), with the URL as its own text when the title is missing and the title alone when the URL is missing. A PARTIAL_FILE_READ, TOOL_FIND, TIP, or CONTENT_RISK record is left out, as the website shows none of them as reply text.
- A question whose reply was withdrawn by content filtering (
CONTENT_FILTER) is left out together with the reply: neither appears, and the model never sees them. A conversation with no other turn is not imported.
- Other replies whose status is not
FINISHED, template replies, and replies without importable content stay out of the model context; their turn ends with an error row that shows the reason and a fixed code. The question stays.
Failures
Failures detected before the streaming pass write nothing. Each conversation is fully converted and seed-validated with Session.create before it is written; a conversation that fails is skipped and does not stop the others. An archive whose structure breaks during the pass fails as unreadable-archive after the Sessions delivered before the break were written, and the response does not list them. The dialog shows the localized explanation of each reason; a too-large failure reported by the Host instead shows the Host's own message, which names the limit it applied.
| Reason | When |
|---|
too-large | The file exceeds maxUploadBytes, or an entry declares or stores more than maxEntryBytes (including manifest.json and chat_session_index.json); the browser checks the file size first, the Host stops reading at maxUploadBytes, and an entry over maxEntryBytes is never decompressed. |
unreadable-archive | The file is not a readable ZIP archive, manifest.json is damaged, a stored entry declares a size other than the bytes it holds, or two central-directory entries share a name. |
missing-manifest | The archive has no manifest.json. |
missing-index | The archive has no readable chat_session_index.json. |
unsupported-version | manifest.json does not declare export_format_version 3. |
no-conversations | chat_session_index.json lists no conversation. |
workspace-not-found | The chosen Workspace no longer exists. During an import, the import stops and keeps the Sessions already written. |
busy | Another import is running on this Host. |
A conversation file that is oversized, damaged, cannot be parsed or converted, or whose Session cannot be stored, is skipped and counted in the result; the Host log names the defect. An image the archive cannot deliver becomes a file card and is named in the Host log. Cancelling keeps the Sessions already written.
Understand the implementation
Implementation internals — click to expand
Modules
| File | Responsibility |
|---|
src/protocol.ts | The upload path /api/deepseek-chat-import/archive and its document-relative form |
src/upload.ts | createUploadRoute(): request validation, bounded in-memory buffering, the streamed NDJSON answer, and cancellation |
src/archive.ts | openExportArchive(): the ZIP central directory, streaming passes that inflate only the entries they are asked for within maxEntryBytes, and a by-name read |
src/format.ts | zod validation of manifest.json, conversation files, and the fragment types this package maps |
src/conversation.ts | Pure selectBranch() and convertConversation(): message tree to seed events |
src/importer.ts | importDeepseekChatExport(): index selection, the image pass, the conversation pass, writes, and Workspace attachment |
src/index.ts | DeepseekChatImportService, its Config, the single import slot, the route registration, and @Remote limits() |
|
Further Exploration
Model Experience
Imported history
What the model sees
The import sends no model request. When the user continues an imported Session, the model sees the imported questions, reasoning, web_search / web_fetch calls and results, answers, Markdown link lines of read-link records, and the file handles of synthetic cards, whose bytes do not exist; content-filtered rounds, excluded replies, template text, tips, page finds, partial-read notices, and CONTENT_RISK disclaimers are absent. A synthetic file card enters the context as the file handle that names the file and its size and points at a path that holds nothing; a question without any content sends no message. A fetch result holds only the page title, URL, and a note that the page body is not in the export.
Token effect
The first request after resume sends the whole imported history. Imported reasoning is sent as unsigned thinking and increases that request's input tokens; imported images are sent on image-capable routes and replaced by the general omission note elsewhere.
KV Cache effect
The first request after resume has no reusable cached prefix; later requests extend it like any other Session.
Known Limitations and Deferred Work
- Archive held in memory — the whole upload stays in Host memory during the import, bounded by
maxUploadBytes, plus one converted conversation, one image entry at a time, and the references of the images stored so far; one Host runs one import at a time. Conversations and images the index does not select are never inflated.
- Synchronous inflation — the streaming pass inflates each selected entry synchronously with fflate's
UnzipInflate. An entry that declares a small originalSize but carries highly compressed data keeps inflating until the entry ends, and maxEntryBytes only stops those bytes being kept. A crafted archive can occupy the Host for a long time before the entry is rejected.
- Duplicate local file headers — duplicate detection covers the central directory only. A second local file header renamed to an existing entry name is not detected, so an archive can deliver more conversations than the index lists, and the write count is not additionally guarded.
- Partial writes on a corrupted archive — an archive whose structure breaks after some entries were delivered fails as
unreadable-archive after those Sessions were written, and the failure response does not list them.
read() truncates — ExportArchive.read returns at most the size an entry declares, truncating one that inflates to more, while stream reports that condition as a size failure. The manifest, the index, and a replacement conversation are read by name, so one of them can arrive truncated. Each by-name read also re-parses the whole central directory: the manifest and the index pay it once each, and a replacement conversation pays once more.
- No upload percentage on the carrier path — a page that carries the archive through
__DSH_TRANSPORT__.fetch reports no byte progress; the dialog shows only the reading and importing phases.
- One export structure — the importer targets the 2026-11-12 structure:
current_message_id, stage_id, the tool statuses, the link and find fields, and the new record types. The fields that structure added are read as optional, so an older v3 archive still imports, but it is not a supported target.
- ZIP upload only — an extracted export directory or a Host path cannot be imported.
- Re-import duplicates — importing the same export again writes new Sessions; the import does not track which conversations it already imported.
- Synthetic file cards — images the export lacks, of an unsupported type, over
maxEntryBytes, or rejected by the attachment service (for example over its size limit), and every non-image file, become cards without bytes: they show the name and the exported size, cannot be opened, and name no stored object, so a model that reads the named path finds nothing. Non-image file bodies are not in the export.
Dev Note
Working context for maintainers — click to expand
tests/conversation.host.spec.ts covers the mapping rules, tests/archive.host.spec.ts the archive view, tests/upload.host.spec.ts the route, tests/importer.host.spec.ts the orchestration with synthesized ZIPs, tests/resume.host.spec.ts continuing through the production agent loop, tests/composition.host.spec.ts the Loader composition, and tests/*.client.spec.* the button, dialog, upload, and mounting. The keyless Web snapshot snapshots/web/deepseek-chat-import/ (driver apps/web/tests/deepseek-chat-import.e2e.ts) imports a synthetic export through the route and continues one imported Session with one recorded model turn. When the fragment mapping changes, update the Agent Note's mapping tables in the same change.