Chunking is not a single step that belongs in every system component. For a WooCommerce agency, the right location depends on what the source document represents, how often it changes, and which downstream systems need to search or generate answers from it.
A product catalogue, a shipping policy, and an order export have very different boundaries. Applying the same chunking rule to all three usually creates either oversized retrieval results or fragments that lack the context required to be useful.
The main locations for chunking
In a document pipeline using LlamaParse and a downstream retrieval or indexing system such as Undefined, chunking can happen in several places:
- During parsing: The parser identifies headings, paragraphs, tables, lists, and other document structure. This is useful when the source format contains meaningful layout or hierarchy.
- After parsing: A separate transformation step combines or divides parsed elements into application-specific chunks. This is often the most flexible option.
- During indexing: The search or vector database creates chunks as content is ingested. This can simplify operations, but it may hide important business rules inside the indexing layer.
- At query time: A system can retrieve larger source sections and split, compress, or rerank them only when a question is asked. This preserves source context but requires more query-time processing.
Chunk at the parsing stage when structure is the product
Parsing-stage chunking is appropriate when the document’s native structure already maps closely to the units users need. Examples include a policy document with clearly defined sections, a technical integration guide organized by endpoint, or a supplier catalogue where each product is represented by a consistently structured record.
For example, a returns policy might be divided into sections such as eligibility, time limits, exclusions, and international returns. Keeping each section intact makes it easier for a support assistant to retrieve a complete rule instead of a paragraph that refers to a condition defined several pages earlier.
LlamaParse can expose document structure for downstream processing. The important design decision is not simply to split wherever a page ends. Page boundaries are presentation boundaries, not necessarily semantic boundaries. A heading, its introductory text, and the table or list that follows it should normally remain associated.
Chunk after parsing when business context matters
Post-parsing chunking is usually the strongest default for agencies because it separates document extraction from retrieval design. LlamaParse can first produce a structured representation, and a later transformation step can apply rules specific to the WooCommerce implementation.
Consider a merchant’s fulfilment manual. A useful chunk may contain:
- The warehouse or fulfilment method.
- The applicable destination or shipping zone.
- The product conditions or exclusions.
- The delivery estimate.
- The escalation instruction for exceptions.
A naive character limit could separate the destination from the delivery estimate or detach an exception from the rule it modifies. A post-parsing step can inspect headings, tables, and lists before creating the final chunk and can attach metadata such as store_id, shipping_zone, document_version, and effective_date.
This approach is also useful when one source must serve multiple applications. A customer-facing assistant may need concise policy chunks, while an internal operations tool may need larger chunks that include procedural notes. The parsed source can be retained once and transformed into different chunk views.
Chunk at indexing time when the index owns the policy
Index-time chunking can be appropriate when the same ingestion service manages parsing, embedding, storage, and retrieval for many projects. It reduces the amount of custom pipeline code and gives the indexing layer a consistent way to process incoming content.
This works well for relatively uniform content, such as a collection of product descriptions or regularly generated help articles. It becomes less suitable when different content types require different boundaries. A product description, a refund rule, and an order-status event should not necessarily be processed with the same size and overlap settings.
If chunking occurs inside an indexing service, document the resulting behaviour explicitly. Record the chunking configuration, source identifier, version, and timestamp. Without this information, a later change to chunk size or overlap can make search results difficult to reproduce and can complicate reindexing after a merchant edits a policy.
Use query-time splitting selectively
Query-time processing is useful when retrieval should begin with broad context. The system can retrieve a complete policy section, a product record, or an order-related document and then select the most relevant passages for the final prompt.
This pattern helps when meaning depends on nearby content. For example, a shipping rule may contain a table followed by notes that define exceptions. Indexing every row independently could improve precision for one query while losing the relationship between the table and its qualification. Retrieving the larger section first preserves that relationship.
Query-time splitting has a cost: more content may be read, reranked, compressed, or sent through a language model. It should therefore be reserved for content where context is more valuable than the smallest possible retrieval unit.
A practical decision framework
Choose the chunking location by answering these questions:
- Does the source have reliable semantic structure? If headings, records, or sections are meaningful, preserve them during parsing and use them as candidate boundaries.
- Are rules specific to the store or workflow? If the answer is yes, apply chunking after parsing so metadata and business logic can be added consistently.
- Will multiple applications use the same source? Keep a canonical parsed representation and create application-specific chunks downstream.
- Does context span tables, lists, or adjacent sections? Consider indexing larger sections and splitting or compressing them at query time.
- How frequently does the content change? Frequently changing product or order data benefits from deterministic, inexpensive chunking and targeted reindexing.
- Can the team reproduce the result? Store the chunking version and configuration wherever the chunks are created.
WooCommerce examples
Product catalogue
For product data, the product or variation is often a natural chunk boundary. Keep the title, SKU, attributes, price context, stock state, and relevant description together. Store identifiers as metadata rather than relying only on the embedded text. This allows filters such as product ID, category, language, or stock status to be applied before semantic retrieval.
Returns and refund policies
For policy documents, chunk by semantic section rather than by page. Keep exceptions with the rule they qualify. If a table contains eligibility conditions, include the table heading and explanatory notes in the same logical unit or preserve explicit references between the resulting chunks.
Order and support history
For order records, chunk by event or support case rather than by an arbitrary token count. A useful event chunk can include the order identifier, event type, timestamp, customer-visible message, and operational status. Sensitive fields should be removed or access-controlled before indexing.
Keep chunking observable
Whichever layer performs chunking, retain a link from every chunk to its source. Useful fields include source_id, source_type, source_version, section_path, chunk_index, and content_hash. These fields support debugging when a store owner asks why a policy answer was returned or when a product update has not appeared in search.
Test the placement decision with representative queries. Include questions that target a single fact, questions requiring an exception, and questions that combine information from multiple sections. If answers are missing conditions, chunking is probably too small or boundaries are being made without considering document structure. If results contain several unrelated products or policies, chunking or metadata filtering is probably too broad.