Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
.NET Core Web API 36 Angular 31 JavaScript Basics 19 JavaScript Intermediate 18 JavaScript Advanced 16 TypeScript Basics 14 TypeScript Intermediate 14 TypeScript Advanced 12 Entity Framework Core 28 Dapper 16 Git & GitHub 29 Web Security (OWASP Top 10) 21 LLM Fundamentals 20 C# Fundamentals 20 Object-Oriented Programming in C# 16 C# Collections and Generics 11 LINQ 17 Asynchronous Programming in C# 17 Advanced C# 14 C# Versions 6 Solution Patterns 22 SOLID and Design Principles 12 Clean Code 13 Design Patterns 23 UML and Modeling 18 Introduction to Software Architecture 9 Clean, Onion and Hexagonal Architecture 8 Vertical Slice Architecture 6 Domain-Driven Design 12 CQRS and Event Sourcing 10 Messaging and Event-Driven Architecture 9 Modular Monolith 2 Microservices 10 UI Architecture Patterns 9 Architecture Decisions 7 System Design 15 Distributed Systems Fundamentals 11 Background Jobs and Scheduled Jobs 11 Working with Message Queues 14 Logging in .NET 10 Caching 10 Real-time Applications 9 ASP.NET Core MVC and Razor Pages 13 CI/CD Fundamentals 8 GitHub Actions 16 Jenkins 12 Web Servers and Hosting 12 Deployment Strategies 9 Kubernetes 19 Authentication and Authorization 18 ASP.NET Core Security 8 Frontend Security 9 API Security (OWASP API Top 10) 11 AI with .NET 14 RAG 13 AI Agents and MCP 14 Test Strategy 4 Unit Testing 13 SDLC (Software Development Life Cycle) 6 Agile Mindset 6 Scrum 11 Kanban 7 Introduction to Product Management 9 SEO Fundamentals 7 Technical SEO 12 GEO (Generative Engine Optimization) 7 Algorithms and Data Structures 22 Debugging and Problem Solving 13
13 posts found #dotnet
Production RAG Architecture: Ingestion and Query Pipelines, and Why Minimal RAG Breaks
Artificial Intelligence PART 01

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.

8 Nov 2026 14 min 4
Choosing an Embedding Model: Dimensions, Multilinguality, Turkish and Cost
Artificial Intelligence PART 02

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.

8 Nov 2026 13 min 2
Document Ingestion: Clean Text, Metadata and Incremental Updates from PDF, HTML and Markdown
Artificial Intelligence PART 03

Document Ingestion: Clean Text, Metadata and Incremental Updates from PDF, HTML and Markdown

RAG quality starts at ingestion: a "fi" ligature from a PDF made Contains("fiyat") return false, a page number landed in the middle of a section, and an HTML menu leaked into a chunk. Clean text, metadata on every chunk, a pipeline with partial success using Microsoft.Extensions.DataIngestion (preview), incremental updates with content hashes, and removing deleted documents from the index.

8 Nov 2026 14 min 2
Chunking Strategies: Token-Based, Header-Based, Semantic, Overlap and Contextual Retrieval
Artificial Intelligence PART 04

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.

8 Nov 2026 10 min 2
Choosing a Vector Database: pgvector, SQL Server 2025, Qdrant, Azure AI Search and Elasticsearch
Artificial Intelligence PART 05

Choosing a Vector Database: pgvector, SQL Server 2025, Qdrant, Azure AI Search and Elasticsearch

Try your existing database's vector support first, and tune the ANN index by measuring recall on your own data. On a 100,000-vector pgvector table exact search took 237 ms and HNSW 1 ms, but recall stayed at 0.83 with the default ef_search; with a filter, HNSW forced onto the index returned zero rows while an iterative scan found 10. HNSW, IVFFlat, DiskANN, choosing a metric, and five options compared.

8 Nov 2026 12 min 2
Vector Search with EF Core (1): SQL Server 2025 vector Type, VectorDistance and EF Core 11 VectorSearch
Artificial Intelligence PART 06

