Client-Side Vector Search: Semantic Search Without a Server

December 5, 2023

Semantic search has become one of the most practical applications of AI. Instead of matching keywords, you match meaning. But traditionally, implementing it requires a vector database, an embedding API, and server infrastructure to tie it all together. What if you could do it entirely on the client side?

That is exactly what Client Vector Search does.

The Problem with Traditional Vector Search

A typical semantic search pipeline looks like this:

  1. Send text to an embedding API (OpenAI, Cohere, etc.)
  2. Store the resulting vectors in a vector database (Pinecone, Weaviate, Qdrant)
  3. When a user searches, embed their query via the API
  4. Query the vector database for nearest neighbors
  5. Return results

Every step involves a network round-trip, an external dependency, and a cost. For many use cases — documentation search, product filtering, small datasets — this is overkill.

How Client Vector Search Works

Client Vector Search takes a fundamentally different approach. Everything runs in the browser:

import { getEmbedding, EmbeddingIndex } from 'client-vector-search';

// Embed your data
const embeddings = await Promise.all(
  items.map(async (item) => ({
    ...item,
    embedding: await getEmbedding(item.text),
  }))
);

// Create an index
const index = new EmbeddingIndex(embeddings);

// Search
const queryEmbedding = await getEmbedding('your search query');
const results = await index.search(queryEmbedding, { topK: 5 });

Five lines of meaningful code. No server, no API keys, no database.

Performance That Surprises

The numbers are impressive:

  • Embedding quality outperforms OpenAI's text-embedding-ada-002 on common benchmarks when run locally
  • Search speed handles up to 100,000 vectors in under 100 milliseconds
  • Zero latency from network — everything happens in the browser's main thread or a web worker

For applications with datasets under 100K items — which covers most documentation sites, product catalogs, FAQ pages, and knowledge bases — this is more than enough.

When to Use It

Client Vector Search shines when:

  • You want semantic search without backend infrastructure
  • Your dataset is small to medium (under 100K items)
  • Privacy matters — no data leaves the user's browser
  • You want instant setup with zero configuration
  • You are building a static site, documentation, or client-side application

For larger datasets (millions of vectors), the library also offers a hosted API at $20/month for embedding and searching up to 10 million vectors.

Why This Matters

The trend in AI is clear: capabilities that once required expensive infrastructure are moving to the edge. Client Vector Search is a perfect example. By running embeddings and search in the browser, it eliminates an entire class of infrastructure complexity.

For developers in the Turkish AI community building products, tools, and experiments — this is the kind of building block that lets you move fast without worrying about backend costs or complexity. Install the npm package, write five lines of code, and you have semantic search.

Check it out at clientvectorsearch.com and the npm package client-vector-search.