Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions agent/rag/chunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def chunk_markdown(
min_chars: int = 200,
) -> list[Chunk]:
"""Heading-aware chunker. Returns chunks in document order."""
if not text or not text.strip():
return []

sections = _split_sections(text)
chunks: list[Chunk] = []
stack: list[str] = [""] * 7 # index by heading level
Expand Down
Loading