Flowise icon indicating copy to clipboard operation
Flowise copied to clipboard

[BUG] Markdown Text Splitter - Overlap does not work

Open fmancardi opened this issue 1 year ago • 19 comments

Describe the bug

I've created a document store and create 4 file loaders using always the same md file

jack_russell_guide_5pages.md

I've used 4 different configuration of splitter type, and chunk size and overlap. Following images shows the outcome of tests

Image

Here seems to exist an issue (Markdown Text Splitter) Image

Image

Testing using Recursive Character Text Splitter, shows the overlap - chunk size: 1000, overlap 400

Image Image

To Reproduce

  1. Create a document store
  2. Create a document loader of text type
  3. Upload this md file jack_russell_guide_5pages.md
  4. Select chunk size: 1000, chunk overlap: 200
  5. Process
  6. Wait till document store status will be sync
  7. Access the view chunks option for the document loader just created.

No overlap seems to exists between chunks

Expected behavior

Overlaps are present, like happens when using Recursive Character Text Splitter

Screenshots

No response

Flow

No response

Use Method

None

Flowise Version

No response

Operating System

None

Browser

None

Additional context

No response

fmancardi avatar Sep 06 '25 10:09 fmancardi

Hi can you verify please?

thanks

fmancardi avatar Sep 12 '25 14:09 fmancardi

Hi can you verify please?

thanks

fmancardi avatar Sep 18 '25 16:09 fmancardi

Yep got the issue, working on it!!

kushalbhana avatar Sep 23 '25 19:09 kushalbhana

great!

fmancardi avatar Sep 23 '25 20:09 fmancardi

Hi can you fix it please?

fmancardi avatar Oct 07 '25 21:10 fmancardi

any news about this issue?

fmancardi avatar Oct 13 '25 13:10 fmancardi

any news about this issue?

fmancardi avatar Oct 22 '25 10:10 fmancardi

why not just use recursive text splitter?

HenryHengZJ avatar Oct 23 '25 11:10 HenryHengZJ

@HenryHengZJ I've use the recursive text splitter but thi is not the point.

The bug exists, then you have several options A- fix it B- remove this kind of splitter because it have a bug

but IMHO you can not ignore this does not work as expected

It's clear that simplest approach is B, then please follow it

Regards

fmancardi avatar Oct 26 '25 09:10 fmancardi

Any news?

fmancardi avatar Nov 24 '25 11:11 fmancardi

any news?

fmancardi avatar Dec 05 '25 17:12 fmancardi

any news?

fmancardi avatar Dec 08 '25 18:12 fmancardi

any news?

fmancardi avatar Feb 01 '26 12:02 fmancardi

The problem is that if you choose to split after markdown headers, the MarkDownTextSpliter does not any split after chars or overlap. In SplitByHeaders, sections are splited after the headers and no other split is applyed. if you put split by headers by disable, the MarkdownTextSpliter behaves as a simple RecursiveCharSpliter. But, even spliting by headers does not work as expected, because you have headers like === and ---- (h1, h2) which are not splited by MarkdownTextSpliter. Spliting such headers requires some work, because this is not a simple split. In its actual form, the MarkdownTextSpliter can be replaced with a recursiveCharacterTextSpliter with custom separators like: ["\n# ","\n## ","\n### ","\n#### ","\n##### ","\n###### ","\n\n","\n","\ ",""]

rvasilero avatar Mar 02 '26 10:03 rvasilero

Thanks for your help. Then solution is disable split by headers? But what effect this will have in the RAG?

thanks again

fmancardi avatar Mar 10 '26 22:03 fmancardi

Answer/supprot from the flowise team?

fmancardi avatar Mar 10 '26 22:03 fmancardi

The solution is to avoid MarkdownTextSpliter at all it is useless. Instead you can use RecursiveCharacterTextSpliter with custom separators like: ["\n# ","\n## ","\n### ","\n#### ","\n##### ","\n###### ","\n\n","\n"," ",""]. It splits text by the markdown headers and also uses overlap as expected. But pay attention that overlap is used only if the text is split in the middle. Otherwise, if the spliter can split text by separators, it apply no overlap, because it thinks that the separators separate text in semantic chunks. So, if you say you want chunks of 1000 chars with an overlap of 200 chars, if the spliter can do an 800 chunk, spliting by \n##, for example, it will do no overlap, because it will think that the separator splits text in semantic ways. The overlap is there only to keep semantic context when text is split in the middle of a phrase, proposition, or so. So, in conclusion, forget about markdowntextspliter, it is a joke.

rvasilero avatar Mar 12 '26 12:03 rvasilero

Ok, I trust your asnwer and advise, but is this is the situation my expectation is the FLOWISE team put a note in documentation.

Thanks a lot

fmancardi avatar Mar 12 '26 13:03 fmancardi

then flowise team? this is the quality of your Best Effort Support?

fmancardi avatar Jul 23 '26 10:07 fmancardi