Metadata Chunk Sections
1 min read
The Metadata Chunk Sections configuration defines how metadata associated with retrieved chunks is appended to the chunk text before being passed to the language model orchestrator.
In the search process, relevant chunks are found RAG pipeline. Each chunk contains structured metadata — such as creation date, or document type — but this metadata is not part of the chunk text itself. Customised metadata can be generated as part of the document ingestion pipeline.
The Metadata Chunk Sections feature allows this metadata to be explicitly embedded into the chunk text so that the language model can access and use it when generating responses.
How It Works
The RAG pipeline returns a set of chunks, each containing:
text: the extracted content from the document
metadata: structured metadata fields
Before these chunks are sent to the LLM orchestrator, the system checks the Metadata Chunk Sections configuration.
For each configured metadata field, the corresponding template string is applied.
The {} placeholder in each template is replaced with the actual metadata value from the chunk.
The resulting formatted metadata strings are appended to the chunk text.
This ensures that metadata — originally separate from the content — is integrated into the textual input the model sees, improving context-awareness and grounding.
Configuration
Each metadata entry consists of a key and a template:
Key: The metadata field name (e.g., created_at, source).
Template: A string defining how the metadata should be appended, where {} represents the value.
Example configuration:

Resulting chunk text (sent to the LLM):
"[{\"source_number\": 0, \"content\": \"<created_at>2024-10-22</created_at>\\n<|document|>abc.pdf<|/document|>\\n<|title|>Document Title<|/title|>\\nMain content ....Benefits
Enhanced context – The orchestrator model receives important metadata (e.g., timestamps, sources) in the chunk text, improving its ability to produce relevant and traceable answers.
Flexible configuration – The appended format can be customized per field.