In a WooCommerce retrieval pipeline, chunking should not begin with arbitrary character counts. It should begin with the structure already present in the source document. When a parser can reliably identify headings, tables, lists, paragraphs, and repeated page elements, that structure is usually more useful than a second layer of manual segmentation.
What “parser-created structure” means
A document parser converts a file into semantic elements instead of returning one unstructured text string. For example, a product feed specification or fulfillment guide might be represented as:
{
"type": "heading",
"level": 2,
"text": "Backorder handling"
}
{
"type": "paragraph",
"text": "When inventory is unavailable, the store may accept payment and create an order with a backordered line item."
}
{
"type": "table",
"headers": ["Status", "Customer email", "Stock action"],
"rows": [
["On backorder", "Send delay notice", "Reserve incoming stock"]
]
}
LlamaParse can be used to extract this kind of structure from PDFs and other complex files. The exact output depends on the parser configuration and document quality, so the important design principle is to preserve element boundaries and metadata before applying application-specific chunking.
Let the parser define boundaries when structure carries meaning
Parser-created boundaries are usually the right starting point when a document has clear semantic units. A WooCommerce agency may encounter these cases:
- Implementation guides: headings often identify independent configuration areas such as tax settings, shipping zones, webhooks, or order status transitions.
- Product catalogs: product names, attributes, specifications, and compatibility notes need to remain associated.
- Operations manuals: numbered procedures and warnings should stay with the step or section they qualify.
- API documentation: an endpoint, authentication requirement, request example, and response description form a useful retrieval unit.
- Policy documents: exclusions, exceptions, and definitions can lose their meaning when separated from the governing section.
For example, a question such as “How should this store handle subscriptions when a payment fails?” should retrieve the heading, explanatory paragraphs, exception notes, and relevant procedure steps together. Splitting only by character count can separate the failure condition from the action that follows it.
Use hierarchy, not just text length
A parser often exposes heading levels or parent-child relationships. Preserve that hierarchy in the chunk metadata and, where practical, in the chunk text itself.
Section: Payment retries
Subsection: Renewal failure
If a renewal payment fails, WooCommerce Subscriptions retries the payment according to the configured retry rules. The order remains pending until the payment succeeds or the subscription is marked as failed.
The parent heading gives an embedding and a language model additional context. A subsection called “Renewal failure” is much less useful when indexed without its parent section, especially when the same phrase appears in several documents.
A practical metadata shape might include:
{
"document_id": "store-operations-2025",
"element_type": "paragraph",
"heading_path": ["Payments", "Payment retries", "Renewal failure"],
"page": 18,
"source": "subscription-handbook.pdf"
}
When parser boundaries are sufficient
Use the parser output without additional splitting when all of the following are true:
- The element is small enough for the embedding model and downstream context window.
- The element is semantically complete on its own or includes its heading path.
- Tables, lists, and adjacent explanatory text have not been separated in a way that changes their meaning.
- The parser has produced stable boundaries across representative files.
- Retrieval tests show that the complete answer is usually contained in one element or a small neighboring group.
This approach reduces unnecessary processing. It also makes debugging easier because every retrieved chunk can be traced to a document element and page location.
When to add application-level chunking
Parser output is not automatically an ideal retrieval chunk. Add a second chunking stage when a parsed element is too large, too heterogeneous, or too dependent on neighboring elements.
Large sections
A single section may contain several unrelated topics. A 20-page “Order management” section could include refunds, cancellations, partial fulfillment, fraud review, and exports. Keep the heading hierarchy, but split the content at lower-level headings or paragraph boundaries.
Long tables
Tables often need special treatment. A large shipping-rate table may exceed the useful embedding size, while splitting rows without repeating the column headers makes each chunk ambiguous. Create row groups that repeat the table title and headers:
Table: Shipping rates by region
Columns: Region | Service | Delivery time | Cost
Rows 1–20:
North America | Express | 1–2 business days | 19.00 USD
For WooCommerce projects, consider whether the table should be indexed as text at all. If the source is authoritative and queried by exact region, weight, or price, storing normalized rows in a database and using metadata filters or SQL may be more reliable than semantic search.
Lists and procedures
A parser may return every list item separately. That can be harmful when the list is a procedure whose order matters. Keep the introductory instruction, all required steps, and any warning together unless the list is too long. If splitting is necessary, include the procedure title and step numbers in every chunk.
Scanned or poorly structured documents
OCR errors, missing headings, repeated headers, and incorrect reading order are signals that parser-created structure needs validation. Do not compensate for unreliable extraction by blindly changing chunk size. First inspect the parsed elements and correct the extraction workflow, document preprocessing, or parser settings.
Use neighboring context selectively
Some elements depend on their neighbors. A short paragraph beginning with “This setting” is not useful by itself. Instead of merging an entire page, add limited context such as the heading path, the preceding heading, or one adjacent paragraph.
For example, a chunk can contain:
Heading path: WooCommerce > Shipping > Local pickup
Section context: Local pickup is available only for products assigned to an enabled pickup location.
Detail: This setting controls whether customers can choose local pickup during checkout.
Keep the original element boundaries in metadata even when context is added. This allows an agency to display the source passage accurately and update or reprocess only the affected element when the document changes.
Define validation rules before production indexing
Parser-led chunking works best with measurable checks. For each document type, verify:
- Headings are detected and assigned the correct levels.
- Paragraph order matches the source document.
- Table headers are retained when table rows are split.
- List numbering and warning text remain associated with the relevant procedure.
- Repeated page headers and footers are removed or marked as non-content.
- Every chunk has a stable source identifier, page or location information, and a heading path where available.
- Representative WooCommerce questions retrieve the complete policy, procedure, or specification needed to answer them.
A useful test set might include questions about refund eligibility, variable-product attributes, shipping-zone rules, failed subscription renewals, and webhook retry behavior. Evaluate not only whether the correct document appears, but whether the retrieved chunk includes the conditions and exceptions that control the answer.
A practical decision rule
Let the parser create the initial structure when the source has meaningful headings, tables, lists, and reading order. Preserve those boundaries and metadata as the canonical representation. Add manual chunking only where a parsed element is too large, combines unrelated subjects, or lacks the context required for retrieval.
In an agency pipeline, this usually means maintaining separate stages: parse the document, normalize the elements, validate the structure, enrich each element with hierarchy and source metadata, then split only the elements that fail size or semantic-completeness checks. This keeps chunking explainable and prevents a fixed token limit from destroying the relationships that make operational WooCommerce documentation useful.