You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add configurable chunking strategies for RAG document processing #1238
Different document types need different chunking strategies. Jira issues are short and self-contained (chunk = 1 issue). Confluence pages can be 10K+ chars and need section-based splitting. Meeting notes need temporal chunking.
Problem
Current chunking is one-size-fits-all. No way to configure:
Good feature request, and partly in scope already — GAIA's RAG has a configurable chunking pipeline today, just not the per-document-type layer you're describing.
What exists now (RAGConfig in src/gaia/rag/sdk.py:82):
chunk_size (tokens) and chunk_overlap — exactly your default.chunk_size / overlap
use_llm_chunking — an LLM-driven semantic strategy (_llm_based_chunking, sdk.py:907), vs. the default paragraph/sentence splitter in _split_text_into_chunks (sdk.py:1332)
A named strategy enum (fixed / sentence / section / semantic) — today it's a boolean (use_llm_chunking)
Section-based splitting on H1/H2 headings — no heading-aware splitter exists yet
Per-document-type rules — chunk_size/strategy are global, not keyed by jira / confluence / pdf
The YAML surface to express all of the above
Suggested approach that fits existing patterns: extend RAGConfig with an optional per_type: dict[str, ChunkingConfig] and a strategy field, then refactor _split_text_into_chunks to dispatch on resolved strategy. The "document" strategy (1 chunk per item) is trivial for Jira; the "section" strategy is the only net-new splitter to write. This keeps backward compatibility since chunk_size/chunk_overlap already map cleanly onto a default config.
One open question for a maintainer: the YAML config loader location. RAG is currently configured programmatically via RAGConfig, so where the chunking: block lives (and how openhaimer feeds it in) is an architecture call — tagging @kovtcharov-amd for that.
Activity
github-actions commentedon May 29, 2026
Good feature request, and partly in scope already — GAIA's RAG has a configurable chunking pipeline today, just not the per-document-type layer you're describing.
What exists now (
RAGConfiginsrc/gaia/rag/sdk.py:82):chunk_size(tokens) andchunk_overlap— exactly yourdefault.chunk_size/overlapuse_llm_chunking— an LLM-driven semantic strategy (_llm_based_chunking,sdk.py:907), vs. the default paragraph/sentence splitter in_split_text_into_chunks(sdk.py:1332)sdk.py:1512), which is the mitigation for the RAG: VLM image blocks can be split across chunks when section-based splitting path is used #786 symptom you linkedWhat's genuinely missing:
strategyenum (fixed/sentence/section/semantic) — today it's a boolean (use_llm_chunking)chunk_size/strategy are global, not keyed byjira/confluence/pdfSuggested approach that fits existing patterns: extend
RAGConfigwith an optionalper_type: dict[str, ChunkingConfig]and astrategyfield, then refactor_split_text_into_chunksto dispatch on resolved strategy. The "document" strategy (1 chunk per item) is trivial for Jira; the "section" strategy is the only net-new splitter to write. This keeps backward compatibility sincechunk_size/chunk_overlapalready map cleanly onto a default config.One open question for a maintainer: the YAML config loader location. RAG is currently configured programmatically via
RAGConfig, so where thechunking:block lives (and how openhaimer feeds it in) is an architecture call — tagging @kovtcharov-amd for that.Worth a contribution if you're up for it — see CONTRIBUTING.md and the RAG tuning docs at
docs/sdk/sdks/rag.mdx.