MarkItDownConverter
Convert PDF, Word, PowerPoint, Excel, HTML, and many other file formats to Markdown Documents using Microsoft MarkItDown.
Key Features
- Converts PDF, DOCX, PPTX, XLSX, HTML, images, audio, and more to Markdown.
- Runs entirely locally with no external API calls.
- Accepts file paths,
Pathobjects, andByteStreaminputs. - Supports per-file or per-batch metadata attached to output Documents.
- Simple setup with a single optional init parameter.
Configuration
- Install the
markitdown-haystackintegration. - Configure
MarkItDownConverterin your pipeline YAML.
Connections
MarkItDownConverter accepts file paths, Path objects, or ByteStream inputs as sources, and optional metadata as meta. It outputs a list of Document objects (documents) containing Markdown content.
Connect the pipeline's file input to the sources input. Connect the documents output to DocumentSplitter, DocumentJoiner, or DocumentWriter for further processing.
Source Code
To check this component's source code, open markitdown_converter.py in the Haystack Core Integrations repository.
Usage Examples
Basic Configuration
markitdown_converter:
type: haystack_integrations.components.converters.markitdown.markitdown_converter.MarkItDownConverter
init_parameters:
store_full_path: false
Using the Component in a Pipeline
# haystack-pipeline
components:
markitdown_converter:
type: haystack_integrations.components.converters.markitdown.markitdown_converter.MarkItDownConverter
init_parameters:
store_full_path: false
splitter:
type: haystack.components.preprocessors.document_splitter.DocumentSplitter
init_parameters:
split_by: word
split_length: 250
split_overlap: 30
writer:
type: haystack.components.writers.document_writer.DocumentWriter
init_parameters:
document_store:
type: haystack_integrations.document_stores.opensearch.document_store.OpenSearchDocumentStore
init_parameters:
hosts:
- ${OPENSEARCH_HOST}
index: markitdown-demo
embedding_dim: 768
create_index: true
connections:
- sender: markitdown_converter.documents
receiver: splitter.documents
- sender: splitter.documents
receiver: writer.documents
inputs:
files:
- markitdown_converter.sources
max_runs_per_component: 100
metadata: {}
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
store_full_path | bool | False | If True, stores the full file path in Document metadata. If False, stores only the file name. |
Related Information
Was this page helpful?