Beyond ChatGPT Wrappers: Building a Real Semantic Search API with ASP.NET Core and OpenAI Embeddings
Developers often overlook semantic search, a feature that matches meaning rather than keywords, but it can be built into an ASP.NET Core API in an afternoon. This article shows how to create a minimal API that uses OpenAI's text-embedding-3-small model to match semantically relevant documents. The API accepts a list of documents and stores their embeddings, and returns the most relevant documents based on a search query. This is a more powerful and cheaper alternative to chat completions, and is more fun to build.