Generated Metadata
Learn about the metadata generated by Mixedbread Stores for ingestion and search.
Mixedbread Stores automatically generate metadata for each file ingested. This generated metadata provides structured information about the content of the file, including language, size, headings, number of pages, and more.
The generated metadata can be retrieved using the generated_metadata chunk field.
Metadata Types
The generated_metadata object is a typed structure discriminated by the type field.
If type is not present, it is inferred from file_type (MIME); otherwise it defaults to text.
Supported type values: markdown, text, email, csv, pdf, code, audio, video, image.
Every metadata object includes a file_extension field (e.g., ".mp3", ".pdf") reflecting the original file extension.
For a full list of supported file formats, see Supported File Types.
Markdown - Heading Extraction
When processing markdown files, the system automatically extracts and preserves
heading structure to enhance search relevance and provide context. This feature
works for all markdown formats (.md, .markdown, .mdx).
What You Get
Each markdown chunk’s generated_metadata includes:
type: Always"markdown".file_type: Always"text/markdown".language: Detected language of the text.word_count: Word count for the chunk.file_size: File size in bytes.chunk_headings: Headings found within the current chunk ([{ level: number, text: string }]).heading_context: The document structure context leading up to this chunk ([{ level: number, text: string }]).start_line: Starting line number of the chunk in the source file.num_lines: Number of lines in the chunk.
Example Output
Consider this markdown document:
# Getting Started
## Installation
### Prerequisites
You need Python 3.8+ installed.
...
### Setup
Run the following command:
```bash
pip install package
```
...
## Configuration
### Environment Variables
Set these variables in your `.env` file.
### Database Setup
Configure your database connection.When processed, the chunks would have generated_metadata like this:
Chunk 1 (Prerequisites section):
{
"type": "markdown",
"file_type": "text/markdown",
"language": "en",
"word_count": 6,
"file_size": 1234,
"chunk_headings": [
{"level": 1, "text": "Getting Started"},
{"level": 2, "text": "Installation"},
{"level": 3, "text": "Prerequisites"}
],
"heading_context": []
}Chunk 2 (Setup section):
{
"type": "markdown",
"file_type": "text/markdown",
"language": "en",
"word_count": 12,
"file_size": 1234,
"chunk_headings": [
{"level": 3, "text": "Setup"}
],
"heading_context": [
{"level": 1, "text": "Getting Started"},
{"level": 2, "text": "Installation"},
{"level": 3, "text": "Prerequisites"}
]
}Chunk 3 (Configuration section):
{
"type": "markdown",
"file_type": "text/markdown",
"language": "en",
"word_count": 20,
"file_size": 1234,
"chunk_headings": [
{"level": 2, "text": "Configuration"},
{"level": 3, "text": "Environment Variables"},
{"level": 3, "text": "Database Setup"}
],
"heading_context": [
{"level": 1, "text": "Getting Started"},
{"level": 2, "text": "Installation"},
{"level": 3, "text": "Setup"}
]
}Text - Common Fields
Plain text chunks include a simpler generated_metadata shape:
type:"text"file_type:"text/plain"language: Detected language of the textword_count: Word count for the chunkfile_size: File size in bytesstart_line: Starting line number of the chunk in the source filenum_lines: Number of lines in the chunk
Example
{
"type": "text",
"file_type": "text/plain",
"language": "en",
"word_count": 57,
"file_size": 2048,
"start_line": 0,
"num_lines": 15
}Email - Headers
Email files (.eml and Outlook .msg) carry their headers on every chunk, so a chunk deep in a long
email can still be filtered by sender, recipient or date. Alongside the common text fields:
type:"email"file_type:"message/rfc822"or"application/vnd.ms-outlook"subject: The email subjectfrom_email: The sender's addressto_emails,cc_emails,bcc_emails: Recipient addressesdate: The sent date in ISO 8601, in UTCattachment_names: File names of the attachments
Example
{
"type": "email",
"file_type": "message/rfc822",
"language": "en",
"word_count": 182,
"file_size": 1210,
"start_line": 0,
"num_lines": 14,
"subject": "Quarterly update",
"from_email": "jane@example.com",
"to_emails": ["team@example.com"],
"cc_emails": [],
"bcc_emails": [],
"date": "2026-07-01T09:15:00+00:00",
"attachment_names": ["report.pdf"]
}CSV - Row Positions
CSV files are rendered as markdown tables. Each chunk repeats the header row and holds as many
data rows as fit the chunk's token budget, so a chunk always reads as a complete table. A row is
only split when it cannot fit a chunk on its own: it is then broken into column groups, each led
by the row's first column, and a single oversized cell is broken into pieces. Alongside the common
text fields, each chunk records where its rows live in the source file. Rows and lines are 1-based,
and the header is row 1. An Excel sep= line or a lone title above the header is skipped but still
counted. Tab-separated .tsv files use the same parser and metadata.
type:"csv"file_type:"text/csv"start_line: Line of the chunk's first data row in the source filenum_lines: Number of source lines the chunk's rows span (a quoted cell may span several lines)start_row: Row number of the chunk's first data rownum_rows: Number of rows the chunk spans
The chunk's offset field is the character offset of the first data row.
Example
{
"type": "csv",
"file_type": "text/csv",
"language": "en",
"word_count": 1240,
"file_size": 18320,
"start_line": 42,
"num_lines": 40,
"start_row": 42,
"num_rows": 40
}Code - Language and Size
For supported source files (e.g., Python, TypeScript, Java, C#), generated_metadata includes:
type:"code"file_type: One oftext/x-python,text/x-script.python,application/typescript,text/typescript,text/x-java-source,text/x-csharp, orapplication/javascriptlanguage: Detected programming languageword_count: Tokenized word count approximation for codefile_size: File size in bytesstart_line: Starting line number of the chunk in the source filenum_lines: Number of lines in the chunk
Example
{
"type": "code",
"file_type": "text/x-python",
"language": "python",
"word_count": 120,
"file_size": 8192,
"start_line": 0,
"num_lines": 42
}PDF - Document Stats
PDF chunks have specialized document-level stats:
type:"pdf"file_type:"application/pdf"total_pages: Total number of pages in the documenttotal_size: Total size of the original file in bytes
Example
{
"type": "pdf",
"file_type": "application/pdf",
"total_pages": 42,
"total_size": 1048576
}Image - Dimensions
Image chunks include basic dimensional metadata:
type:"image"file_type: String (MIME type, e.g.,image/jpeg,image/png)file_size: File size in byteswidth: Image width in pixelsheight: Image height in pixels
Example
{
"type": "image",
"file_type": "image/jpeg",
"file_size": 204800,
"width": 1920,
"height": 1080
}Audio - Media Information
Audio chunks include specialized media metadata:
type:"audio"file_type: String (MIME type, e.g.,audio/mpeg,audio/wav)file_size: File size in bytestotal_duration_seconds: Total duration of the audio in secondssample_rate: Audio sample rate in Hzchannels: Number of audio channelsaudio_format: Audio format codebpm: Detected beats per minute (optional, only present when detected)speakers: Labels of the speakers heard in the chunk, such as["Speaker 1", "Speaker 3"](optional, see Speakers)speaker_count: Number of speakers in the whole file (optional)speaker_turns: The chunk's transcription as{"speaker", "text", "start_time_seconds", "end_time_seconds"}turns, timed in seconds from the start of the file (optional)start_time_seconds: Start time of the chunk in secondsend_time_seconds: End time of the chunk in secondsduration_seconds: Duration of the chunk in secondschunk_size_bytes: Size of the chunk in bytes
Example
{
"type": "audio",
"file_type": "audio/mpeg",
"file_size": 5242880,
"total_duration_seconds": 180.5,
"sample_rate": 44100,
"channels": 2,
"audio_format": 1,
"speakers": ["Speaker 1", "Speaker 2"],
"speaker_count": 4,
"speaker_turns": [
{
"speaker": "Speaker 1",
"text": "Welcome back to the show.",
"start_time_seconds": 0.12,
"end_time_seconds": 1.84
},
{
"speaker": "Speaker 2",
"text": "Thanks for having me.",
"start_time_seconds": 2.3,
"end_time_seconds": 3.51
}
],
"start_time_seconds": 0,
"end_time_seconds": 38.93,
"duration_seconds": 38.93,
"chunk_size_bytes": 650736
}Speakers
With the high_quality parsing strategy, an audio file or a video with an audio track is transcribed as a
whole, and every word is attributed to a speaker. Speakers are numbered in the order they first speak, and
a label means the same person in every chunk of the file, so you can filter on generated_metadata.speakers
to find the chunks where one speaker talks. Each turn in speaker_turns runs from the start of its first
word to the end of its last, so you can cite the moment a passage was said. Files longer than 4 hours or of 2 GB or more are transcribed
one chunk at a time without speaker fields.
Video - Media Information
Video chunks include specialized media metadata:
type:"video"file_type: String (MIME type, e.g.,video/mp4,video/webm)file_size: File size in bytestotal_duration_seconds: Total duration of the video in secondsfps: Frames per secondwidth: Video width in pixelsheight: Video height in pixelsframe_count: Total number of frameshas_audio_stream: Whether the video contains an audio trackbpm: Detected beats per minute (optional, only present when detected)speakers: Labels of the speakers heard in the chunk, such as["Speaker 1", "Speaker 3"](optional, see Speakers)speaker_count: Number of speakers in the whole file (optional)speaker_turns: The chunk's transcription as{"speaker", "text", "start_time_seconds", "end_time_seconds"}turns, timed in seconds from the start of the file (optional)start_time_seconds: Start time of the chunk in secondsend_time_seconds: End time of the chunk in secondsduration_seconds: Duration of the chunk in secondschunk_size_bytes: Size of the chunk in bytes
Example
{
"type": "video",
"file_type": "video/mp4",
"file_size": 15728640,
"total_duration_seconds": 120.0,
"fps": 30.0,
"width": 1920,
"height": 1080,
"frame_count": 3600,
"has_audio_stream": true,
"start_time_seconds": 0.0,
"end_time_seconds": 120.0,
"duration_seconds": 120.0,
"chunk_size_bytes": 2097152
}Type Inference and Flexibility
- If
typeis not present ingenerated_metadata, it is inferred fromfile_typewhen possible. - If neither
typenor a recognizedfile_typeis present, thetypedefaults to"text". - The system may include additional fields as needed for future enhancements; clients should read the documented fields and ignore unknown ones.