#11598·langchainjs

Would you consider adding MarkdownHeaderTextSplitter to Javascript LangChain?

Author: michielvaneerdCreated Sep 10, 2026Updated Sep 12, 2026
Labelsbug

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • I added a very descriptive title to this issue.
  • I searched the LangChain.js documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain.js rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

typescript
import { MarkdownHeaderTextSplitter } from "@langchain/textsplitters";

Error Message and Stack Trace (if applicable)

No response

Description

When splitting Markdown, the MarkdownHeaderTextSplitter is the only textsplitter that keeps the header hierarchy which is needed to give chunks the context they need for RAG search. As far as I know, this is not possible with the MarkdownTextSplitter or the RecursiveCharacterTextSplitter.

Are you considering adding the MarkdownHeaderTextSplitter to the Javascript LangChain?

System Info

[email protected] | MIT | deps: 4 | versions: 465 Mac OS Node v24.21.0 NPM 12.0.2

Source: langchain-ai/langchainjs