Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Chunking Strategies: Token-Based, Header-Based, Semantic, Overlap and Contextual Retrieval
There is no single best chunk size; choose a strategy by measuring recall and the context budget together. On the same 30 Turkish questions, 64-token windows ranked the right section first 19 times and header-based chunks 16 times; 256 tokens raised recall@5 to 28 but grew the prompt to 1,122 tokens. We compare fixed size, overlap, semantic, parent-child and Contextual Retrieval with gemma3:4b using real measurements.
Choosing an Embedding Model: Dimensions, Multilinguality, Turkish and Cost
Choose an embedding model by measuring it in your own language on your own question set, not by the leaderboard average: on the same content nomic-embed-text ranked the right section first for 26 of 30 questions in English but only 16 in Turkish. We measure with recall@k and MRR and look at prefixes, Matryoshka dimensions, storage, silent truncation and the risk of old vectors after a model switch, with real output.
Production RAG Architecture: Ingestion and Query Pipelines, and Why Minimal RAG Breaks
On a real document set, minimal RAG answered only 20 of 30 questions correctly; most failures come from retrieval, chunking, stale data and unauthorized documents rather than the model. Using Bookstore's Turkish documents we classify the failures, separate the ingestion and query pipelines, and build a query pipeline skeleton with a permission filter and a trace log.
Microsoft.Extensions.VectorData: Your First Collection with the Vector Store Abstraction
Microsoft.Extensions.VectorData lets you define a record with attributes and move from an in-memory store to PostgreSQL + pgvector with the same code; the generator you give the store produces the embeddings. With real outputs we look at filtered search, ScoreThreshold, how the distance function flips the meaning of the score, and a dimension bug the InMemory provider never catches.
LLMs and RAG: Answering with Data the Model Has Never Seen
Asked about the bookstore's return window, gemma3:4b confidently said 30 days; the right answer is 21. We split the policies into chunks, index them with nomic-embed-text, put the closest chunks into the prompt and get the model to say it doesn't know what isn't in the context. A minimal in-memory RAG in C# and its limits.
Embeddings and Similarity for LLMs: Searching Text by Meaning
What is an embedding and how do you compute cosine similarity? We produce 768-dimensional vectors with nomic-embed-text, write cosine similarity by hand in C# and TypeScript, build a small in-memory semantic search and compare it with keyword search. The negation trap and the limits with Turkish queries, with real scores.