Retrieve Full Document Content in Chunks

Retrieve full document content split into chat-optimized chunks. This endpoint provides access to complete document content split into manageable chunks suitable for chat interfaces. Unlike semantic chunk retrieval, this returns complete documents divided sequentially. Key Features: * Chat-Optimized Chunking: Documents split into conversational pieces * Node Type Filtering: Include or exclude images, tables, and other node types * Token-Aware Splitting: Respects token limits for chat context management * Sequential Chunks: Maintains document order and narrative flow * Filtered Retrieval: Select specific documents using metadata filters * Token Limiting: Optional max_tokens parameter to control response size Content Filtering: * Use include to retrieve only specific node types * Use exclude to omit unwanted content types * Supports TextNode, ImageNode, TableNode, and other node types * Filtering is applied before chunking Chunking Process: 1. Retrieve filtered documents based on context criteria 2. Apply node type filters (include/exclude) 3. Split documents into chat-appropriate segments respecting max_tokens 4. Return structured chunks with metadata and citations Notes: * Chunks maintain document structure and logical flow * Token limiting prevents context window overflow * Node type filtering reduces payload size and improves relevance * Use `/artifacts/search` endpoint for semantic search instead

Request

Request body for retrieving chunked document content. Contains context filtering options to select specific documents by collection, artifacts, and metadata criteria, plus optional token limiting for chat optimization. Content Filtering: * include: Specify node types to include (TextNode, ImageNode, TableNode, etc.) * exclude: Specify node types to exclude from the response Token Management: * max_tokens: Optional parameter to limit total tokens in response * Prevents context window overflow in chat interfaces The request body defines filtering criteria and chunking parameters for retrieving documents split into chat-ready content blocks with citations.
context_filterobjectRequired
Filter to select documents to retrieve. Supports filtering by collection, artifacts, and metadata.
formatenumOptional
Format for returned content. 'object' returns structured data, 'markdown' returns content formatted as markdown text.
filterobject or nullOptional
Content filtering options to include or exclude specific node types. Use this to control the types of content returned in the response.
max_tokensinteger or nullOptional>=1
Maximum number of tokens to return in the content. If not set, returns full content of the documents.

Response

Successful chunked content retrieval
datalist of objects
List of documents with their content split into chunks for chat usage

Errors

401
Unauthorized Error
422
Unprocessable Entity Error