ExperimentMarch 26, 2025•Updated March 28, 2025•8 min read
Shipping Semantic Search
How I implemented vector search in Esy using embeddings and learned about the challenges of semantic similarity.
Shipping semantic search in Esy was a journey through the world of embeddings, vector databases, and the subtle art of measuring similarity between ideas.
Why Semantic Search?
Traditional search falls short when users phrase things differently. Embeddings let us compare meaning, not just words.
The Implementation
I used OpenAI's embedding API and a vector database to store and search document vectors. The biggest challenge? Making sure similar queries actually returned relevant results.
Embedding a Query
const embedding = await openai.embeddings.create({
input: query,
model: 'text-embedding-3-small'
});
Lessons Learned
- Not all embeddings are created equal
- Preprocessing text is crucial
- Vector search is only as good as your similarity metric
"The hardest part was tuning the system to return results that felt right—not just mathematically close."
Jordan Lee
Software Engineer