Contextual AI icon

Contextual AI

Access Contextual AI tools for agents, parsing, querying, and reranking.

Overview

The node "Contextual AI" provides access to various AI-powered tools, including document parsing capabilities. Specifically, for the Parser resource and Parse Document operation, it processes binary input documents (such as PDFs or other file formats) and extracts structured content from them. This can include text extraction, figure captions, document hierarchy, and output formatting.

Typical use cases include:

  • Extracting readable text and structure from scanned or digital documents.
  • Converting documents into markdown or other textual formats for further processing.
  • Analyzing document contents programmatically in workflows, such as summarization, indexing, or data extraction.

For example, a user might upload a PDF report and want to extract its text with hierarchical headings preserved, or convert each page into markdown for easy display on a website.

Properties

Name Meaning
Input Binary Field(s) The name(s) of the binary field(s) on the input item that contain the document data to parse.
Parse Mode The parsing mode to use. Currently supports only "Standard".
Figure Caption Mode How figure captions are extracted: either "Concise" or "Detailed".
Enable Document Hierarchy Whether to preserve and output the document's hierarchical structure (e.g., headings).
Page Range Specifies which pages to parse, e.g., "0-5" to parse pages 0 through 5.
Output Types Comma-separated list of output types/formats, e.g., "markdown-per-page".
Authentication Method of authentication to use; currently supports an API key credential.

Output

The node outputs JSON data representing the parsed document content. The structure depends on the options selected but generally includes:

  • Text content extracted from the document.
  • Document hierarchy if enabled, such as sections and subsections.
  • Figure captions formatted according to the chosen mode.
  • Content segmented by page if requested (e.g., markdown per page).

If the input contains binary data (the original document), the node processes it but does not output binary data itself; instead, it outputs the parsed textual representation.

Dependencies

  • Requires an active API key credential for the external Contextual AI service.
  • The node relies on the Contextual AI platform’s parsing API to perform document analysis.
  • No additional environment variables are indicated beyond the API key configuration.

Troubleshooting

  • Common issues:
    • Incorrect binary field name: Ensure the input item contains the specified binary property with valid document data.
    • Invalid page range format: Use a proper range string like "0-5"; invalid formats may cause errors or no output.
    • Missing or invalid API key: The node will fail to authenticate with the external service.
  • Error messages:
    • Authentication failures typically indicate missing or incorrect API credentials.
    • Parsing errors may occur if the document format is unsupported or corrupted.
  • Resolutions:
    • Verify the binary input field names and ensure the input items have the expected binary data.
    • Check and correct the page range syntax.
    • Confirm the API key is correctly configured and has necessary permissions.

Links and References

Discussion