Mintplex-Labs/anything-llm · warning · Error

This document has no readable content that could be found.

Error message

This document has no readable content that could be found.

What it means

Thrown by the summarize agent plugin after fetching a document's content via Document.content(). If the returned document object has no content property or an empty string/array, the plugin cannot summarize anything and throws. This typically means the document was uploaded but its text extraction produced no results.

Source

Thrown at server/utils/agents/aibitat/plugins/summarize.js:133

              const docInfo = availableDocs.find(
                (info) => info.filename === filename
              );
              if (!docInfo) {
                this.super.handlerProps.log(
                  `${this.caller}: No available document by the name "${filename}".`
                );
                return `No available document by the name "${filename}".`;
              }

              const document = await Document.content(docInfo.document_id);
              this.super.introspect(
                `${this.caller}: Grabbing all content for ${
                  filename ?? "a discovered file."
                }`
              );

              if (!document.content || document.content.length === 0) {
                throw new Error(
                  "This document has no readable content that could be found."
                );
              }

              // Report citation for the document being summarized
              this.super.addCitation?.({
                id: docInfo.document_id,
                title: document.title || filename,
                text: document.content,
                chunkSource: null,
                score: null,
              });

              const { TokenManager } = require("../../../helpers/tiktoken");
              if (
                new TokenManager(this.super.model).countFromString(
                  document.content
                ) < Provider.contextLimit(this.super.provider, this.super.model)

View on GitHub (pinned to 526360e320)

Solutions

  1. Open the document in the UI and verify it has extractable text — re-upload or re-process it if the content is empty.
  2. If the file is a scanned image or PDF, enable OCR or convert to a text-based format before uploading.
  3. Check server logs for text-extraction errors during the original upload/import.
  4. If content exists in the vector store but not in the document record, re-run the embedding/processing pipeline for that document.
  5. Provide the agent with a different document that has verified text content.

Example fix

// before
if (!document.content || document.content.length === 0) {
  throw new Error("This document has no readable content that could be found.");
}

// caller/tool fix — return a user-friendly message instead of throwing
if (!document.content || document.content.length === 0) {
  return `The document "${filename}" has no readable text content. It may be a scanned image or unsupported file type. Try re-uploading with OCR enabled.`;
}
Defensive patterns

Strategy: validation

Validate before calling

// Check document content before invoking summarize
const doc = await Document.content(docId);
if (!doc || !doc.content || doc.content.trim().length === 0) {
  return `Document "${filename}" has no readable text. It may need re-processing or OCR.`;
}
// safe to summarize

Type guard

/** @param {{content?: string | string[]}} doc */
function hasReadableContent(doc) {
  if (!doc || !doc.content) return false;
  if (Array.isArray(doc.content)) return doc.content.length > 0;
  return typeof doc.content === "string" && doc.content.trim().length > 0;
}

Try / catch

try {
  const summary = await summarizeDocument(filename);
  return summary;
} catch (e) {
  if (e.message.includes("no readable content")) {
    return `Cannot summarize "${filename}": the document has no extractable text. Try re-uploading with OCR enabled.`;
  }
  throw e;
}

Prevention

When it happens

Trigger: Asking the agent to summarize a document whose text extraction yielded nothing — a scanned PDF with no OCR layer, a corrupt file, an image-only document, or a file type the parser does not support. The document record exists (it was found by filename) but its content field is empty.

Common situations: User uploads a scanned PDF expecting text but no OCR was configured; a .heic or proprietary format that the text extractor silently skipped; a previous extraction job failed mid-way leaving an empty content field; the document was embedded via vector but the raw text was purged.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/5f92814dc6f0781f. Report an issue: GitHub.