Sharing something I built for ODC RAG pipelines.
Every project I have seen that processes documents for a RAG pipeline ends up solving the same chunking problem from scratch. Someone writes a Server Action that splits on paragraph breaks. It works until the first code block. Then a table breaks. Then context goes missing.
I built a C# External Logic library that exposes four chunking strategies for structured document ingestion: ChunkByCharacter, ChunkRecursively, ChunkBySentence, and ChunkMarkdown. Each targets a different document profile. All four return the same output contract so your downstream logic handles one shape regardless of which strategy produced the chunks.
ChunkMarkdown is the interesting one. It tracks heading hierarchy as it processes the document and can prepend the full ancestor path directly into the chunk body. Embeddings keep their positional context.
Full write-up on Medium with implementation details and screenshots: https://medium.com/@michael.de.guzman/beyond-text-splitting-building-a-chunking-strategy-library-for-odc-017e1c922912
How are you currently handling document chunking in your ODC AI projects? Drop a comment or reach out directly.