LLM
A RocketRide preprocessor node that uses a connected LLM to split document text into chunks for vector embedding storage. Choose it over rule-based text splitters when the LLM's document-level chunking guidance is worth the model call.
About LangChain
LangChain is a library for language-model applications. This node's package
declares langchain and langchain-core dependencies while obtaining model
operations through RocketRide's LLM connection.
What it does
Accumulates text for an object and, when it closes, asks the required LLM
connection for a JSON chunks array. The prompt requests coherent chunks that
preserve the input text plus a final summary chunk. Choose the general-text
preprocessor when deterministic local splitting is preferable, or the code
preprocessor for source-code syntax.
Connections
| Connection | Required | Description |
|---|---|---|
llm | yes | LLM used to process document text. |
Lanes
| Lane in | Lane out | Description |
|---|---|---|
text | documents | Accumulate and LLM-chunk text when the object closes. |
table | documents | Split tables locally into document chunks. |
Configuration
The default configuration uses 384 tokens as the prompt's target chunk size. Connect an LLM before processing, because the node reads that connection's context length, output length, and token counter on its first object.
Number of tokens per document chunk
This setting is included in the LLM prompt as the target size, with a three-quarters-as-many-words fallback. Set it to the chunk capacity appropriate for the embedding model that will receive the documents. It also sets the budget used to divide tables at line boundaries, so reduce it when table chunks are too large for the downstream embedding model. It is not the limit used to pre-split text for the LLM request: that limit comes from the connected LLM's context and output capacities.
Notes
Text and table processing
Before calling the LLM, the node reserves its prompt size and 500 tokens for JSON formatting, then uses the smaller of the remaining context budget and the model's output capacity. It begins splitting oversized text at a 65,536-character threshold, working through paragraphs, lines, sentences, and finally words. A single oversized word can remain intact rather than being cut further.
Tables bypass the LLM. They are split only between lines; a line that is longer
than the configured token budget remains a chunk by itself. Empty output
content is discarded. Each emitted document gets a chunkId; LLM summary
chunks are marked as summaries, and chunks made from tables are marked as
tables with a shared tableId for their source table.
LLM response shape
The node reads chunks from the LLM's JSON response. If that key is absent or
empty, text input produces no text documents; table chunks already collected
can still be emitted.
Upstream docs
Schema
| Field | Type | Description | Default |
|---|---|---|---|
preprocessor_llm.numberOfTokens | number | Number of tokens per document chunk. Needs to match your embedding model. | 384 |
preprocessor_llm.profile | string | "default" |
Dependencies
langchainlangchain-core