When a document is parsed for retrieval-augmented generation, the parser does more than return one long string. It identifies meaningful parts of the source and represents them as elements. A heading, paragraph, table, list, image, or page break can become a separate element with its own text and metadata.
Understanding these elements is important when building a knowledge system for WooCommerce agencies. Product specifications, implementation guides, support procedures, and client documentation often contain a mixture of prose, tables, lists, screenshots, and code. Treating every source as plain text can destroy the structure that makes the information useful.
What an unstructured element represents
An unstructured element is a parsed unit that combines content with information about its role and origin. A typical element may contain:
- Text: The readable content extracted from the source.
- Element type: For example, a title, narrative text block, list item, table, or image.
- Metadata: Page number, coordinates, filename, document partition, or source identifiers.
- Relationships: References to a parent, section, or adjacent element, depending on the parser and representation.
The exact class names vary between parsing tools, but the principle is consistent: the parser preserves more context than a plain string would.
Common element types
Although different parsers use different taxonomies, the following categories appear frequently in business and technical documents:
- Title or heading: Establishes the subject of a document or section.
- Narrative text: A paragraph or continuous prose block.
- List item: A single item from a bulleted or numbered list.
- Table: Structured rows and columns, often containing pricing, configuration, or comparison data.
- Image: A visual object that may include an image description, extracted text, or a reference to the original file.
- Page break: A structural marker that can help preserve document boundaries.
- Header and footer: Repeated page-level content that may need to be filtered or handled separately.
For example, a client document describing a subscription store might be represented conceptually as:
Title: Subscription checkout requirements
NarrativeText: Customers must be able to pause a subscription...
ListItem: Payment retries must be visible in My Account.
Table: Supported gateways and recurring-payment limitations
Image: Checkout flow diagram
That representation is more useful for chunking than a sequence of arbitrary character ranges because it exposes likely semantic boundaries.
Why element boundaries matter for chunking
Chunking determines which pieces of a document are stored together and later supplied to a language model. If a chunk begins in the middle of a table row or separates a heading from its paragraph, retrieval may return technically correct words without the context needed to interpret them.
Element-aware chunking can apply rules such as:
- Keep a heading with the following paragraphs until the next heading at the same or higher level.
- Keep a short list with the paragraph that introduces it.
- Keep a table together when it fits within the token budget.
- Store a large table as several row groups while repeating the table title and column headings.
- Prevent content from unrelated pages or document sections from being merged.
For a WooCommerce agency, this helps distinguish a section about tax configuration from a nearby section about shipping zones, even when both appear in the same implementation guide.
Elements are not automatically good chunks
A parsed element is a structural unit, not necessarily a retrieval unit. A single paragraph may be too large, while a list item such as “Enable HPOS” may be too short to stand alone. A table may also contain several independent topics.
A practical pipeline usually has three stages:
- Parse: Extract elements and their metadata.
- Group: Combine related elements into semantic sections.
- Constrain: Split oversized groups to meet token or character limits without losing essential context.
This means chunking should inspect both the element type and the surrounding elements. For example, a heading followed by two paragraphs and a short list is often a better chunk than four independently embedded fragments.
Preserving metadata during processing
Metadata should travel with the text throughout parsing, chunking, embedding, and indexing. Useful fields for agency projects include:
- Document filename and document ID
- Client, brand, or store identifier
- Page number and section heading
- Source URL and document revision
- Element types included in the chunk
- Product, plugin, or integration names
- Access-control or tenancy information
For example, a chunk about payment gateway retries should not be returned for the wrong client merely because the text is similar. Tenant metadata must be applied as a retrieval filter, not treated as optional descriptive information.
Handling tables and lists
Tables require special care because their meaning depends on headers and row relationships. Converting a table into unlabelled text can produce an embedding that does not clearly associate a value with its column.
Prefer a representation that repeats the table context for each row group:
Table: WooCommerce payment gateway limitations
Columns: Gateway | Recurring payments | Refund support
Row: Gateway=ExamplePay; Recurring payments=Yes; Refund support=Manual
For lists, preserve the introductory sentence and list ordering when the order carries meaning. A migration checklist, for example, may require the sequence “backup, staging test, database migration, verification.” Embedding each item without that context weakens both search and generated answers.
Filtering noisy elements
Headers, footers, navigation labels, page numbers, and repeated legal notices can create duplicate or low-value chunks. They should not be removed blindly, because a footer may contain a revision date or a page-specific warning. Instead, identify repeated content and apply document-level rules.
A useful quality check is to count repeated strings across pages. If the same phrase appears on nearly every page and does not add semantic value, exclude it from the primary chunk text while retaining relevant document metadata separately.
Inspecting elements before indexing
Before generating embeddings, inspect a sample of parsed output. Look for missing headings, broken table rows, duplicated content, incorrect reading order, and OCR errors. A simple diagnostic view can expose problems early:
for element in elements:
print({
"type": element.type,
"text": element.text[:160],
"page": element.metadata.get("page_number"),
"section": element.metadata.get("section")
})
The property names will depend on the parser and application model. The important practice is to review the structural output before tuning chunk size or embedding settings. If the parser has assigned a table to the wrong page or merged two headings, changing the chunk overlap will not fix the underlying problem.
Applying this to WooCommerce knowledge bases
For WooCommerce documentation, element-aware chunking is particularly useful for:
- Plugin compatibility matrices
- Payment gateway setup procedures
- Shipping and tax configuration guides
- Client-specific operating procedures
- Support runbooks and escalation checklists
- Product catalogs with specifications and variations
A support query about failed renewal payments should retrieve the relevant procedure, gateway limitations, and client-specific settings—not an unrelated paragraph from a general checkout guide. Element types and metadata provide the signals needed to make those distinctions.
Practical validation criteria
Evaluate parsed and chunked output with representative questions rather than only measuring chunk length. For each question, verify that the returned chunk:
- Contains the answer or the precise procedure needed to find it.
- Includes the section or table context required to interpret the answer.
- Does not combine unrelated client or store information.
- Retains source metadata needed for citation and troubleshooting.
- Can be traced back to the original page or document location.
Unstructured elements give a chunking pipeline an intermediate representation between raw files and embeddings. Using that representation deliberately makes retrieval more precise, keeps document structure visible, and reduces the risk of producing confident answers from incomplete WooCommerce documentation.