Semantic search using OpenAI, pg_embedding and Neon
Blog post from Neon
An AI-powered app was developed by integrating OpenAI, Neon, and pg_embedding to enable semantic search experiences, allowing users to submit startup ideas and receive a list of similar companies funded by Y Combinator. The app leverages semantic search to understand the meaning behind search queries using vector embeddings, which represent unstructured data and measure text relatedness through vector similarity. The OpenAI Embeddings API generates these embeddings, and pg_embedding, a Postgres extension, facilitates vector similarity searches by storing and retrieving vector data. The app's development involved gathering company data from the Y Combinator API, generating embeddings for each company's description, and storing them in a Neon database. The frontend, built with Next.js, captures user input and sends it to an API endpoint, which then returns a list of similar companies. The API, deployed on Vercel, uses Neon for database queries, Upstash for rate limiting, and Zod for request validation, ultimately providing fast results that could be optimized further with indexing for larger datasets.