Skip to main content

Manage documents

Inspect, tag, update, and remove documents that are already in a collection.

List documents#

Enumerate documents in a collection.

Returns every document in the collection with its status, tags, and metadata. For filename-based search across a collection use `searchDocuments`; for tag and metadata filters at retrieval time use the retrieval recipes.

dewey docs list my-docs

# doc_a1  report.pdf     ready    482 KB  q3-2026,finance
# doc_a2  contract.docx  ready    91 KB   legal
# doc_a3  earnings.pptx  processing 1.2 MB q3-2026

See also

Get a document's markdown#

Fetch Dewey's cleaned markdown rendering of a processed document.

Every document that reaches `ready` produces a normalized markdown rendering — headings, lists, tables, captioned images. Use it as the source of truth for downstream RAG, summarization, or display. The same content is what powers section browsing and retrieval.

dewey docs markdown doc_a1b2c3 > report.md

See also

Browse sections and chunks#

Walk a document's heading hierarchy and its chunked content.

Sections preserve the heading structure of the source document. Each section contains an ordered list of chunks (the unit Dewey embeds and retrieves). Use this when you're building a navigator UI or want to feed a single section to an LLM rather than a whole document.

dewey docs sections doc_a1b2c3
# §1 Executive summary       (level 1, 3 chunks)
# §2 Revenue                  (level 1, 8 chunks)
#   §2.1 By segment           (level 2, 5 chunks)
#   §2.2 By region            (level 2, 3 chunks)

dewey docs chunks sec_b4f9

See also

Update tags & metadata#

Set tags and arbitrary metadata on a single document.

Tags are short strings used for retrieval scoping; metadata is a free-form JSON object useful for any per-document state (uploader, source URL, expiry, etc.). By default metadata merges with the existing object; pass `replaceMetadata: true` to overwrite.

# Tags can be applied at upload time too
dewey upload ./report.pdf -c my-docs --tag q3-2026 --tag finance --metadata source=quarterly-packet

See also

Bulk update tags & metadata#

Apply tag and metadata changes to many documents at once.

One round-trip for up to several hundred documents. Each entry carries its own `id`, `tags`, and `metadata`. The same merge-vs-replace semantics from the single-document update apply per entry.

await client.documents.bulkUpdate('COLLECTION_ID', [
  { id: 'doc_a1', tags: ['q3-2026', 'finance'] },
  { id: 'doc_a2', tags: ['q3-2026', 'legal'], metadata: { sensitive: true } },
  { id: 'doc_a3', metadata: { archived: true }, replaceMetadata: true },
])

See also

Delete a document#

Remove a document and its derived sections and chunks.

Hard delete. The document's markdown, sections, chunks, and embeddings are removed. Any claims or contradiction history tied to the document are also pruned.

dewey docs delete doc_a1b2c3