Vector Search with EF Core (1): SQL Server 2025 vector Type, VectorDistance and EF Core 11 VectorSearch

In EF Core 10 a SQL Server 2025 vector column is mapped with a SqlVector<float> property and HasColumnType("vector(768)"), and search is done exactly with EF.Functions.VectorDistance. We build the code and inspect the real SQL EF Core generates: queries without a projection fetch the vector too, the preview vector index and VECTOR_SEARCH, and what EF Core 11 brings. SQL Server 2025 was not run for this post.

8 Nov 2026 10 min 2
Vector Search with EF Core (2): PostgreSQL pgvector, HNSW Index and Dapper
Artificial Intelligence PART 07

Vector Search with EF Core (2): PostgreSQL pgvector, HNSW Index and Dapper

With Pgvector.EntityFrameworkCore a Vector property, an HNSW index and CosineDistance ordering take a few lines; the real risk is silent failures: an index built with vector_l2_ops was never used by a cosine query, and without ReloadTypes Npgsql could not write the vector. Search with a permission filter, EXPLAIN checks, halving storage with halfvec (identical top-5 for 30 of 30 questions) and the same query with Dapper.

8 Nov 2026 12 min 3
Hybrid Search and Reciprocal Rank Fusion: Combining Keyword and Vector Search
Artificial Intelligence PART 08

Hybrid Search and Reciprocal Rank Fusion: Combining Keyword and Vector Search

Vector search misses SKUs, ISBNs and rare terms; adding keyword search with PostgreSQL tsvector (turkish) and merging the two lists by rank rather than score, with Reciprocal Rank Fusion, closes that gap. We build it with EF Core, a single SQL query and VectorData HybridSearchAsync, and measure vector, keyword and hybrid recall on 30 questions.

8 Nov 2026 14 min 4
Reranking and Query Transformation: Cross-Encoders, Query Rewriting and HyDE
Artificial Intelligence PART 09

Reranking and Query Transformation: Cross-Encoders, Query Rewriting and HyDE

Retrieve wide, return narrow: passing hybrid search's 10 candidates through a reranker that reads question and chunk together raised the right chunk in first place from 15 to 23 of 30 questions, at 3.2 seconds per question. We measure conversational query rewriting, multi-query, HyDE and self-query on the same set and show when they hurt.

8 Nov 2026 14 min 5
Putting Context into the Prompt: Citations, Context Budget and "I Don't Know" on Low Scores
Artificial Intelligence PART 10

Putting Context into the Prompt: Citations, Context Budget and "I Don't Know" on Low Scores

Packing chunks as short id-tagged blocks within a token budget, getting the answer and source ids via structured output and validating the ids in code makes citations trustworthy; but a valid citation is not a correct answer. Because Turkish similarity scores overlap, a pre-model "I don't know" threshold only catches the obvious cases.

8 Nov 2026 12 min 4
Authorization and Security in RAG: Document-Level Permissions, Multi-Tenant Filters and Indirect Prompt Injection
Artificial Intelligence PART 11

Authorization and Security in RAG: Document-Level Permissions, Multi-Tenant Filters and Indirect Prompt Injection

In RAG, authorization isn't a request in the prompt but the WHERE clause of the retrieval query: told "don't reveal this", gemma3:4b told a customer the staff discount. We take tenant and ACL from the token into the query with EF Core 10 named query filters, and measure an HNSW filter returning 1 result instead of 10 and a poisoned reader review asking for card numbers.

8 Nov 2026 11 min 4
Measuring RAG: Recall@k, MRR, nDCG, Faithfulness and Groundedness
Artificial Intelligence PART 12

Measuring RAG: Recall@k, MRR, nDCG, Faithfulness and Groundedness

Measuring RAG means measuring retrieval against labelled sources (recall@k, MRR, nDCG) and generation with an LLM judge (groundedness, relevance) separately. We compare four retrieval methods on 30 questions in C#, show Microsoft.Extensions.AI.Evaluation giving 5 to an answer that misses the question, and cut a 1 min 42 s test to 1.1 s with response caching.

8 Nov 2026 12 min 4
Blog Map