With a working vector store from part 3, the next question was how to actually get real content into it. The plan was straightforward: embed each article locally through Ollama, using the same bge-m3 model already proven to match what runs on Cloudflare.
The first surprise had nothing to do with chunking. Testing against the longest article on this blog, the embedding call reported processing 2048 tokens, a suspiciously round number. Forcing the context window to 8192, the model's actual limit, processed the real count: 2636 tokens. Ollama's default context window had been silently truncating about 22% of the article, no error, no warning, just missing content. Every embedding call now explicitly sets num_ctx: 8192.
With that fixed, the real question became how to split an article into embeddings in the first place. The first attempt was simple: one embedding of the title and summary, one embedding of the whole article body as a single chunk. Testing it against real questions showed a problem. For a Kubernetes question, the actual right article's body chunk ranked fifth out of six results, behind two completely unrelated articles. For a question specifically about comment moderation, that article's own body chunk ranked dead last, even for its own topic.
The pattern lined up cleanly with article length: a short article's body chunk embedded almost as sharply as its own summary, but a long article's body chunk got progressively worse the longer it got. Whole-article embeddings dilute, exactly the reason chunking exists as a technique in the first place, now visible on real content instead of just assumed from theory.
The fix: split each article into paragraphs, plain blank-line splits, matching how the Markdown is already written, embed each one separately, and drop a handful of near-empty fragments like bare section headers and --- dividers along the way. Re-running the same three test questions afterward, every single one now had its entire top five results come from the correct article, no wrong-article contamination at all, compared to before where the right content sometimes didn't even make the top five.
The knowledge store is proving out the way it's supposed to. Next: building the actual assistant that queries it.