Merge #1076: fix(engineering): enforce RAG chunk bounds for nonspaced text

This commit is contained in:
Michael Sitarzewski
2026-10-13 05:51:52 -05:00
@@ -90,7 +90,7 @@ def chunk_document(text: str, doc_type: str) -> list[dict]:
char_splitter = RecursiveCharacterTextSplitter(
chunk_size=800,
chunk_overlap=100,
separators=["\n\n", "\n", ". ", " "]
separators=["\n\n", "\n", ". ", " ", ""]
)
chunks = []
for doc in header_chunks:
@@ -103,7 +103,7 @@ def chunk_document(text: str, doc_type: str) -> list[dict]:
splitter = RecursiveCharacterTextSplitter(
chunk_size=600,
chunk_overlap=80,
separators=["\n\n", "\n", ". ", "! ", "? ", " "]
separators=["\n\n", "\n", ". ", "! ", "? ", " ", ""]
)
return [
{"content": doc.page_content, "metadata": doc.metadata}