Goroutines and channels

While building RagPack, I needed a file worker that would parse file chunks and write them into LanceDB, an embedded columnar vector database. This would have been fiddly to get right in most languages, but Go’s concurrency primitives made it simple without any major architectural shift. Here’s how goroutines, channels, and sync.WaitGroup work together in the ingestion pipeline.

More …

TIL: Streaming Data in Go with iter and yield

While building RagPack, a library that chunks files for embedding, I needed a common way to stream parsed content from multiple file formats. RagPack supports CSV, PDF, DOCX, HTML, XLSX, Markdown, JSON and more. Each format has its own parser, but the ingester that consumes them should not care which one it is talking to. I needed a shared contract. In Java I would have reached for an Iterator<T> or an InputStream, but in Go the answer turned out to be the iter package, introduced in Go 1.23.

More …