diff --git a/src/adapters/outgoing/chunkers/paragraph_chunker.py b/src/adapters/outgoing/chunkers/paragraph_chunker.py index 105be6d..dffcbc3 100644 --- a/src/adapters/outgoing/chunkers/paragraph_chunker.py +++ b/src/adapters/outgoing/chunkers/paragraph_chunker.py @@ -309,7 +309,10 @@ class ParagraphChunker(IChunker): # Create chunks for this section with title prefix for text in chunk_texts: # Prepend document title and section title to chunk content - prefixed_content = f"{document_title}\n{section.title}\n{text}" + if section.title: + prefixed_content = f"{document_title}\n{section.title}\n\n{text}" + else: + prefixed_content = f"{document_title}\n\n{text}" chunk = Chunk( document_id=document.id,