Skip to content

PDF ingestion via type: "binary" fails with "Unsupported document type" — contradicts README's own example #102

Description

@akshayWork-19

Bug Description

The README documents that for binary ingestion, name is required for
MIME-type detection:

// Binary (name is required for MIME detection)

And gives this exact example:

await c.add({ type: "binary", bytes: buffer, name: "report.pdf" }, "my-dataset");

However, calling add() with a .pdf filename fails immediately:

Error: runtime error: add failed: task 0 failed after 1 attempt(s):
Unsupported document type at ingest: pdf

Confirmed: detection works as documented, but PDF isn't supported by it

I verified the documented mechanism (filename extension → MIME detection)
works correctly for other types — using the exact same buffer content
(genuine plain text), only changing the name extension:

const buffer = readFileSync("testing.txt");

// Fails — "Unsupported document type at ingest: pdf"
await cognee2.add({ type: "binary", bytes: buffer, name: "news.pdf" }, "dataset-a");

// Succeeds fully — same buffer, only the extension changed
await cognee2.add({ type: "binary", bytes: buffer, name: "testing.txt" }, "dataset-b");

So the documented "name → MIME detection" mechanism is working correctly
in general — the gap is specifically that .pdf isn't supported by it,
despite being the README's own worked example for this exact feature.

Why this matters

Any user following the README's own binary-ingestion example verbatim
(which explicitly uses .pdf) will hit an immediate failure. Either PDF
support is missing from the ingestion pipeline, or the README's example
should use a currently-supported extension instead.

Environment

  • Package: @cognee/cognee-ts@0.1.3
  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions