Semantic search API

A semantic search API is a hosted service that retrieves content by meaning instead of by exact keyword overlap. The service converts text into vector embeddings, compares the embedding of a query with the embeddings of stored items, and returns the closest matches, each with a similarity score. A shopper who searches a store for “something to keep soup warm” can be shown a listing for an insulated thermos, even though the listing never mentions soup.

Semantic search is the retrieval technique, and a semantic search API is the product that packages that technique behind an endpoint. A team sends a query to the API and gets ranked matches back without hosting a vector index or the infrastructure that serves it.

In short: an application sends a query to a semantic search API and gets back the stored items closest in meaning, each with a score, even when there’s no exact wording match.

How a semantic search API works

Most of the work with a semantic search API happens before the first query, when the collection (the full set of documents or records an application wants to search) is embedded and indexed:

  1. Embed the collection: An embedding model converts each document, passage, or product record into a vector, usually after long documents have been split into passages through chunking.
  2. Index the vectors: The service stores each embedding with its ID and metadata in an approximate nearest neighbor (ANN) index, the same kind of structure a vector database uses, so it can find close matches without comparing the query against every stored vector.
  3. Embed the query: At search time, the service converts the query with the same embedding model it used for the collection.
  4. Find the nearest neighbors: The ANN index returns the stored vectors closest to the query vector, measured with a function such as cosine similarity or dot product.
  5. Return ranked matches: Results come back as record IDs, metadata, and matching text, and each includes a retrieval score, ordered from closest to farthest from the original query.

The score’s direction depends on the metric. With similarity measures such as cosine similarity or dot product, a higher score means a closer match, while with distance measures such as Euclidean distance, a lower score means closer. Score scales also differ between providers and models, so a cutoff that works on one service rarely carries over to another and should be set by testing real queries.

Types of semantic search APIs

Providers differ in how much of the semantic search pipeline they run. The two types below have some overlap, but they differ in how much of the pipeline they take over:

Type What you send What the service runs What your team still handles
Managed vector search Records with vectors, or text the service embeds with an integrated model, plus IDs and metadata Storage, ANN indexing, metadata filtering, and similarity search Chunking, choosing what to store, and keeping records in sync with the source
Managed retrieval Raw documents, or a connection to a data source Chunking, embedding, indexing, and search, often with reranking Choosing which sources to connect and what to do with the results

An embedding API, which converts text to vectors and retrieves nothing, is a building block for either type rather than a semantic search API itself. Hybrid search is a retrieval method that either type can offer. The service runs keyword and semantic retrieval side by side and merges the two lists, which can help catalogs that hold both product codes and descriptive text.

  • A vector database stores embeddings and returns the records closest to a query vector as IDs, metadata, and scores. Many vector databases can now embed text with an integrated model, so the line between a vector database and a semantic search API is thin. The practical difference is how much of the pipeline (chunking, model choice, scaling, and updates) your team configures and operates.
  • Keyword search matches the literal terms in a query and is the stronger choice for exact strings such as order numbers, error codes, file names, and model numbers. (An example is BM25, a standard keyword ranking function that scores a document by how often the query’s terms appear in it, weighted by how rare each term is.) A semantic search API is stronger when people describe the same thing in different words.
  • Retrieval-augmented generation (RAG) is a pattern built on top of these components. A RAG system uses semantic search, keyword search, or both to retrieve passages and then passes them to a large language model (LLM) to write an answer, so a semantic search API is one of the parts a RAG system is assembled from.

Known limits of embedding-based retrieval

Research on embedding dimensions, along with a published comparison by a member of the Mercari search team, shows why semantic retrieval is usually paired with other methods.

Embedding dimension caps the result sets a single vector can represent

In 2025, researchers from Google DeepMind and Johns Hopkins University proved that the dimension of an embedding limits how many distinct top-k result sets a single-vector retriever can return, then tested that limit empirically on LIMIT, a dataset of deliberately simple queries such as “who likes X”. State-of-the-art, single-vector embedding models struggled on it. Their performance improved as the embedding dimension grew, but larger embeddings didn’t remove the limitation.

Other architectures did better on the same task. BM25 came close to perfect scores; a multi-vector model (GTE-ModernColBERT) scored well above the single-vector models even though it still fell short of solving the task; and a long-context reranker (Gemini 2.5 Pro) solved all 1,000 queries in the paper’s small setting. Keyword matching has a blind spot of its own: when the researchers replaced the items with synonyms, BM25’s score dropped by more than 89%, compared with 38.9% for Qwen3 Embedding. One practical response is to pair first-stage semantic retrieval with keyword matching and a reranking step.

Matching ranking scores can hide mostly different result sets

Kentaro Takiguchi, a Search ML engineer at Mercari, compared a tuned lexical search system with a fine-tuned semantic search model on the public Amazon ESCI product search dataset. He found that, after tuning, the two systems scored almost the same on NDCG (normalized discounted cumulative gain), the usual measure of ranking quality, which gives more credit when the most relevant results appear near the top. The semantic system’s precision was much lower, though, and Takiguchi said in the talk that “low precision is not acceptable in production.”

Takiguchi’s overlap analysis showed how different the two systems were. Out of the top 100 results each system returned, the two shared an average of 28.6 documents per query. Lexical search did better on queries that expect exact matches, such as book titles and model names, while semantic search did better on longer, natural-language queries. Two systems with the same NDCG can return mostly different documents, so a semantic search API should be judged on precision and on a team’s own mix of queries, as well as on ranking metrics. In the same talk, fusing the lexical and semantic result lists produced the best NDCG of any configuration tested (an NDCG@100 of 0.5945 with min-max fusion, against 0.5394 for lexical search and 0.5328 for semantic search alone), which supports pairing the two methods.

Running a semantic search API in production

A handful of operating choices and best practices can help keep results accurate, even as a collection grows and changes.

  • Use one embedding model for items and queries: Embeddings from different models aren’t comparable. When the dimensions differ, the mismatch usually raises an error, but when they happen to match, the service returns wrong matches with no error to flag them.
  • Store the model version with every item: A new embedding model places items differently, so changing models means re-embedding the whole collection. Recording the model version next to each stored item shows which records an older model produced and makes a gradual migration possible.
  • Plan storage by dimension and numeric precision: Google’s EmbeddingGemma 2 outputs 768-dimension vectors, so one million of them take about 1.5 GB at bfloat16 (a 16-bit number format that stores each value in 2 bytes) and about 3.1 GB at float32 (the standard 32-bit format, which uses 4 bytes per value), before any index overhead. The model card says quality is close to lossless down to 256 dimensions (about 0.5 GB per million vectors at bfloat16) and that 128 dimensions degrade multimodal quality substantially, so 128d is best suited to text-only workloads and should be validated against your own workload before adoption.
  • Keep a keyword path for exact strings: Order numbers, error codes, file names, and filters such as price or stock levels are better served by keyword search and database filters, with semantic matching applied to the descriptive text.
  • Test small collections before ruling out semantic search: A short help-center FAQ can still gain from semantic matching, because users phrase the same question in many ways, while a catalog of replacement parts for a lawnmower (which are searched mostly by exact part number) usually gains little from semantic matching.

Where semantic search APIs are used

  • Help centers and support search: Matching a message like “my card got declined” to a webpage discussing “Why a payment fails”.
  • Product discovery: Surfacing listings from descriptive queries, usually alongside keyword search for brand and model names.
  • RAG over internal company data: Retrieving passages from internal documents, tickets, or contracts for an LLM to answer from.
  • Agents that combine internal and web data: An agent can query a semantic search API for internal knowledge and a web search API for current, public information, then reason over both in one context window.

A semantic search API is most useful where users and documents describe the same thing in different words, and it works best as one retrieval path among several, next to keyword search, reranking, and a web source for anything outside an organization’s own collection.

The Brave Search API retrieves data from the public Web and sits alongside a semantic search API over a company’s internal data. Its LLM Context endpoint returns ranked, pre-extracted web content from Brave’s independent index, sized to a token budget the developer sets. LLM Context is part of the Search plan, available with a Brave Search API account.

Semantic search, search API, vector embeddings, vector database, hybrid search, reranking, retrieval score, chunking, retrieval-augmented generation (RAG), large language model (LLM), context window, web grounding.

Brave logo

Almost there…

Please continue the installation of Brave in the .

Please continue the installation of Brave in the .

You’re just 60 seconds away from the best privacy online

  1. Download Brave
  2. Run the installer
  3. Import settings
  1. step 1
    Download Brave

    Open the installer from Chrome's downloads (it should be in the upper right corner of this window).

  2. step 2
    Run the installer

    If you're prompted to, click “Yes” in the User Access Control dialog.

  3. step 3
    Import settings

    Wait for the installation to finish, then import your browser settings from Chrome.

If your download didn’t start automatically, click .

Need help?