A step-by-step guide to building semantic/AI-powered search in ASP.NET Core using PostgreSQL, pgvector, and the Gemini Embeddings API. Covers the limitations of keyword search, explains vector embeddings, and walks through adding an Embedding column to a Blog entity, configuring pgvector with EF Core, generating embeddings on record creation, and querying by cosine distance to return semantically relevant results. A complete demo repo with 100 seeded articles is provided.
Table of contents
The Problem With Normal SearchWhat is Vector Search?What are Embeddings?Step 1 — Generate Embeddings with GeminiStep 2 — Update Your Blog EntityStep 3 — Configure PostgreSQLStep 4 — Save Embeddings on Blog CreationStep 5 — Search by MeaningDemo CodeWhat is Next?968 Impressions